libflame revision_anchor
Functions
FLA_Apply_Q_UT_rnfr.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLA_Apply_Q_UT_rnfr_blk_var1 (FLA_Obj A, FLA_Obj T, FLA_Obj W, FLA_Obj B, fla_apqut_t *cntl)
 
FLA_Error FLA_Apply_Q_UT_rnfr_blk_var2 (FLA_Obj A, FLA_Obj T, FLA_Obj W, FLA_Obj B, fla_apqut_t *cntl)
 
FLA_Error FLA_Apply_Q_UT_rnfr_blk_var3 (FLA_Obj A, FLA_Obj T, FLA_Obj W, FLA_Obj B, fla_apqut_t *cntl)
 

Function Documentation

◆ FLA_Apply_Q_UT_rnfr_blk_var1()

FLA_Error FLA_Apply_Q_UT_rnfr_blk_var1 ( FLA_Obj  A,
FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  B,
fla_apqut_t cntl 
)
84{
85 FLA_Obj ATL, ATR, A00, A01, A02,
86 ABL, ABR, A10, A11, A12,
87 A20, A21, A22;
88
89 FLA_Obj TL, TR, T0, T1, T2;
90
92 T2B;
93
95 WBL, WBR;
96
97 FLA_Obj BL, BR, B0, B1, B2;
98
99 dim_t b_alg, b;
100
101 // Query the algorithmic blocksize by inspecting the length of T.
103
104 FLA_Part_2x2( A, &ATL, &ATR,
105 &ABL, &ABR, 0, 0, FLA_TL );
106
107 FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
108
109 FLA_Part_1x2( B, &BL, &BR, 0, FLA_LEFT );
110
111 while ( FLA_Obj_min_dim( ABR ) > 0 ){
112
113 b = min( b_alg, FLA_Obj_min_dim( ABR ) );
114
115 FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
116 /* ************* */ /* ******************** */
117 &A10, /**/ &A11, &A12,
118 ABL, /**/ ABR, &A20, /**/ &A21, &A22,
119 b, b, FLA_BR );
120
121 FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &T2,
122 b, FLA_RIGHT );
123
124 FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, /**/ &B1, &B2,
125 b, FLA_RIGHT );
126
127 /*------------------------------------------------------------*/
128
129 FLA_Part_2x1( T1, &T1T,
130 &T2B, b, FLA_TOP );
131
132 FLA_Part_2x2( W, &WTL, &WTR,
133 &WBL, &WBR, b, FLA_Obj_length( B1 ), FLA_TL );
134
135 // WTL = B1^T;
136
138 FLA_Cntl_sub_copyt( cntl ) );
139
140 // U11 = triuu( A11 );
141 // U12 = A12;
142 // Let WTL^T be conformal to B1.
143 //
144 // WTL^T = ( B1 * U11^T + B2 * U12^T ) * inv( triu(T1T) );
145 // WTL = inv( triu(T1T)^T ) * ( U11 * B1^T + U12 * B2^T );
146
149 FLA_ONE, A11, WTL,
150 FLA_Cntl_sub_trmm1( cntl ) );
151
154 FLA_Cntl_sub_gemm1( cntl ) );
155
158 FLA_ONE, T1T, WTL,
159 FLA_Cntl_sub_trsm( cntl ) );
160
161 // B2 = B2 - WTL^T * conj(U12);
162 // B1 = B1 - WTL^T * conj(U11);
163 // = B1 - ( U11' * WTL )^T;
164
167 FLA_Cntl_sub_gemm2( cntl ) );
168
172 FLA_Cntl_sub_trmm2( cntl ) );
173
175 FLA_Cntl_sub_axpyt( cntl ) );
176
177 /*------------------------------------------------------------*/
178
179 FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
180 A10, A11, /**/ A12,
181 /* ************** */ /* ****************** */
182 &ABL, /**/ &ABR, A20, A21, /**/ A22,
183 FLA_TL );
184
185 FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ T2,
186 FLA_LEFT );
187
188 FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, B1, /**/ B2,
189 FLA_LEFT );
190 }
191
192 return FLA_SUCCESS;
193}
FLA_Error FLA_Axpyt_internal(FLA_Trans trans, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_axpyt_t *cntl)
Definition FLA_Axpyt_internal.c:16
FLA_Error FLA_Copyt_internal(FLA_Trans trans, FLA_Obj A, FLA_Obj B, fla_copyt_t *cntl)
Definition FLA_Copyt_internal.c:16
FLA_Error FLA_Gemm_internal(FLA_Trans transa, FLA_Trans transb, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C, fla_gemm_t *cntl)
Definition FLA_Gemm_internal.c:16
FLA_Error FLA_Trmm_internal(FLA_Side side, FLA_Uplo uplo, FLA_Trans transa, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_trmm_t *cntl)
Definition FLA_Trmm_internal.c:16
FLA_Error FLA_Trsm_internal(FLA_Side side, FLA_Uplo uplo, FLA_Trans transa, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_trsm_t *cntl)
Definition FLA_Trsm_internal.c:16
FLA_Obj FLA_MINUS_ONE
Definition FLA_Init.c:22
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_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
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
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition FLA_Query.c:153
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_Axpyt_internal(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x3_to_2x2(), FLA_Copyt_internal(), FLA_Gemm_internal(), FLA_MINUS_ONE, FLA_Obj_length(), FLA_Obj_min_dim(), FLA_ONE, FLA_Part_1x2(), FLA_Part_2x1(), FLA_Part_2x2(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x2_to_3x3(), FLA_Trmm_internal(), FLA_Trsm_internal(), and i.

Referenced by FLA_Apply_Q_UT_rnfr().

◆ FLA_Apply_Q_UT_rnfr_blk_var2()

FLA_Error FLA_Apply_Q_UT_rnfr_blk_var2 ( FLA_Obj  A,
FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  B,
fla_apqut_t cntl 
)
14{
15 FLA_Obj BT, B0,
16 BB, B1,
17 B2;
18
19 FLA_Obj WL, WR, W0, W1, W2;
20
21 dim_t b;
22
23 FLA_Part_2x1( B, &BT,
24 &BB, 0, FLA_TOP );
25
26 FLA_Part_1x2( W, &WL, &WR, 0, FLA_LEFT );
27
28 while ( FLA_Obj_length( BT ) < FLA_Obj_length( B ) ){
29
31
33 /* ** */ /* ** */
34 &B1,
35 BB, &B2, b, FLA_BOTTOM );
36
37 FLA_Repart_1x2_to_1x3( WL, /**/ WR, &W0, /**/ &W1, &W2,
38 b, FLA_RIGHT );
39
40 /*------------------------------------------------------------*/
41
42 // B1 = B1 * Q;
44 A, T, W1, B1,
45 FLA_Cntl_sub_apqut( cntl ) );
46
47 /*------------------------------------------------------------*/
48
50 B1,
51 /* ** */ /* ** */
52 &BB, B2, FLA_TOP );
53
54 FLA_Cont_with_1x3_to_1x2( &WL, /**/ &WR, W0, W1, /**/ W2,
55 FLA_LEFT );
56 }
57
58 return FLA_SUCCESS;
59}
FLA_Error FLA_Apply_Q_UT_internal(FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj A, FLA_Obj T, FLA_Obj W, FLA_Obj B, fla_apqut_t *cntl)
Definition FLA_Apply_Q_UT_internal.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_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition FLA_Blocksize.c:234

