libflame  revision_anchor
Functions
FLA_QR_UT_inc_blk_var2.c File Reference

(r)

Functions

FLA_Error FLA_QR_UT_inc_blk_var2 (FLA_Obj A, FLA_Obj TW, FLA_Obj U, fla_qrutinc_t *cntl)
 

Function Documentation

◆ FLA_QR_UT_inc_blk_var2()

FLA_Error FLA_QR_UT_inc_blk_var2 ( FLA_Obj  A,
FLA_Obj  TW,
FLA_Obj  U,
fla_qrutinc_t cntl 
)
14 {
15  FLA_Obj ATL, ATR, A00, A01, A02,
16  ABL, ABR, A10, A11, A12,
17  A20, A21, A22;
18 
19  FLA_Obj TTL, WTR, T00, W01, W02,
20  TBL, TBR, T10, T11, W12,
21  T20, T21, T22;
22 
23  FLA_Obj UL, UR, U0, U11, U2;
24 
25  dim_t b;
26 
27  FLA_Part_2x2( A, &ATL, &ATR,
28  &ABL, &ABR, 0, 0, FLA_TL );
29 
30  FLA_Part_2x2( TW, &TTL, &WTR,
31  &TBL, &TBR, 0, 0, FLA_TL );
32 
33  FLA_Part_1x2( U, &UL, &UR, 0, FLA_LEFT );
34 
35  while ( FLA_Obj_min_dim( ABR ) > 0 ){
36 
37  b = FLA_Determine_blocksize( ABR, FLA_BR, FLA_Cntl_blocksize( cntl ) );
38 
39  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
40  /* ************* */ /* ******************** */
41  &A10, /**/ &A11, &A12,
42  ABL, /**/ ABR, &A20, /**/ &A21, &A22,
43  b, b, FLA_BR );
44 
45  FLA_Repart_2x2_to_3x3( TTL, /**/ WTR, &T00, /**/ &W01, &W02,
46  /* ************* */ /* ******************** */
47  &T10, /**/ &T11, &W12,
48  TBL, /**/ TBR, &T20, /**/ &T21, &T22,
49  b, b, FLA_BR );
50 
51  FLA_Repart_1x2_to_1x3( UL, /**/ UR, &U0, /**/ &U11, &U2,
52  b, FLA_RIGHT );
53 
54  /*------------------------------------------------------------*/
55 
56  /*
57  Use U11 to hold a copy of A11 to avoid a false
58  write-after-read dependency so that FLA_QR2_UT() may proceed
59  while FLA_Apply_Q_UT() executes.
60  */
61 
62 
63  /*
64  Perform a QR factorization (via UT transform) on A11:
65 
66  [ A11, T11 ] = QR_UT( A11, T11 );
67 
68  where T11 refers to a single storage block that refers to an
69  b_alg-by-b row-panel of upper triangular block Householder
70  transforms. Here, b is the storage blocksize while b_alg is
71  the algorithmic blocksize used by the QR factorization.
72  Typically b_alg << b.
73 
74  After the factorization is complete, A11 is copied into U11.
75 
76  */
77 
78  FLA_QR_UT_copy_internal( A11, T11, U11,
79  FLA_Cntl_sub_qrut( cntl ) );
80 
81 
82  /*
83  Apply Q^H to A12 from the left:
84 
85  A12 = Q^H * A12
86 
87  where Q is formed from A11 and T11. Note that W12 refers
88  to a row-panel of blocks where each block refers to an
89  b_alg-by-b row-panel of workspace.
90  */
91 
92  FLA_Apply_Q_UT_internal( FLA_LEFT, FLA_CONJ_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE,
93  U11, T11, W12, A12,
94  FLA_Cntl_sub_apqut( cntl ) );
95 
96 
97  /*
98  Update QR factorization of A11 with each block of A21, storing
99  block Householder transforms into corresponding blocks of T21.
100 
101  [ A11, ...
102  A21, T21 ] = QR2_UT( A11, ...
103  A21, T21 );
104  */
105 
106  FLA_QR2_UT_internal( A11,
107  A21, T21,
108  FLA_Cntl_sub_qr2ut( cntl ) );
109 
110 
111  /*
112  Apply Q^H to A12 and A22 from the left:
113 
114  / A12 \ = Q^H * / A12 \
115  \ A22 / \ A22 /
116 
117  where Q is formed from A21 and T21.
118  */
119 
120  FLA_Apply_Q2_UT_internal( FLA_LEFT, FLA_CONJ_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE,
121  A21, T21, W12, A12,
122  A22,
123  FLA_Cntl_sub_apq2ut( cntl ) );
124 
125  /*------------------------------------------------------------*/
126 
127  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
128  A10, A11, /**/ A12,
129  /* ************** */ /* ****************** */
130  &ABL, /**/ &ABR, A20, A21, /**/ A22,
131  FLA_TL );
132 
133  FLA_Cont_with_3x3_to_2x2( &TTL, /**/ &WTR, T00, W01, /**/ W02,
134  T10, T11, /**/ W12,
135  /* ************** */ /* ****************** */
136  &TBL, /**/ &TBR, T20, T21, /**/ T22,
137  FLA_TL );
138 
139  FLA_Cont_with_1x3_to_1x2( &UL, /**/ &UR, U0, U11, /**/ U2,
140  FLA_LEFT );
141 
142  }
143 
144  return FLA_SUCCESS;
145 }
FLA_Error FLA_Apply_Q2_UT_internal(FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj D, FLA_Obj T, FLA_Obj W, FLA_Obj C, FLA_Obj E, fla_apq2ut_t *cntl)
Definition: FLA_Apply_Q2_UT_internal.c:17
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_QR2_UT_internal(FLA_Obj U, FLA_Obj D, FLA_Obj T, fla_qr2ut_t *cntl)
Definition: FLA_QR2_UT_internal.c:16
FLA_Error FLA_QR_UT_copy_internal(FLA_Obj A, FLA_Obj T, FLA_Obj U, fla_qrut_t *cntl)
Definition: FLA_QR_UT_copy_internal.c:13
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_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_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition: FLA_Query.c:153
unsigned long dim_t
Definition: FLA_type_defs.h:71
Definition: FLA_type_defs.h:159

References FLA_Apply_Q2_UT_internal(), FLA_Apply_Q_UT_internal(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x3_to_2x2(), FLA_Determine_blocksize(), FLA_Obj_min_dim(), FLA_Part_1x2(), FLA_Part_2x2(), FLA_QR2_UT_internal(), FLA_QR_UT_copy_internal(), FLA_Repart_1x2_to_1x3(), and FLA_Repart_2x2_to_3x3().

Referenced by FLASH_QR_UT_inc_opt1().