libflame revision_anchor
Functions
FLA_Bidiag_UT_u_unb_var4.c File Reference

(r)

Functions

FLA_Error FLA_Bidiag_UT_u_unb_var4 (FLA_Obj A, FLA_Obj TU, FLA_Obj TV)
 
FLA_Error FLA_Bidiag_UT_u_step_unb_var4 (FLA_Obj A, FLA_Obj Y, FLA_Obj Z, FLA_Obj T, FLA_Obj S)
 

Function Documentation

◆ FLA_Bidiag_UT_u_step_unb_var4()

FLA_Error FLA_Bidiag_UT_u_step_unb_var4 ( 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 wT, w01,
53 wB, omega11,
54 w21;
57 a22l;
60 a12p;
61 FLA_Obj uT, u01,
63 u21;
66 u21p;
67 FLA_Obj vT, v01,
68 vB, nu11,
69 v21;
70 FLA_Obj dT, d0,
71 dB, delta1,
72 d2;
73 FLA_Obj eT, e0,
74 eB, epsilon1,
75 e2;
76 FLA_Obj fT, f0,
77 fB, phi1,
78 f2;
79 FLA_Obj gT, g0,
80 gB, ghi1,
81 g2;
82 FLA_Obj w, al, ap, u, up, v;
83 FLA_Obj d, e, f, g;
84
96
98 a01_b;
102 a12p_b;
105 v21_b;
107 Y20_b;
108 FLA_Obj a2;
109
111 dim_t m_A, n_A;
112 dim_t b_alg;
113
114
116
118 m_A = FLA_Obj_length( A );
119 n_A = FLA_Obj_width( A );
120
122 FLA_Obj_create( datatype_A, 1, 1, 0, 0, &last_elem );
123 FLA_Obj_create( datatype_A, 1, 1, 0, 0, &beta );
124 FLA_Obj_create( datatype_A, 1, 1, 0, 0, &alpha12 );
125 FLA_Obj_create( datatype_A, 1, 1, 0, 0, &minus_alpha12 );
131 FLA_Obj_create( datatype_A, 1, 1, 0, 0, &minus_zeta11 );
132 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &w );
133 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &al );
134 FLA_Obj_create( datatype_A, n_A, 1, 0, 0, &ap );
135 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &u );
136 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &up );
137 FLA_Obj_create( datatype_A, n_A, 1, 0, 0, &v );
138 FLA_Obj_create( datatype_A, n_A, 1, 0, 0, &d );
139 FLA_Obj_create( datatype_A, n_A, 1, 0, 0, &e );
140 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &f );
141 FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &g );
142
143 FLA_Set( FLA_ZERO, Y );
144 FLA_Set( FLA_ZERO, Z );
145
146 FLA_Part_2x2( A, &ATL, &ATR,
147 &ABL, &ABR, 0, 0, FLA_TL );
148 FLA_Part_2x2( Y, &YTL, &YTR,
149 &YBL, &YBR, 0, 0, FLA_TL );
150 FLA_Part_2x2( Z, &ZTL, &ZTR,
151 &ZBL, &ZBR, 0, 0, FLA_TL );
152 FLA_Part_2x2( T, &TTL, &TTR,
153 &TBL, &TBR, 0, 0, FLA_TL );
154 FLA_Part_2x2( S, &STL, &STR,
155 &SBL, &SBR, 0, 0, FLA_TL );
156 FLA_Part_2x1( w, &wT,
157 &wB, 0, FLA_TOP );
158 FLA_Part_2x1( al, &alT,
159 &alB, 0, FLA_TOP );
160 FLA_Part_2x1( ap, &apT,
161 &apB, 0, FLA_TOP );
162 FLA_Part_2x1( u, &uT,
163 &uB, 0, FLA_TOP );
164 FLA_Part_2x1( up, &uTp,
165 &uBp, 0, FLA_TOP );
166 FLA_Part_2x1( v, &vT,
167 &vB, 0, FLA_TOP );
168 FLA_Part_2x1( d, &dT,
169 &dB, 0, FLA_TOP );
170 FLA_Part_2x1( e, &eT,
171 &eB, 0, FLA_TOP );
172 FLA_Part_2x1( f, &fT,
173 &fB, 0, FLA_TOP );
174 FLA_Part_2x1( g, &gT,
175 &gB, 0, FLA_TOP );
176
177 while ( FLA_Obj_length( ATL ) < b_alg )
178 {
179 FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02,
180 /* ************* */ /* ************************** */
181 &a10t, /**/ &alpha11, &a12t,
182 ABL, /**/ ABR, &A20, /**/ &a21, &A22,
183 1, 1, FLA_BR );
184 FLA_Repart_2x2_to_3x3( YTL, /**/ YTR, &Y00, /**/ &y01, &Y02,
185 /* ************* */ /* ************************ */
186 &y10t, /**/ &psi11, &y12t,
187 YBL, /**/ YBR, &Y20, /**/ &y21, &Y22,
188 1, 1, FLA_BR );
189 FLA_Repart_2x2_to_3x3( ZTL, /**/ ZTR, &Z00, /**/ &z01, &Z02,
190 /* ************* */ /* ************************* */
191 &z10t, /**/ &zeta11, &z12t,
192 ZBL, /**/ ZBR, &Z20, /**/ &z21, &Z22,
193 1, 1, FLA_BR );
194 FLA_Repart_2x2_to_3x3( TTL, /**/ TTR, &T00, /**/ &t01, &T02,
195 /* ************* */ /* ************************** */
196 &t10t, /**/ &tau11, &t12t,
197 TBL, /**/ TBR, &T20, /**/ &t21, &T22,
198 1, 1, FLA_BR );
199 FLA_Repart_2x2_to_3x3( STL, /**/ STR, &S00, /**/ &s01, &S02,
200 /* ************* */ /* ************************** */
201 &s10t, /**/ &sigma11, &s12t,
202 SBL, /**/ SBR, &S20, /**/ &s21, &S22,
203 1, 1, FLA_BR );
205 /* ** */ /* ***** */
206 &omega11,
207 wB, &w21, 1, FLA_BOTTOM );
209 /* ** */ /* ***** */
210 &alpha11l,
211 alB, &a22l, 1, FLA_BOTTOM );
213 /* ** */ /* ***** */
214 &alpha11p,
215 apB, &a12p, 1, FLA_BOTTOM );
217 /* ** */ /* ***** */
218 &upsilon11,
219 uB, &u21, 1, FLA_BOTTOM );
221 /* ** */ /* ***** */
222 &upsilon11p,
223 uBp, &u21p, 1, FLA_BOTTOM );
225 /* ** */ /* ***** */
226 &nu11,
227 vB, &v21, 1, FLA_BOTTOM );
229 /* ** */ /* ****** */
230 &delta1,
231 dB, &d2, 1, FLA_BOTTOM );
233 /* ** */ /* ******** */
234 &epsilon1,
235 eB, &e2, 1, FLA_BOTTOM );
237 /* ** */ /* **** */
238 &phi1,
239 fB, &f2, 1, FLA_BOTTOM );
241 /* ** */ /* **** */
242 &ghi1,
243 gB, &g2, 1, FLA_BOTTOM );
244
245 /*------------------------------------------------------------*/
246
247 // Save last element of a01 and set it to one so we can use a01 as
248 // v10t^T in subsequent computations. We will restore a01_b later on.
249 // Also note: V20^T is stored in A02.
250 if ( FLA_Obj_length( ATL ) > 0 )
251 {
253 &a01_b, 1, FLA_BOTTOM );
256 }
257
259 a21, &a2 );
260
261 // alpha11 = alpha11 - u10t * y10t' - z10t * v10t';
262 // a21 = a21 - U20 * y10t' - Z20 * v10t';
265
266 // a12t = a12t - u10t * Y20' - z10t * V20';
269
270 // Restore last element of a01.
271 if ( FLA_Obj_length( ATL ) > 0 )
272 {
274 }
275
276 // [ alpha11, u21p, tau11 ] = House2( alpha11, a21 );
278 alpha11,
279 a21, tau11 );
280 FLA_Copy( a21, u21p );
281
282 if ( FLA_Obj_width( A22 ) > 0 )
283 {
284 // minus_inv_tau11 = - 1 / tau11;
287
288 // a12p = ( tau11 - 1 ) * a12t^T / tau11;
289 // = a12t^T - ( 1 / tau11 ) * a12t^T;
292
293 // y21 = - Y20 * ( U20' * u21p ) - V20 * ( Z20' * u21p );
296
297 FLA_Set( FLA_ZERO, y21 );
300
301 // t01 = a10t' + U20' * u21;
303 FLA_Axpy( FLA_ONE, d0, t01 );
304
305 // y21 = y21 + A22' * u21p;
307
308 // a12p = a12p - conj(y21) / tau11;
310
311 // w21 = A22 * conj(a12p);
313
314 // w21 = w21 - U20 * ( Y20' * conj(a12p) ) - Z20 * ( V20' * conj(a12p) );
317
320
323 &Y20_b, 1, FLA_TOP );
325
326 // a22l = A22 * e0 - U20 * ( Y20' * e0 ) - Z20 * ( V20' * e0 );
327 FLA_Copy( A22_l, a22l );
330
331 // y21 = y21 + conj(a12t)^T;
333
336 &v21_b, 1, FLA_TOP );
338 &a12p_b, 1, FLA_TOP );
339
340 // [ alpha12, psi11_minus_alpha12, sigma11 ] = House2s( a12p_t, a12p_b );
342 a12p_t,
343 a12p_b,
345
346 // v21 = conj( ( a12p - alpha12 * e0 ) / ( psi11 - alpha12 ) );
347 FLA_Copy( a12p, v21 );
351
352 // minus_conj_alpha12 = - conj(alpha12);
355
356 // s01 = V20' * v21;
357 // = conj(V02) * v21;
358 // = conj(V02) * conj( ( a12p - alpha12 * e0 ) / ( psi11 - alpha12 ) );
359 // = conj(V02) * ( conj(a12p) - conj(alpha12) * e0 ) / conj( psi11 - alpha12 ) );
360 // = ( conj(V02) * conj(a12p) - conj(V02) * conj(alpha12) * e0 ) / conj( psi11 - alpha12 );
361 // = ( g0 - conj(V02) * conj(alpha12) * e0 ) / conj( psi11 - alpha12 );
362 FLA_Copy( g0, s01 );
365
366 // a12t_l = alpha12;
367 // a12t_r = v21_b^T;
370 }
371
372 // u21 = u21p;
373 FLA_Copy( u21p, u21 );
374
375 if ( FLA_Obj_width( A22 ) > 0 )
376 {
377 // beta = - y21' * v21 / tau11;
381
382 // z21 = ( w21 - conj(alpha12) * a22l ) / conj(psi11 - alpha12) + beta * u21;
383 FLA_Copy( w21, z21 );
386 FLA_Axpy( beta, u21, z21 );
387
388 // y21 = y21 / tau11;
389 // z21 = z21 / sigma11;
392 }
393 else // if ( FLA_Obj_width( A22 ) == 0 )
394 {
395 // t01 = a10t' + U20' * u21;
398 }
399
400 /*------------------------------------------------------------*/
401
402 FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02,
403 a10t, alpha11, /**/ a12t,
404 /* ************** */ /* ************************ */
405 &ABL, /**/ &ABR, A20, a21, /**/ A22,
406 FLA_TL );
407 FLA_Cont_with_3x3_to_2x2( &YTL, /**/ &YTR, Y00, y01, /**/ Y02,
408 y10t, psi11, /**/ y12t,
409 /* ************** */ /* ********************** */
410 &YBL, /**/ &YBR, Y20, y21, /**/ Y22,
411 FLA_TL );
412 FLA_Cont_with_3x3_to_2x2( &ZTL, /**/ &ZTR, Z00, z01, /**/ Z02,
413 z10t, zeta11, /**/ z12t,
414 /* ************** */ /* *********************** */
415 &ZBL, /**/ &ZBR, Z20, z21, /**/ Z22,
416 FLA_TL );
417 FLA_Cont_with_3x3_to_2x2( &TTL, /**/ &TTR, T00, t01, /**/ T02,
418 t10t, tau11, /**/ t12t,
419 /* ************** */ /* ************************ */
420 &TBL, /**/ &TBR, T20, t21, /**/ T22,
421 FLA_TL );
422 FLA_Cont_with_3x3_to_2x2( &STL, /**/ &STR, S00, s01, /**/ S02,
423 s10t, sigma11, /**/ s12t,
424 /* ************** */ /* ************************ */
425 &SBL, /**/ &SBR, S20, s21, /**/ S22,
426 FLA_TL );
428 omega11,
429 /* ** */ /* ***** */
430 &wB, w21, FLA_TOP );
432 alpha11l,
433 /* ** */ /* ***** */
434 &alB, a22l, FLA_TOP );
436 alpha11p,
437 /* ** */ /* ***** */
438 &apB, a12p, FLA_TOP );
440 upsilon11,
441 /* ** */ /* ***** */
442 &uB, u21, FLA_TOP );
444 upsilon11p,
445 /* ** */ /* ***** */
446 &uBp, u21p, FLA_TOP );
448 nu11,
449 /* ** */ /* ***** */
450 &vB, v21, FLA_TOP );
452 delta1,
453 /* ** */ /* ****** */
454 &dB, d2, FLA_TOP );
456 epsilon1,
457 /* ** */ /* ******** */
458 &eB, e2, FLA_TOP );
460 phi1,
461 /* ** */ /* **** */
462 &fB, f2, FLA_TOP );
464 ghi1,
465 /* ** */ /* **** */
466 &gB, g2, FLA_TOP );
467 }
468
471 FLA_Obj_free( &beta );
480 FLA_Obj_free( &w );
481 FLA_Obj_free( &al );
482 FLA_Obj_free( &ap );
483 FLA_Obj_free( &u );
484 FLA_Obj_free( &up );
485 FLA_Obj_free( &v );
486 FLA_Obj_free( &d );
487 FLA_Obj_free( &e );
488 FLA_Obj_free( &f );
489 FLA_Obj_free( &g );
490
491 return FLA_SUCCESS;
492}
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_Mult_add(FLA_Obj alpha, FLA_Obj beta, FLA_Obj gamma)
Definition FLA_Mult_add.c:13
FLA_Error FLA_Set(FLA_Obj alpha, FLA_Obj A)
Definition FLA_Set.c:13
FLA_Error FLA_Conjugate(FLA_Obj A)
Definition FLA_Conjugate.c:13
FLA_Error FLA_Househ2s_UT(FLA_Side side, FLA_Obj chi_1, FLA_Obj x2, FLA_Obj alpha, FLA_Obj chi_1_minus_alpha, FLA_Obj tau)
Definition FLA_Househ2s_UT.c:16
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_Conjugate(), 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_Househ2s_UT(), FLA_Inv_scalc(), FLA_Merge_2x1(), FLA_MINUS_ONE, FLA_Mult_add(), 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_var4().

◆ FLA_Bidiag_UT_u_unb_var4()

FLA_Error FLA_Bidiag_UT_u_unb_var4 ( 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_var4(FLA_Obj A, FLA_Obj Y, FLA_Obj Z, FLA_Obj T, FLA_Obj S)
Definition FLA_Bidiag_UT_u_unb_var4.c:35
int FLA_Error
Definition FLA_type_defs.h:47

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

Referenced by FLA_Bidiag_UT_u().