libflame revision_anchor
Functions
FLA_Apply_Q_UT_rhbr_blk_var1.c File Reference

(r)

Functions

FLA_Error FLA_Apply_Q_UT_rhbr_blk_var1 (FLA_Obj A, FLA_Obj T, FLA_Obj W, FLA_Obj B, fla_apqut_t *cntl)
 

Function Documentation

◆ FLA_Apply_Q_UT_rhbr_blk_var1()

FLA_Error FLA_Apply_Q_UT_rhbr_blk_var1 ( FLA_Obj  A,
FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  B,
fla_apqut_t cntl 
)
87{
88 FLA_Obj ATL, ATR, A00, A01, A02,
89 ABL, ABR, A10, A11, A12,
90 A20, A21, A22;
91
92 FLA_Obj TL, TR, T0, T1, T2;
93
95 T2B;
96
98 WBL, WBR;
99
100 FLA_Obj BL, BR, B0, B1, B2;
101
102 dim_t b_alg, b;
103
104 // Query the algorithmic blocksize by inspecting the length of T.
106
107 FLA_Part_2x2( A, &ATL, &ATR,
108 &ABL, &ABR, 0, 0, FLA_TL );
109
110 FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
111
112 FLA_Part_1x2( B, &BL, &BR, 0, FLA_LEFT );
113
114 while ( FLA_Obj_min_dim( ABR ) > 0 ){
115
116 b = min( b_alg, FLA_Obj_min_dim( ABR ) );
117
118 FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
119 /* ************* */ /* ******************** */
120 &A10, /**/ &A11, &A12,
121 ABL, /**/ ABR, &A20, /**/ &A21, &A22,
122 b, b, FLA_BR );
123
124 FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &T2,
125 b, FLA_RIGHT );
126
127 FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, /**/ &B1, &B2,
128 b, FLA_RIGHT );
129
130 /*------------------------------------------------------------*/
131
132 FLA_Part_2x1( T1, &T1T,
133 &T2B, b, FLA_TOP );
134
135 FLA_Part_2x2( W, &WTL, &WTR,
136 &WBL, &WBR, b, FLA_Obj_length( B1 ), FLA_TL );
137
138 // WTL = B1^T;
139
141 FLA_Cntl_sub_copyt( cntl ) );
142
143 // U11 = triuu( A11 );
144 // U12 = A12;
145 // Let WTL^T be conformal to B1.
146 //
147 // WTL^T = ( B1 * U11^T + B2 * U12^T ) * inv( triu(T1T) );
148 // WTL = inv( triu(T1T)^T ) * ( U11 * B1^T + U12 * B2^T );
149
152 FLA_ONE, A11, WTL,
153 FLA_Cntl_sub_trmm1( cntl ) );
154
157 FLA_Cntl_sub_gemm1( cntl ) );
158
161 FLA_ONE, T1T, WTL,
162 FLA_Cntl_sub_trsm( cntl ) );
163
164 // B2 = B2 - WTL^T * conj(U12);
165 // B1 = B1 - WTL^T * conj(U11);
166 // = B1 - ( U11' * WTL )^T;
167
170 FLA_Cntl_sub_gemm2( cntl ) );
171
175 FLA_Cntl_sub_trmm2( cntl ) );
176
178 FLA_Cntl_sub_axpyt( cntl ) );
179
180 /*------------------------------------------------------------*/
181
182 FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
183 A10, A11, /**/ A12,
184 /* ************** */ /* ****************** */
185 &ABL, /**/ &ABR, A20, A21, /**/ A22,
186 FLA_TL );
187
188 FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ T2,
189 FLA_LEFT );
190
191 FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, B1, /**/ B2,
192 FLA_LEFT );
193 }
194
195 return FLA_SUCCESS;
196}
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_rhbr().