libflame revision_anchor
Functions
FLA_Hess_UT_blk_var5.c File Reference

(r)

Functions

FLA_Error FLA_Hess_UT_blk_var5 (FLA_Obj A, FLA_Obj T)
 

Function Documentation

◆ FLA_Hess_UT_blk_var5()

FLA_Error FLA_Hess_UT_blk_var5 ( FLA_Obj  A,
FLA_Obj  T 
)
14{
15 FLA_Obj ATL, ATR, A00, A01, A02,
16 ABL, ABR, A10, A11, A12,
17 A20, A21, A22;
18 FLA_Obj UT, U0,
19 UB, U1,
20 U2;
21 FLA_Obj ZT, Z0,
22 ZB, Z1,
23 Z2;
24 FLA_Obj TL, TR, T0, T1, W12;
25
26 FLA_Obj U, Z;
33 dim_t m_A;
34 dim_t b_alg, b, bb;
35
37
39 m_A = FLA_Obj_length( A );
40
41 FLA_Obj_create( datatype_A, m_A, b_alg, 0, 0, &U );
42 FLA_Obj_create( datatype_A, m_A, b_alg, 0, 0, &Z );
43
44 FLA_Part_2x2( A, &ATL, &ATR,
45 &ABL, &ABR, 0, 0, FLA_TL );
46 FLA_Part_2x1( U, &UT,
47 &UB, 0, FLA_TOP );
48 FLA_Part_2x1( Z, &ZT,
49 &ZB, 0, FLA_TOP );
50 FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
51
52 while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) )
53 {
54 b = min( FLA_Obj_length( ABR ), b_alg );
55
56 FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
57 /* ************* */ /* ******************** */
58 &A10, /**/ &A11, &A12,
59 ABL, /**/ ABR, &A20, /**/ &A21, &A22,
60 b, b, FLA_BR );
62 /* ** */ /* ** */
63 &U1,
64 UB, &U2, b, FLA_BOTTOM );
66 /* ** */ /* ** */
67 &Z1,
68 ZB, &Z2, b, FLA_BOTTOM );
69 FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &W12,
70 b, FLA_RIGHT );
71
72 /*------------------------------------------------------------*/
73
75 &none2, &none3, b, b, FLA_TL );
76
77 bb = min( FLA_Obj_length( ABR ) - 1, b_alg );
78
81
82 // [ ABR, UB, ZB, T1 ] = FLA_Hess_UT_step_unb_var5( ABR, UB, ZB, T1, b );
83 //FLA_Hess_UT_step_unb_var5( ABR, UB, ZB, T1_tl );
85
86 // ATR = ATR - ATR * UB * inv( triu ( T1 ) ) * UB' );
87 if ( FLA_Obj_length( ATR ) > 0 )
88 {
89 // NOTE: We use ZT as temporary workspace.
92 &none2, &none3, bb, bb, FLA_TL );
93
94 // WT_l = ATR * UB_l * inv( triu( T1 ) ).
99
100 // ATR = ATR - WT_l * UB_l'
103 }
104
105 // / A12 \ = Q11' * / / A12 \ - / Z1 \ * inv( triu( T1 ) ) * U2' \
106 // \ A22 / \ \ A22 / \ Z2 / /
107 //
108 // where Q11 corresponds to the block Householder transformation
109 // associated with UB and T1.
110 if ( FLA_Obj_width( A12 ) > 0 )
111 {
114
115 // NOTE: Since A12.n > 0, we are guaranteed to not be at an edge case,
116 // namely the case where bb = b - 1 = ABR.m - 1, thus we are free to use
117 // the "full" matrix partitions in this scope block (ie: ZB instead of
118 // ZB_l).
119
120 // W12 = U2'
121 // W12 = inv( triu( T1 ) ) * W12;
125
127 A22, &ABR2 );
128
129 // / A12 \ = / A12 \ - / Z1 \ * W12
130 // \ A22 / \ A22 / \ Z2 /
133
134 // Omit the top row of UB so it has [implicit] unit diagonal, allowing us
135 // to use FLA_Apply_Q_UT() to apply the block Householder transformation
136 // corresponding to UB and T1. This trick is valid since the top row of
137 // ABR2 would normally be unchanged by the transformation (ie: multiplied
138 // by identity).
139 FLA_Part_2x1( UB, &none,
140 &UB_b, 1, FLA_TOP );
142 &ABR2_b, 1, FLA_TOP );
143
144 // Apply Q11' to A12 and A22 from the left:
145 //
146 // / A12 \ = / I - / U1 \ * inv( triu( T1 ) ) * / U1 \' \' / A12 \
147 // \ A22 / \ \ U2 / \ U2 / / \ A22 /
148 //
150 UB_b, T1_tl, W12, ABR2_b );
151 }
152
153 /*------------------------------------------------------------*/
154
155 FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
156 A10, A11, /**/ A12,
157 /* ************** */ /* ****************** */
158 &ABL, /**/ &ABR, A20, A21, /**/ A22,
159 FLA_TL );
161 U1,
162 /* ** */ /* ** */
163 &UB, U2, FLA_TOP );
165 Z1,
166 /* ** */ /* ** */
167 &ZB, Z2, FLA_TOP );
168 FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ W12,
169 FLA_LEFT );
170 }
171
172 FLA_Obj_free( &U );
173 FLA_Obj_free( &Z );
174
175 return FLA_SUCCESS;
176}
FLA_Error FLA_Hess_UT_step_opt_var5(FLA_Obj A, FLA_Obj U, FLA_Obj Z, FLA_Obj T)
Definition FLA_Hess_UT_opt_var5.c:29
FLA_Error FLA_Copyt_external(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition FLA_Copyt_external.c:13
FLA_Error FLA_Gemm_external(FLA_Trans transa, FLA_Trans transb, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C)
Definition FLA_Gemm_external.c:13
FLA_Error FLA_Trsm_external(FLA_Side side, FLA_Uplo uplo, FLA_Trans trans, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, FLA_Obj B)
Definition FLA_Trsm_external.c:13
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_Apply_Q_UT(FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj A, FLA_Obj T, FLA_Obj W, FLA_Obj B)
Definition FLA_Apply_Q_UT.c:16
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
FLA_Error FLA_Cont_with_1x3_to_1x2(FLA_Obj *AL, FLA_Obj *AR, FLA_Obj A0, FLA_Obj A1, FLA_Obj A2, FLA_Side side)
Definition FLA_View.c:475
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_Repart_1x2_to_1x3(FLA_Obj AL, FLA_Obj AR, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition FLA_View.c:267
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
int i
Definition bl1_axmyv2.c:145
Definition FLA_type_defs.h:159

References FLA_Apply_Q_UT(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Cont_with_3x3_to_2x2(), FLA_Copyt_external(), FLA_Gemm_external(), FLA_Hess_UT_step_opt_var5(), 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_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), FLA_Repart_2x2_to_3x3(), FLA_Trsm_external(), FLA_ZERO, and i.

Referenced by FLA_Hess_UT_internal().