References FLA_Apply_Q_UT_internal(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), and i.

Referenced by FLA_Apply_Q_UT_rnfr().

◆ FLA_Apply_Q_UT_rnfr_blk_var3()

FLA_Error FLA_Apply_Q_UT_rnfr_blk_var3 ( FLA_Obj  A,
FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  B,
fla_apqut_t cntl 
)
14{
15 FLA_Obj ATL, ATR, A00, A01, A02,
16 ABL, ABR, A10, A11, A12,
17 A20, A21, A22;
18
20 TWBL, TWBR, TW10, T11, W12,
21 TW20, TW21, TW22;
22
24 WBL, WBR;
25
26 FLA_Obj BL, BR, B0, B1, B2;
27
28 dim_t b;
29
30 FLA_Part_2x2( A, &ATL, &ATR,
31 &ABL, &ABR, 0, 0, FLA_TL );
32
34 &TWBL, &TWBR, 0, 0, FLA_TL );
35
36 FLA_Part_1x2( B, &BL, &BR, 0, FLA_LEFT );
37
38 while ( FLA_Obj_min_dim( ABR ) > 0 ){
39
41
42 FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
43 /* ************* */ /* ******************** */
44 &A10, /**/ &A11, &A12,
45 ABL, /**/ ABR, &A20, /**/ &A21, &A22,
46 b, b, FLA_BR );
47
48 FLA_Repart_2x2_to_3x3( TWTL, /**/ TWTR, &TW00, /**/ &TW01, &TW02,
49 /* *************** */ /* *********************** */
50 &TW10, /**/ &T11, &W12,
51 TWBL, /**/ TWBR, &TW20, /**/ &TW21, &TW22,
52 b, b, FLA_BR );
53
54 FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, /**/ &B1, &B2,
55 b, FLA_RIGHT );
56
57 /*------------------------------------------------------------*/
58
59 FLA_Part_2x2( W, &WTL, &WTR,
60 &WBL, &WBR, b, FLA_Obj_length( B1 ), FLA_TL );
61
62 // WTL = B1;
63
65 FLA_Cntl_sub_copyt( cntl ) );
66
67 // U11 = trilu( A11 );
68 // U12 = A12;
69 // Let WTL^T be conformal to B1.
70 //
71 // WTL^T = ( B1 * U11^T + B2 * U12^T ) * inv( triu(T11) );
72 // WTL = inv( triu(T11) )^T * ( U11 * B1^T + U12 * B2^T );
73
76 FLA_ONE, A11, WTL,
77 FLA_Cntl_sub_trmm1( cntl ) );
78
81 FLA_Cntl_sub_gemm1( cntl ) );
82
85 FLA_ONE, T11, WTL,
86 FLA_Cntl_sub_trsm( cntl ) );
87
88 // B2 = B2 - WTL^T * conj(U12);
89 // B1 = B1 - WTL^T * conj(U11);
90 // = B1 - ( U11' * WTL )^T;
91
94 FLA_Cntl_sub_gemm2( cntl ) );
95
99 FLA_Cntl_sub_trmm2( cntl ) );
100
102 FLA_Cntl_sub_axpyt( cntl ) );
103
104 /*------------------------------------------------------------*/
105
106 FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
107 A10, A11, /**/ A12,
108 /* ************** */ /* ****************** */
109 &ABL, /**/ &ABR, A20, A21, /**/ A22,
110 FLA_TL );
111
113 TW10, T11, /**/ W12,
114 /* **************** */ /* ********************* */
115 &TWBL, /**/ &TWBR, TW20, TW21, /**/ TW22,
116 FLA_TL );
117
118 FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, B1, /**/ B2,
119 FLA_LEFT );
120 }
121
122 return FLA_SUCCESS;
123}

References FLA_Axpyt_internal(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x3_to_2x2(), FLA_Copyt_internal(), FLA_Determine_blocksize(), FLA_Gemm_internal(), FLA_MINUS_ONE, FLA_Obj_length(), FLA_Obj_min_dim(), FLA_ONE, FLA_Part_1x2(), FLA_Part_2x2(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x2_to_3x3(), FLA_Trmm_internal(), FLA_Trsm_internal(), and i.

Referenced by FLA_Apply_Q_UT_rnfr().