libflame revision_anchor
Functions
FLA_QR2_UT_blk_var1.c File Reference

(r)

Functions

FLA_Error FLA_QR2_UT_blk_var1 (FLA_Obj U, FLA_Obj D, FLA_Obj T, fla_qr2ut_t *cntl)
 

Function Documentation

◆ FLA_QR2_UT_blk_var1()

FLA_Error FLA_QR2_UT_blk_var1 ( FLA_Obj  U,
FLA_Obj  D,
FLA_Obj  T,
fla_qr2ut_t cntl 
)
15{
16 FLA_Obj UTL, UTR, U00, U01, U02,
17 UBL, UBR, U10, U11, U12,
18 U20, U21, U22;
19
20 FLA_Obj DL, DR, D0, D1, D2;
21
22 FLA_Obj TL, TR, T0, T1, W12;
23
25
27
28 dim_t b_alg, b;
29
30 // Query the algorithmic blocksize by inspecting the length of T.
32
33 FLA_Part_2x2( U, &UTL, &UTR,
34 &UBL, &UBR, 0, 0, FLA_TL );
35
36 FLA_Part_1x2( D, &DL, &DR, 0, FLA_LEFT );
37
38 FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
39
40 while ( FLA_Obj_min_dim( UBR ) > 0 ){
41
42 b = min( b_alg, FLA_Obj_min_dim( UBR ) );
43
44 FLA_Repart_2x2_to_3x3( UTL, /**/ UTR, &U00, /**/ &U01, &U02,
45 /* ************* */ /* ******************** */
46 &U10, /**/ &U11, &U12,
47 UBL, /**/ UBR, &U20, /**/ &U21, &U22,
48 b, b, FLA_BR );
49
50 FLA_Repart_1x2_to_1x3( DL, /**/ DR, &D0, /**/ &D1, &D2,
51 b, FLA_RIGHT );
52
53 FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &W12,
54 b, FLA_RIGHT );
55
56 /*------------------------------------------------------------*/
57
58 // T1T = FLA_Top_part( T1, b );
59
61 &T2B, b, FLA_TOP );
62
63 // [ U11, ...
64 // D1, T1 ] = FLA_QR2_UT( U11
65 // D1, T1T );
66
68 D1, T1T,
69 FLA_Cntl_sub_qr2ut( cntl ) );
70
71
72 if ( FLA_Obj_width( U12 ) > 0 )
73 {
74 // W12T = FLA_Top_part( W12, b );
75
77 &W12B, b, FLA_TOP );
78
79 // W12T = inv( triu( T1T ) )' * ( U12 + D1' * D2 );
80
82 FLA_Cntl_sub_copy( cntl ) );
83
86 FLA_Cntl_sub_gemm1( cntl ) );
87
91 FLA_Cntl_sub_trsm( cntl ) );
92
93 // U12 = U12 - W12T;
94 // D2 = D2 - D1 * W12T;
95
97 FLA_Cntl_sub_axpy( cntl ) );
98
101 FLA_Cntl_sub_gemm2( cntl ) );
102 }
103
104 /*------------------------------------------------------------*/
105
106 FLA_Cont_with_3x3_to_2x2( &UTL, /**/ &UTR, U00, U01, /**/ U02,
107 U10, U11, /**/ U12,
108 /* ************** */ /* ****************** */
109 &UBL, /**/ &UBR, U20, U21, /**/ U22,
110 FLA_TL );
111
112 FLA_Cont_with_1x3_to_1x2( &DL, /**/ &DR, D0, D1, /**/ D2,
113 FLA_LEFT );
114
115 FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ W12,
116 FLA_LEFT );
117
118 }
119
120 return FLA_SUCCESS;
121}
FLA_Error FLA_Axpy_internal(FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_axpy_t *cntl)
Definition FLA_Axpy_internal.c:16
FLA_Error FLA_Copy_internal(FLA_Obj A, FLA_Obj B, fla_copy_t *cntl)
Definition FLA_Copy_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
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_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
FLA_Obj FLA_MINUS_ONE
Definition FLA_Init.c:22
FLA_Obj FLA_ONE
Definition FLA_Init.c:18
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
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition FLA_Query.c:153
unsigned long dim_t
Definition FLA_type_defs.h:71
int i
Definition bl1_axmyv2.c:145
Definition FLA_type_defs.h:159

References FLA_Axpy_internal(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x3_to_2x2(), FLA_Copy_internal(), FLA_Gemm_internal(), FLA_MINUS_ONE, FLA_Obj_length(), FLA_Obj_min_dim(), FLA_Obj_width(), FLA_ONE, FLA_Part_1x2(), FLA_Part_2x1(), FLA_Part_2x2(), FLA_QR2_UT_internal(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x2_to_3x3(), FLA_Trsm_internal(), and i.

Referenced by FLA_QR2_UT_internal().