libflame  revision_anchor
Functions
FLA_QR_UT_blk_var1.c File Reference

(r)

Functions

FLA_Error FLA_QR_UT_blk_var1 (FLA_Obj A, FLA_Obj T, fla_qrut_t *cntl)
 

Function Documentation

◆ FLA_QR_UT_blk_var1()

FLA_Error FLA_QR_UT_blk_var1 ( FLA_Obj  A,
FLA_Obj  T,
fla_qrut_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 TL, TR, T0, T1, W12;
20 
21  FLA_Obj T1T, T2B;
22 
23  FLA_Obj AB1, AB2;
24 
25  dim_t b_alg, b;
26 
27  // Query the algorithmic blocksize by inspecting the length of T.
28  b_alg = FLA_Obj_length( T );
29 
30  FLA_Part_2x2( A, &ATL, &ATR,
31  &ABL, &ABR, 0, 0, FLA_TL );
32 
33  FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
34 
35  while ( FLA_Obj_min_dim( ABR ) > 0 ){
36 
37  b = min( b_alg, FLA_Obj_min_dim( ABR ) );
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_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &W12,
46  b, FLA_RIGHT );
47 
48  /*------------------------------------------------------------*/
49 
50  FLA_Part_2x1( T1, &T1T,
51  &T2B, b, FLA_TOP );
52 
53  FLA_Merge_2x1( A11,
54  A21, &AB1 );
55 
56  // Perform a QR factorization via the UT transform on AB1:
57  //
58  // / A11 \ -> QB1 R11
59  // \ A21 /
60  //
61  // where:
62  // - QB1 is formed from UB1 (which is stored column-wise below the
63  // diagonal of AB1) and T11 (which is stored to the upper triangle
64  // of T11).
65  // - R11 is stored to the upper triangle of AB1.
66 
67  FLA_QR_UT_internal( AB1, T1T,
68  FLA_Cntl_sub_qrut( cntl ) );
69 
70 
71  if ( FLA_Obj_width( A12 ) > 0 )
72  {
73  FLA_Merge_2x1( A12,
74  A22, &AB2 );
75 
76  // Apply the Householder transforms associated with UB1 and T11 to
77  // AB2:
78  //
79  // / A12 \ := QB1' / A12 \
80  // \ A22 / \ A22 /
81  //
82  // where QB1 is formed from UB1 and T11.
83 
84  FLA_Apply_Q_UT_internal( FLA_LEFT, FLA_CONJ_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE,
85  AB1, T1T, W12, AB2,
86  FLA_Cntl_sub_apqut( cntl ) );
87  }
88 
89  /*------------------------------------------------------------*/
90 
91  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
92  A10, A11, /**/ A12,
93  /* ************** */ /* ****************** */
94  &ABL, /**/ &ABR, A20, A21, /**/ A22,
95  FLA_TL );
96 
97  FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ W12,
98  FLA_LEFT );
99  }
100 
101  return FLA_SUCCESS;
102 }
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_QR_UT_internal(FLA_Obj A, FLA_Obj T, fla_qrut_t *cntl)
Definition: FLA_QR_UT_internal.c:17
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
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
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
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_Q_UT_internal(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x3_to_2x2(), FLA_Merge_2x1(), FLA_Obj_length(), FLA_Obj_min_dim(), FLA_Obj_width(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_Part_2x2(), FLA_QR_UT_internal(), FLA_Repart_1x2_to_1x3(), and FLA_Repart_2x2_to_3x3().

Referenced by FLA_QR_UT_internal().