libflame  revision_anchor
Functions
FLA_Apply_Q_UT_lhfr_blk_var3.c File Reference

(r)

Functions

FLA_Error FLA_Apply_Q_UT_lhfr_blk_var3 (FLA_Obj A, FLA_Obj TW, FLA_Obj W, FLA_Obj B, fla_apqut_t *cntl)
 

Function Documentation

◆ FLA_Apply_Q_UT_lhfr_blk_var3()

FLA_Error FLA_Apply_Q_UT_lhfr_blk_var3 ( FLA_Obj  A,
FLA_Obj  TW,
FLA_Obj  W,
FLA_Obj  B,
fla_apqut_t cntl 
)

References FLA_Axpyt_internal(), FLA_Cont_with_3x1_to_2x1(), FLA_Cont_with_3x3_to_2x2(), FLA_Copyt_internal(), FLA_Determine_blocksize(), FLA_Gemm_internal(), FLA_MINUS_ONE, FLA_Obj_min_dim(), FLA_Obj_width(), FLA_ONE, FLA_Part_2x1(), FLA_Part_2x2(), FLA_Repart_2x1_to_3x1(), FLA_Repart_2x2_to_3x3(), FLA_Trmm_internal(), and FLA_Trsm_internal().

Referenced by FLA_Apply_Q_UT_lhfr().

14 {
15  FLA_Obj ATL, ATR, A00, A01, A02,
16  ABL, ABR, A10, A11, A12,
17  A20, A21, A22;
18 
19  FLA_Obj TWTL, TWTR, TW00, TW01, TW02,
20  TWBL, TWBR, TW10, T11, W12,
21  TW20, TW21, TW22;
22 
23  FLA_Obj WTL, WTR,
24  WBL, WBR;
25 
26  FLA_Obj BT, B0,
27  BB, B1,
28  B2;
29 
30  dim_t b;
31 
32  FLA_Part_2x2( A, &ATL, &ATR,
33  &ABL, &ABR, 0, 0, FLA_TL );
34 
35  FLA_Part_2x2( TW, &TWTL, &TWTR,
36  &TWBL, &TWBR, 0, 0, FLA_TL );
37 
38  FLA_Part_2x1( B, &BT,
39  &BB, 0, FLA_TOP );
40 
41  while ( FLA_Obj_min_dim( ABR ) > 0 ){
42 
43  b = FLA_Determine_blocksize( ABR, FLA_BR, FLA_Cntl_blocksize( cntl ) );
44 
45  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
46  /* ************* */ /* ******************** */
47  &A10, /**/ &A11, &A12,
48  ABL, /**/ ABR, &A20, /**/ &A21, &A22,
49  b, b, FLA_BR );
50 
51  FLA_Repart_2x2_to_3x3( TWTL, /**/ TWTR, &TW00, /**/ &TW01, &TW02,
52  /* *************** */ /* *********************** */
53  &TW10, /**/ &T11, &W12,
54  TWBL, /**/ TWBR, &TW20, /**/ &TW21, &TW22,
55  b, b, FLA_BR );
56 
57  FLA_Repart_2x1_to_3x1( BT, &B0,
58  /* ** */ /* ** */
59  &B1,
60  BB, &B2, b, FLA_BOTTOM );
61 
62  /*------------------------------------------------------------*/
63 
64  FLA_Part_2x2( W, &WTL, &WTR,
65  &WBL, &WBR, b, FLA_Obj_width( B1 ), FLA_TL );
66 
67  // WTL = B1;
68 
69  FLA_Copyt_internal( FLA_NO_TRANSPOSE, B1, WTL,
70  FLA_Cntl_sub_copyt( cntl ) );
71 
72  // U11 = triuu( A11 );
73  // U12 = A12;
74  //
75  // WTL = inv( triu(T11) )' * ( conj(U11) * B1 + conj(U12) * B2 );
76 
77  FLA_Trmm_internal( FLA_LEFT, FLA_UPPER_TRIANGULAR,
78  FLA_CONJ_NO_TRANSPOSE, FLA_UNIT_DIAG,
79  FLA_ONE, A11, WTL,
80  FLA_Cntl_sub_trmm1( cntl ) );
81 
82  FLA_Gemm_internal( FLA_CONJ_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
83  FLA_ONE, A12, B2, FLA_ONE, WTL,
84  FLA_Cntl_sub_gemm1( cntl ) );
85 
86  FLA_Trsm_internal( FLA_LEFT, FLA_UPPER_TRIANGULAR,
87  FLA_CONJ_TRANSPOSE, FLA_NONUNIT_DIAG,
88  FLA_ONE, T11, WTL,
89  FLA_Cntl_sub_trsm( cntl ) );
90 
91  // B2 = B2 - U12^T * WTL;
92  // B1 = B1 - U11^T * WTL;
93 
94  FLA_Gemm_internal( FLA_TRANSPOSE, FLA_NO_TRANSPOSE,
95  FLA_MINUS_ONE, A12, WTL, FLA_ONE, B2,
96  FLA_Cntl_sub_gemm2( cntl ) );
97 
98  FLA_Trmm_internal( FLA_LEFT, FLA_UPPER_TRIANGULAR,
99  FLA_TRANSPOSE, FLA_UNIT_DIAG,
100  FLA_MINUS_ONE, A11, WTL,
101  FLA_Cntl_sub_trmm2( cntl ) );
102 
103  FLA_Axpyt_internal( FLA_NO_TRANSPOSE, FLA_ONE, WTL, B1,
104  FLA_Cntl_sub_axpyt( cntl ) );
105 
106  /*------------------------------------------------------------*/
107 
108  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
109  A10, A11, /**/ A12,
110  /* ************** */ /* ****************** */
111  &ABL, /**/ &ABR, A20, A21, /**/ A22,
112  FLA_TL );
113 
114  FLA_Cont_with_3x3_to_2x2( &TWTL, /**/ &TWTR, TW00, TW01, /**/ TW02,
115  TW10, T11, /**/ W12,
116  /* **************** */ /* ********************* */
117  &TWBL, /**/ &TWBR, TW20, TW21, /**/ TW22,
118  FLA_TL );
119 
120  FLA_Cont_with_3x1_to_2x1( &BT, B0,
121  B1,
122  /* ** */ /* ** */
123  &BB, B2, FLA_TOP );
124  }
125 
126  return FLA_SUCCESS;
127 }
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_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
unsigned long dim_t
Definition: FLA_type_defs.h:71
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_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
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_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_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_Obj FLA_ONE
Definition: FLA_Init.c:18
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
Definition: FLA_type_defs.h:158
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
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
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
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition: FLA_Query.c:153
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