libflame revision_anchor
Functions
FLA_Bidiag_UT_u_unb_var5.c File Reference

(r)

Functions

FLA_Error FLA_Bidiag_UT_u_unb_var5 (FLA_Obj A, FLA_Obj TU, FLA_Obj TV)
 
FLA_Error FLA_Bidiag_UT_u_step_unb_var5 (FLA_Obj A, FLA_Obj Y, FLA_Obj Z, FLA_Obj T, FLA_Obj S)
 

Function Documentation

◆ FLA_Bidiag_UT_u_step_unb_var5()

FLA_Error FLA_Bidiag_UT_u_step_unb_var5 ( FLA_Obj  A,
FLA_Obj  Y,
FLA_Obj  Z,
FLA_Obj  T,
FLA_Obj  S 
)
36{
37 FLA_Obj ATL, ATR, A00, a01, A02,
39 A20, a21, A22;
40 FLA_Obj YTL, YTR, Y00, y01, Y02,
41 YBL, YBR, y10t, psi11, y12t,
42 Y20, y21, Y22;
43 FLA_Obj ZTL, ZTR, Z00, z01, Z02,
45 Z20, z21, Z22;
46 FLA_Obj TTL, TTR, T00, t01, T02,
47 TBL, TBR, t10t, tau11, t12t,
48 T20, t21, T22;
49 FLA_Obj STL, STR, S00, s01, S02,
51 S20, s21, S22;
52 FLA_Obj uT, u01,
54 u21;
55 FLA_Obj vT, v01,
56 vB, nu11,
57 v21;
58 FLA_Obj dT, d0,
59 dB, delta1,
60 d2;
61 FLA_Obj eT, e0,
62 eB, epsilon1,
63 e2;
64 FLA_Obj fT, f0,
65 fB, phi1,
66 f2;
67 FLA_Obj gT, g0,
68 gB, ghi1,
69 g2;
70 FLA_Obj u, v;
71 FLA_Obj d, e, f, g;
72
77
79 a01_b;
82 v21_b;
83 FLA_Obj a2;
84
86 dim_t m_A, n_A;
88
89
91
93 m_A = FLA_Obj_length( A );
94 n_A = FLA_Obj_width( A );
95
96 FLA_Obj_create( datatype_A, 1, 1, 0, 0, &last_elem );
97 FLA_Obj_create( datatype_A, 1, 1, 0, 0, &beta );
99 FLA_Obj_create( datatype_A, 1, 1, 0, 0, &minus_zeta11 );
100 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &u );
101 FLA_Obj_create( datatype_A, n_A, 1, 0, 0, &v );
102 FLA_Obj_create( datatype_A, n_A, 1, 0, 0, &d );
103 FLA_Obj_create( datatype_A, n_A, 1, 0, 0, &e );
104 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &f );
105 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &g );
106
107 FLA_Set( FLA_ZERO, Y );
108 FLA_Set( FLA_ZERO, Z );
109
110 FLA_Part_2x2( A, &ATL, &ATR,
111 &ABL, &ABR, 0, 0, FLA_TL );
112 FLA_Part_2x2( Y, &YTL, &YTR,
113 &YBL, &YBR, 0, 0, FLA_TL );
114 FLA_Part_2x2( Z, &ZTL, &ZTR,
115 &ZBL, &ZBR, 0, 0, FLA_TL );
116 FLA_Part_2x2( T, &TTL, &TTR,
117 &TBL, &TBR, 0, 0, FLA_TL );
118 FLA_Part_2x2( S, &STL, &STR,
119 &SBL, &SBR, 0, 0, FLA_TL );
120 FLA_Part_2x1( u, &uT,
121 &uB, 0, FLA_TOP );
122 FLA_Part_2x1( v, &vT,
123 &vB, 0, FLA_TOP );
124 FLA_Part_2x1( d, &dT,
125 &dB, 0, FLA_TOP );
126 FLA_Part_2x1( e, &eT,
127 &eB, 0, FLA_TOP );
128 FLA_Part_2x1( f, &fT,
129 &fB, 0, FLA_TOP );
130 FLA_Part_2x1( g, &gT,
131 &gB, 0, FLA_TOP );
132
133 while ( FLA_Obj_length( ATL ) < b_alg )
134 {
135 FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02,
136 /* ************* */ /* ************************** */
137 &a10t, /**/ &alpha11, &a12t,
138 ABL, /**/ ABR, &A20, /**/ &a21, &A22,
139 1, 1, FLA_BR );
140 FLA_Repart_2x2_to_3x3( YTL, /**/ YTR, &Y00, /**/ &y01, &Y02,
141 /* ************* */ /* ************************ */
142 &y10t, /**/ &psi11, &y12t,
143 YBL, /**/ YBR, &Y20, /**/ &y21, &Y22,
144 1, 1, FLA_BR );
145 FLA_Repart_2x2_to_3x3( ZTL, /**/ ZTR, &Z00, /**/ &z01, &Z02,
146 /* ************* */ /* ************************* */
147 &z10t, /**/ &zeta11, &z12t,
148 ZBL, /**/ ZBR, &Z20, /**/ &z21, &Z22,
149 1, 1, FLA_BR );
150 FLA_Repart_2x2_to_3x3( TTL, /**/ TTR, &T00, /**/ &t01, &T02,
151 /* ************* */ /* ************************** */
152 &t10t, /**/ &tau11, &t12t,
153 TBL, /**/ TBR, &T20, /**/ &t21, &T22,
154 1, 1, FLA_BR );
155 FLA_Repart_2x2_to_3x3( STL, /**/ STR, &S00, /**/ &s01, &S02,
156 /* ************* */ /* ************************** */
157 &s10t, /**/ &sigma11, &s12t,
158 SBL, /**/ SBR, &S20, /**/ &s21, &S22,
159 1, 1, FLA_BR );
161 /* ** */ /* ***** */
162 &upsilon11,
163 uB, &u21, 1, FLA_BOTTOM );
165 /* ** */ /* ***** */
166 &nu11,
167 vB, &v21, 1, FLA_BOTTOM );
169 /* ** */ /* ****** */
170 &delta1,
171 dB, &d2, 1, FLA_BOTTOM );
173 /* ** */ /* ******** */
174 &epsilon1,
175 eB, &e2, 1, FLA_BOTTOM );
177 /* ** */ /* **** */
178 &phi1,
179 fB, &f2, 1, FLA_BOTTOM );
181 /* ** */ /* **** */
182 &ghi1,
183 gB, &g2, 1, FLA_BOTTOM );
184
185 /*------------------------------------------------------------*/
186
187 // Save last element of a01 and set it to one so we can use a01 as
188 // v10t^T in subsequent computations. We will restore a01_b later on.
189 // Also note: V20^T is stored in A02.
190 if ( FLA_Obj_length( ATL ) > 0 )
191 {
193 &a01_b, 1, FLA_BOTTOM );
196 }
197
199 a21, &a2 );
200
201 // alpha11 = alpha11 - u10t * y10t' - z10t * v10t';
202 // a21 = a21 - U20 * y10t' - Z20 * v10t';
205
206 // a12t = a12t - u10t * Y20' - z10t * V20';
209
210 // Restore last element of a01.
211 if ( FLA_Obj_length( ATL ) > 0 )
212 {
214 }
215
216 // [ alpha11, u21, tau11 ] = House2( alpha11, a21 );
218 alpha11,
219 a21, tau11 );
220 FLA_Copy( a21, u21 );
221
222 if ( FLA_Obj_width( A22 ) > 0 )
223 {
224 // y21' = a12t + u21' * A22;
225 // y21 = conj(a12t) + A22' * u21;
228
229 // y21 = y21 - Y20 * ( U20' * u21 ) - V20 * ( Z20' * u21 );
232
233 // t01 = a10t' + U20' * u21;
235 FLA_Axpy( FLA_ONE, d0, t01 );
236
239
240 // y21 = y21 / tau11;
242
243 // a12t = a12t - conj(y21)^T;
245
248 &v21_b, 1, FLA_TOP );
249
250 // [ a12t_l, v21_b, sigma11 ] = House2( a12t_l, a12t_r );
252
253 // v21_t = 1;
254 // v21_b = a12t_r^T;
257
258 // beta = - y21' * v21;
261
262 // z21 = A22 * v21 + beta * u21;
263 FLA_Copy( u21, z21 );
265
266 // z21 = z21 - U20 * ( Y20' * v21 ) - Z20 * ( V20' * v21 );
269
272
273 // z21 = z21 / sigma11;
275
276 // s01 = conj(V02) * v21;
277 FLA_Copy( g0, s01 );
278 }
279 else // if ( FLA_Obj_width( A22 ) == 0 )
280 {
281 // t01 = a10t' + U20' * u21;
284 }
285
286 /*------------------------------------------------------------*/
287
288 FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02,
289 a10t, alpha11, /**/ a12t,
290 /* ************** */ /* ************************ */
291 &ABL, /**/ &ABR, A20, a21, /**/ A22,
292 FLA_TL );
293 FLA_Cont_with_3x3_to_2x2( &YTL, /**/ &YTR, Y00, y01, /**/ Y02,
294 y10t, psi11, /**/ y12t,
295 /* ************** */ /* ********************** */
296 &YBL, /**/ &YBR, Y20, y21, /**/ Y22,
297 FLA_TL );
298 FLA_Cont_with_3x3_to_2x2( &ZTL, /**/ &ZTR, Z00, z01, /**/ Z02,
299 z10t, zeta11, /**/ z12t,
300 /* ************** */ /* *********************** */
301 &ZBL, /**/ &ZBR, Z20, z21, /**/ Z22,
302 FLA_TL );
303 FLA_Cont_with_3x3_to_2x2( &TTL, /**/ &TTR, T00, t01, /**/ T02,
304 t10t, tau11, /**/ t12t,
305 /* ************** */ /* ************************ */
306 &TBL, /**/ &TBR, T20, t21, /**/ T22,
307 FLA_TL );
308 FLA_Cont_with_3x3_to_2x2( &STL, /**/ &STR, S00, s01, /**/ S02,
309 s10t, sigma11, /**/ s12t,
310 /* ************** */ /* ************************ */
311 &SBL, /**/ &SBR, S20, s21, /**/ S22,
312 FLA_TL );
314 upsilon11,
315 /* ** */ /* ***** */
316 &uB, u21, FLA_TOP );
318 nu11,
319 /* ** */ /* ***** */
320 &vB, v21, FLA_TOP );
322 delta1,
323 /* ** */ /* ****** */
324 &dB, d2, FLA_TOP );
326 epsilon1,
327 /* ** */ /* ******** */
328 &eB, e2, FLA_TOP );
330 phi1,
331 /* ** */ /* **** */
332 &fB, f2, FLA_TOP );
334 ghi1,
335 /* ** */ /* **** */
336 &gB, g2, FLA_TOP );
337 }
338
340 FLA_Obj_free( &beta );
343 FLA_Obj_free( &u );
344 FLA_Obj_free( &v );
345 FLA_Obj_free( &d );
346 FLA_Obj_free( &e );
347 FLA_Obj_free( &f );
348 FLA_Obj_free( &g );
349
350 return FLA_SUCCESS;
351}
FLA_Error FLA_Copy(FLA_Obj A, FLA_Obj B)
Definition FLA_Copy.c:15
FLA_Error FLA_Scal(FLA_Obj alpha, FLA_Obj A)
Definition FLA_Scal.c:15
FLA_Error FLA_Dotc(FLA_Conj conj, FLA_Obj x, FLA_Obj y, FLA_Obj rho)
Definition FLA_Dotc.c:13
FLA_Error FLA_Axpy(FLA_Obj alpha, FLA_Obj A, FLA_Obj B)
Definition FLA_Axpy.c:15
FLA_Error FLA_Axpyt(FLA_Trans trans, FLA_Obj alpha, FLA_Obj A, FLA_Obj B)
Definition FLA_Axpyt.c:15
FLA_Error FLA_Copyt(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition FLA_Copyt.c:15
FLA_Error FLA_Inv_scalc(FLA_Conj conjalpha, FLA_Obj alpha, FLA_Obj A)
Definition FLA_Inv_scalc.c:13
FLA_Error FLA_Gemvc(FLA_Trans transa, FLA_Conj conjx, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y)
Definition FLA_Gemvc.c:13
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_Obj FLA_MINUS_ONE
Definition FLA_Init.c:22
FLA_Obj FLA_ZERO
Definition FLA_Init.c:20
FLA_Obj FLA_ONE
Definition FLA_Init.c:18
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
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_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_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
dim_t FLA_Obj_width(FLA_Obj obj)
Definition FLA_Query.c:123
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_Part_1x2(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition FLA_View.c:110
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
dim_t FLA_Obj_length(FLA_Obj obj)
Definition FLA_Query.c:116
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_Merge_2x1(FLA_Obj AT, FLA_Obj AB, FLA_Obj *A)
Definition FLA_View.c:541
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition FLA_Obj.c:588
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition FLA_Query.c:13
int FLA_Datatype
Definition FLA_type_defs.h:49
unsigned long dim_t
Definition FLA_type_defs.h:71
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition FLA_Set.c:13
FLA_Error FLA_Househ2_UT(FLA_Side side, FLA_Obj chi_1, FLA_Obj x2, FLA_Obj tau)
Definition FLA_Househ2_UT.c:16
int i
Definition bl1_axmyv2.c:145
Definition FLA_type_defs.h:159

References FLA_Axpy(), FLA_Axpyt(), FLA_Cont_with_3x1_to_2x1(), FLA_Cont_with_3x3_to_2x2(), FLA_Copy(), FLA_Copyt(), FLA_Dotc(), FLA_Gemv(), FLA_Gemvc(), FLA_Househ2_UT(), FLA_Inv_scalc(), FLA_Merge_2x1(), FLA_MINUS_ONE, 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_Scal(), FLA_Set(), FLA_ZERO, and i.

Referenced by FLA_Bidiag_UT_u_unb_var5().

◆ FLA_Bidiag_UT_u_unb_var5()

FLA_Error FLA_Bidiag_UT_u_unb_var5 ( FLA_Obj  A,
FLA_Obj  TU,
FLA_Obj  TV 
)
14{
16 FLA_Obj Y, Z;
18 dim_t m_A, n_A;
19
21 m_A = FLA_Obj_length( A );
22 n_A = FLA_Obj_width( A );
23
24 FLA_Obj_create( datatype_A, n_A, n_A, 0, 0, &Y );
25 FLA_Obj_create( datatype_A, m_A, n_A, 0, 0, &Z );
26
28
29 FLA_Obj_free( &Y );
30 FLA_Obj_free( &Z );
31
32 return r_val;
33}
FLA_Error FLA_Bidiag_UT_u_step_unb_var5(FLA_Obj A, FLA_Obj Y, FLA_Obj Z, FLA_Obj T, FLA_Obj S)
Definition FLA_Bidiag_UT_u_unb_var5.c:35
int FLA_Error
Definition FLA_type_defs.h:47

References FLA_Bidiag_UT_u_step_unb_var5(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_width(), and i.

Referenced by FLA_Bidiag_UT_u().