libflame  revision_anchor
Functions
FLA_QR_UT_recover_tau.c File Reference

(r)

Functions

FLA_Error FLA_QR_UT_recover_tau_submatrix (FLA_Obj T, FLA_Obj t)
 
FLA_Error FLA_QR_UT_recover_tau (FLA_Obj T, FLA_Obj t)
 

Function Documentation

◆ FLA_QR_UT_recover_tau()

FLA_Error FLA_QR_UT_recover_tau ( FLA_Obj  T,
FLA_Obj  t 
)

References FLA_Check_error_level(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Obj_length(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_QR_UT_recover_tau_check(), FLA_QR_UT_recover_tau_submatrix(), FLA_Repart_1x2_to_1x3(), and FLA_Repart_2x1_to_3x1().

Referenced by FLA_LQ_UT_recover_tau().

16 {
17  FLA_Obj TL, TR, T0, T1, T2;
18 
19  FLA_Obj tT, t0,
20  tB, t1,
21  t2;
22 
23  dim_t b_alg, b;
24 
25  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
27 
28  b_alg = FLA_Obj_length( T );
29 
30  FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
31 
32  FLA_Part_2x1( t, &tT,
33  &tB, 0, FLA_TOP );
34 
35  // T matrix may include workspace; thus, T should not be placed as a loop guard.
36  while ( FLA_Obj_length( tB ) > 0 ) {
37 
38  // The blocksize should be determined that the T matrix is square.
39  b = min( FLA_Obj_length( tB ), b_alg );
40 
41  FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &T2,
42  b, FLA_RIGHT );
43 
44  FLA_Repart_2x1_to_3x1( tT, &t0,
45  /* ** */ /* ** */
46  &t1,
47  tB, &t2, b, FLA_BOTTOM );
48 
49  /*------------------------------------------------------------*/
50 
52 
53  /*------------------------------------------------------------*/
54 
55  FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ T2,
56  FLA_LEFT );
57 
58  FLA_Cont_with_3x1_to_2x1( &tT, t0,
59  t1,
60  /* ** */ /* ** */
61  &tB, t2, FLA_TOP );
62  }
63 
64  return FLA_SUCCESS;
65 }
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_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
unsigned long dim_t
Definition: FLA_type_defs.h:71
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
Definition: FLA_type_defs.h:158
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_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
FLA_Error FLA_QR_UT_recover_tau_check(FLA_Obj T, FLA_Obj tau)
Definition: FLA_QR_UT_recover_tau_check.c:13
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
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_QR_UT_recover_tau_submatrix(FLA_Obj T, FLA_Obj t)
Definition: FLA_QR_UT_recover_tau.c:68
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116

◆ FLA_QR_UT_recover_tau_submatrix()

FLA_Error FLA_QR_UT_recover_tau_submatrix ( FLA_Obj  T,
FLA_Obj  t 
)

References FLA_Cont_with_3x1_to_2x1(), FLA_Cont_with_3x3_to_2x2(), FLA_Copy_external(), FLA_Obj_min_dim(), FLA_Part_2x1(), FLA_Part_2x2(), FLA_Repart_2x1_to_3x1(), and FLA_Repart_2x2_to_3x3().

Referenced by FLA_QR_UT_recover_tau().

69 {
70  FLA_Obj TTL, TTR, T00, t01, T02,
71  TBL, TBR, t10t, tau11, t12t,
72  T20, t21, T22;
73 
74  FLA_Obj tT, t0,
75  tB, tau1,
76  t2;
77 
78 
79  FLA_Part_2x2( T, &TTL, &TTR,
80  &TBL, &TBR, 0, 0, FLA_TL );
81 
82  FLA_Part_2x1( t, &tT,
83  &tB, 0, FLA_TOP );
84 
85  while ( FLA_Obj_min_dim( TBR ) > 0 ){
86 
87  FLA_Repart_2x2_to_3x3( TTL, /**/ TTR, &T00, /**/ &t01, &T02,
88  /* ************* */ /* ************************ */
89  &t10t, /**/ &tau11, &t12t,
90  TBL, /**/ TBR, &T20, /**/ &t21, &T22,
91  1, 1, FLA_BR );
92 
93  FLA_Repart_2x1_to_3x1( tT, &t0,
94  /* ** */ /* ** */
95  &tau1,
96  tB, &t2, 1, FLA_BOTTOM );
97 
98  /*------------------------------------------------------------*/
99 
100  // tau1 = tau11;
101  FLA_Copy_external( tau11, tau1 );
102 
103  /*------------------------------------------------------------*/
104 
105  FLA_Cont_with_3x3_to_2x2( &TTL, /**/ &TTR, T00, t01, /**/ T02,
106  t10t, tau11, /**/ t12t,
107  /* ************** */ /* ********************** */
108  &TBL, /**/ &TBR, T20, t21, /**/ T22,
109  FLA_TL );
110 
111  FLA_Cont_with_3x1_to_2x1( &tT, t0,
112  tau1,
113  /* ** */ /* ** */
114  &tB, t2, FLA_TOP );
115 
116  }
117 
118  return FLA_SUCCESS;
119 }
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_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_Error FLA_Copy_external(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy_external.c:13
Definition: FLA_type_defs.h:158
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