libflame  revision_anchor
Functions
FLA_LQ_UT_blk_var1.c File Reference

(r)

Functions

FLA_Error FLA_LQ_UT_blk_var1 (FLA_Obj A, FLA_Obj T, fla_lqut_t *cntl)
 

Function Documentation

◆ FLA_LQ_UT_blk_var1()

FLA_Error FLA_LQ_UT_blk_var1 ( FLA_Obj  A,
FLA_Obj  T,
fla_lqut_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 AR1, AR2;
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_1x2( A11, A12, &AR1 );
54 
55  // Perform an LQ factorization via the UT transform on AR1:
56  //
57  // ( A11 A12 ) -> L11 QR1
58  //
59  // where:
60  // - QR1 is formed from UR1 (which is stored row-wise above the
61  // diagonal of AR1) and T11 (which is stored to the upper triangle
62  // of T11).
63  // - L11 is stored to the lower triangle of AR1.
64 
65  FLA_LQ_UT_internal( AR1, T1T,
66  FLA_Cntl_sub_lqut( cntl ));
67 
68 
69  if ( FLA_Obj_length( A21 ) > 0 )
70  {
71  FLA_Merge_1x2( A21, A22, &AR2 );
72 
73  // Apply the Householder transforms associated with UR1 and T11 to
74  // AR2:
75  //
76  // ( A21 A22 ) := ( A21 A22 ) Q1
77  //
78  // where QR1 is formed from UR1 and T11.
79 
80  FLA_Apply_Q_UT_internal( FLA_RIGHT, FLA_NO_TRANSPOSE, FLA_FORWARD, FLA_ROWWISE,
81  AR1, T1T, W12, AR2,
82  FLA_Cntl_sub_apqut( cntl ) );
83  }
84 
85  /*------------------------------------------------------------*/
86 
87  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
88  A10, A11, /**/ A12,
89  /* ************** */ /* ****************** */
90  &ABL, /**/ &ABR, A20, A21, /**/ A22,
91  FLA_TL );
92 
93  FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ W12,
94  FLA_LEFT );
95  }
96 
97  return FLA_SUCCESS;
98 }
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_LQ_UT_internal(FLA_Obj A, FLA_Obj T, fla_lqut_t *cntl)
Definition: FLA_LQ_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
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_Merge_1x2(FLA_Obj AL, FLA_Obj AR, FLA_Obj *A)
Definition: FLA_View.c:562
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
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_LQ_UT_internal(), FLA_Merge_1x2(), FLA_Obj_length(), FLA_Obj_min_dim(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_Part_2x2(), FLA_Repart_1x2_to_1x3(), and FLA_Repart_2x2_to_3x3().

Referenced by FLA_LQ_UT_internal().