libflame  revision_anchor
Functions
FLA_Bidiag_UT_u_unb_var1.c File Reference

(r)

Functions

FLA_Error FLA_Bidiag_UT_u_unb_var1 (FLA_Obj A, FLA_Obj TU, FLA_Obj TV)
 
FLA_Error FLA_Bidiag_UT_u_step_unb_var1 (FLA_Obj A, FLA_Obj T, FLA_Obj S)
 

Function Documentation

◆ FLA_Bidiag_UT_u_step_unb_var1()

FLA_Error FLA_Bidiag_UT_u_step_unb_var1 ( FLA_Obj  A,
FLA_Obj  T,
FLA_Obj  S 
)

References FLA_Apply_H2_UT(), FLA_Cont_with_3x1_to_2x1(), FLA_Cont_with_3x3_to_2x2(), FLA_Copyt(), FLA_Gemv(), FLA_Househ2_UT(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_width(), FLA_ONE, FLA_Part_1x2(), FLA_Part_2x1(), FLA_Part_2x2(), FLA_Repart_2x1_to_3x1(), FLA_Repart_2x2_to_3x3(), FLA_Set(), and FLA_ZERO.

Referenced by FLA_Bidiag_UT_u_unb_var1().

19 {
20  FLA_Obj ATL, ATR, A00, a01, A02,
21  ABL, ABR, a10t, alpha11, a12t,
22  A20, a21, A22;
23  FLA_Obj TTL, TTR, T00, t01, T02,
24  TBL, TBR, t10t, tau11, t12t,
25  T20, t21, T22;
26  FLA_Obj STL, STR, S00, s01, S02,
27  SBL, SBR, s10t, sigma11, s12t,
28  S20, s21, S22;
29  FLA_Obj vT, v01,
30  vB, nu11,
31  v21;
32  FLA_Obj v;
33 
34  FLA_Obj a12t_l, a12t_r;
35  FLA_Obj A22_l, A22_r;
36  FLA_Obj v21_t,
37  v21_b;
38 
39  FLA_Datatype datatype_A;
40  dim_t n_A;
41  dim_t b_alg;
42 
43 
44  b_alg = FLA_Obj_length( T );
45 
46  datatype_A = FLA_Obj_datatype( A );
47  n_A = FLA_Obj_width( A );
48 
49  FLA_Obj_create( datatype_A, n_A, 1, 0, 0, &v );
50 
51  FLA_Part_2x2( A, &ATL, &ATR,
52  &ABL, &ABR, 0, 0, FLA_TL );
53  FLA_Part_2x2( T, &TTL, &TTR,
54  &TBL, &TBR, 0, 0, FLA_TL );
55  FLA_Part_2x2( S, &STL, &STR,
56  &SBL, &SBR, 0, 0, FLA_TL );
57  FLA_Part_2x1( v, &vT,
58  &vB, 0, FLA_TOP );
59 
60  while ( FLA_Obj_length( ATL ) < b_alg )
61  {
62  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02,
63  /* ************* */ /* ************************** */
64  &a10t, /**/ &alpha11, &a12t,
65  ABL, /**/ ABR, &A20, /**/ &a21, &A22,
66  1, 1, FLA_BR );
67  FLA_Repart_2x2_to_3x3( TTL, /**/ TTR, &T00, /**/ &t01, &T02,
68  /* ************* */ /* ************************** */
69  &t10t, /**/ &tau11, &t12t,
70  TBL, /**/ TBR, &T20, /**/ &t21, &T22,
71  1, 1, FLA_BR );
72  FLA_Repart_2x2_to_3x3( STL, /**/ STR, &S00, /**/ &s01, &S02,
73  /* ************* */ /* ************************** */
74  &s10t, /**/ &sigma11, &s12t,
75  SBL, /**/ SBR, &S20, /**/ &s21, &S22,
76  1, 1, FLA_BR );
77  FLA_Repart_2x1_to_3x1( vT, &v01,
78  /* ** */ /* ***** */
79  &nu11,
80  vB, &v21, 1, FLA_BOTTOM );
81 
82  /*------------------------------------------------------------*/
83 
84  // [ alpha11_new, u21, tau11 ] = House2( alpha11, a21 );
85  FLA_Househ2_UT( FLA_LEFT,
86  alpha11,
87  a21, tau11 );
88 
89  if ( FLA_Obj_width( A22 ) > 0 )
90  {
91  FLA_Part_1x2( a12t, &a12t_l, &a12t_r, 1, FLA_LEFT );
92  FLA_Part_1x2( A22, &A22_l, &A22_r, 1, FLA_LEFT );
93  FLA_Part_2x1( v21, &v21_t,
94  &v21_b, 1, FLA_TOP );
95 
96  // Apply H from the left to a12t and A22.
97  FLA_Apply_H2_UT( FLA_LEFT, tau11, a21, a12t, A22 );
98 
99  // [ alpha12t, u12t_r, tau11 ] = House2( a12t_l, a12t_r );
100  FLA_Househ2_UT( FLA_RIGHT, a12t_l, a12t_r, sigma11 );
101 
102  // v21_t = 1;
103  // v21_b = a12t_r;
104  FLA_Set( FLA_ONE, v21_t );
105  FLA_Copyt( FLA_TRANSPOSE, a12t_r, v21_b );
106 
107  // Apply H from the right to A22.
108  FLA_Apply_H2_UT( FLA_RIGHT, sigma11, v21_b, A22_l, A22_r );
109 
110  // s01 = conj(V02) * v21;
111  FLA_Gemv( FLA_CONJ_NO_TRANSPOSE, FLA_ONE, A02, v21, FLA_ZERO, s01 );
112  }
113 
114  // t01 = a10t' + U20' * u21;
115  FLA_Copyt( FLA_CONJ_TRANSPOSE, a10t, t01 );
116  FLA_Gemv( FLA_CONJ_TRANSPOSE, FLA_ONE, A20, a21, FLA_ONE, t01 );
117 
118  /*------------------------------------------------------------*/
119 
120  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02,
121  a10t, alpha11, /**/ a12t,
122  /* ************** */ /* ************************ */
123  &ABL, /**/ &ABR, A20, a21, /**/ A22,
124  FLA_TL );
125  FLA_Cont_with_3x3_to_2x2( &TTL, /**/ &TTR, T00, t01, /**/ T02,
126  t10t, tau11, /**/ t12t,
127  /* ************** */ /* ************************ */
128  &TBL, /**/ &TBR, T20, t21, /**/ T22,
129  FLA_TL );
130  FLA_Cont_with_3x3_to_2x2( &STL, /**/ &STR, S00, s01, /**/ S02,
131  s10t, sigma11, /**/ s12t,
132  /* ************** */ /* ************************ */
133  &SBL, /**/ &SBR, S20, s21, /**/ S22,
134  FLA_TL );
135  FLA_Cont_with_3x1_to_2x1( &vT, v01,
136  nu11,
137  /* ** */ /* ***** */
138  &vB, v21, FLA_TOP );
139  }
140 
141  FLA_Obj_free( &v );
142 
143  return FLA_SUCCESS;
144 }
FLA_Error FLA_Obj_create(FLA_Datatype datatype, dim_t m, dim_t n, dim_t rs, dim_t cs, FLA_Obj *obj)
Definition: FLA_Obj.c:55
FLA_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
FLA_Error FLA_Househ2_UT(FLA_Side side, FLA_Obj chi_1, FLA_Obj x2, FLA_Obj tau)
Definition: FLA_Househ2_UT.c:16
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
FLA_Error FLA_Repart_2x2_to_3x3(FLA_Obj ATL, FLA_Obj ATR, FLA_Obj *A00, FLA_Obj *A01, FLA_Obj *A02, FLA_Obj *A10, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj ABL, FLA_Obj ABR, FLA_Obj *A20, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:142
FLA_Error FLA_Copyt(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Copyt.c:15
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
FLA_Error FLA_Apply_H2_UT(FLA_Side side, FLA_Obj tau, FLA_Obj u2, FLA_Obj a1, FLA_Obj A2)
Definition: FLA_Apply_H2_UT.c:13
FLA_Error FLA_Part_2x2(FLA_Obj A, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:17
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
FLA_Error FLA_Gemv(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y)
Definition: FLA_Gemv.c:15
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
Definition: FLA_type_defs.h:158
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Set.c:13
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
FLA_Error FLA_Cont_with_3x3_to_2x2(FLA_Obj *ATL, FLA_Obj *ATR, FLA_Obj A00, FLA_Obj A01, FLA_Obj A02, FLA_Obj A10, FLA_Obj A11, FLA_Obj A12, FLA_Obj *ABL, FLA_Obj *ABR, FLA_Obj A20, FLA_Obj A21, FLA_Obj A22, FLA_Quadrant quadrant)
Definition: FLA_View.c:304
int FLA_Datatype
Definition: FLA_type_defs.h:49
FLA_Error FLA_Part_1x2(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:110
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
FLA_Obj FLA_ZERO
Definition: FLA_Init.c:20

◆ FLA_Bidiag_UT_u_unb_var1()

FLA_Error FLA_Bidiag_UT_u_unb_var1 ( FLA_Obj  A,
FLA_Obj  TU,
FLA_Obj  TV 
)

References FLA_Bidiag_UT_u_step_unb_var1().

Referenced by FLA_Bidiag_UT_u().

14 {
15  return FLA_Bidiag_UT_u_step_unb_var1( A, TU, TV );
16 }
FLA_Error FLA_Bidiag_UT_u_step_unb_var1(FLA_Obj A, FLA_Obj T, FLA_Obj S)
Definition: FLA_Bidiag_UT_u_unb_var1.c:18