libflame  revision_anchor
Functions
FLA_UDdate_UT_unb_var1.c File Reference

(r)

Functions

FLA_Error FLA_UDdate_UT_unb_var1 (FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T)
 

Function Documentation

◆ FLA_UDdate_UT_unb_var1()

FLA_Error FLA_UDdate_UT_unb_var1 ( FLA_Obj  R,
FLA_Obj  C,
FLA_Obj  D,
FLA_Obj  T 
)
16 {
17  FLA_Obj RTL, RTR, R00, r01, R02,
18  RBL, RBR, r10t, rho11, r12t,
19  R20, r21, R22;
20 
21  FLA_Obj CL, CR, C0, c1, C2;
22 
23  FLA_Obj DL, DR, D0, d1, D2;
24 
25  FLA_Obj TTL, TTR, T00, t01, T02,
26  TBL, TBR, t10t, tau11, w12t,
27  T20, t21, T22;
28 
29  FLA_Part_2x2( R, &RTL, &RTR,
30  &RBL, &RBR, 0, 0, FLA_TL );
31 
32  FLA_Part_1x2( C, &CL, &CR, 0, FLA_LEFT );
33 
34  FLA_Part_1x2( D, &DL, &DR, 0, FLA_LEFT );
35 
36  FLA_Part_2x2( T, &TTL, &TTR,
37  &TBL, &TBR, 0, 0, FLA_TL );
38 
39  while ( FLA_Obj_min_dim( RBR ) > 0 ){
40 
41  FLA_Repart_2x2_to_3x3( RTL, /**/ RTR, &R00, /**/ &r01, &R02,
42  /* ************* */ /* ************************** */
43  &r10t, /**/ &rho11, &r12t,
44  RBL, /**/ RBR, &R20, /**/ &r21, &R22,
45  1, 1, FLA_BR );
46 
47  FLA_Repart_1x2_to_1x3( CL, /**/ CR, &C0, /**/ &c1, &C2,
48  1, FLA_RIGHT );
49 
50  FLA_Repart_1x2_to_1x3( DL, /**/ DR, &D0, /**/ &d1, &D2,
51  1, FLA_RIGHT );
52 
53  FLA_Repart_2x2_to_3x3( TTL, /**/ TTR, &T00, /**/ &t01, &T02,
54  /* ************* */ /* ************************ */
55  &t10t, /**/ &tau11, &w12t,
56  TBL, /**/ TBR, &T20, /**/ &t21, &T22,
57  1, 1, FLA_BR );
58 
59  /*------------------------------------------------------------*/
60 
61  // Compute tau11, u1, and v2 from rho11, c1, and d1 such that tau11, u1,
62  // and v1 determine an up/downdating UT Householder transform H such that
63  // applying H from the left to the column vector consisting of rho11, c1,
64  // and d1 annihilates the entries in c1 and d1 (and updates rho11).
65  FLA_Househ3UD_UT( rho11,
66  c1,
67  d1, tau11 );
68 
69  // / r12t \ / r12t \
70  // | C2 | = H' | C2 |
71  // \ D2 / \ D2 /
72  //
73  // where H is formed from tau11, u1 (stored in c1) and v1 (stored in d1).
74  FLA_Apply_HUD_UT( FLA_LEFT,
75  tau11, w12t,
76  r12t,
77  c1, C2,
78  d1, D2 );
79 
80  /*------------------------------------------------------------*/
81 
82  FLA_Cont_with_3x3_to_2x2( &RTL, /**/ &RTR, R00, r01, /**/ R02,
83  r10t, rho11, /**/ r12t,
84  /* ************** */ /* ************************ */
85  &RBL, /**/ &RBR, R20, r21, /**/ R22,
86  FLA_TL );
87 
88  FLA_Cont_with_1x3_to_1x2( &CL, /**/ &CR, C0, c1, /**/ C2,
89  FLA_LEFT );
90 
91  FLA_Cont_with_1x3_to_1x2( &DL, /**/ &DR, D0, d1, /**/ D2,
92  FLA_LEFT );
93 
94  FLA_Cont_with_3x3_to_2x2( &TTL, /**/ &TTR, T00, t01, /**/ T02,
95  t10t, tau11, /**/ w12t,
96  /* ************** */ /* ********************** */
97  &TBL, /**/ &TBR, T20, t21, /**/ T22,
98  FLA_TL );
99  }
100 
101  // T = I + C' * C - D' * D;
102  // T = striu( T ) + 0.5*diag( T );
103  // NOTE: The only reason this 'herk' method of computing T works is because
104  // up-and-downdating is used to up/downdate a system that is being solved
105  // either by QR factorization, or the method of normal equations (Cholesky
106  // factorization on A' * A), and in either case, R will have a real diagonal.
107 
108  FLA_Set_to_identity( T );
109 
110  FLA_Herk_external( FLA_UPPER_TRIANGULAR, FLA_CONJ_TRANSPOSE,
111  FLA_ONE, C, FLA_ONE, T );
112 
113  FLA_Herk_external( FLA_UPPER_TRIANGULAR, FLA_CONJ_TRANSPOSE,
114  FLA_MINUS_ONE, D, FLA_ONE, T );
115 
116  FLA_Scale_diag( FLA_NO_CONJUGATE, FLA_ONE_HALF, T );
117 
118  return FLA_SUCCESS;
119 }
FLA_Error FLA_Herk_external(FLA_Uplo uplo, FLA_Trans trans, FLA_Obj alpha, FLA_Obj A, FLA_Obj beta, FLA_Obj C)
Definition: FLA_Herk_external.c:13
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
FLA_Obj FLA_ONE_HALF
Definition: FLA_Init.c:19
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
FLA_Error FLA_Apply_HUD_UT(FLA_Side side, FLA_Obj tau, FLA_Obj w12t, FLA_Obj u2, FLA_Obj v2, FLA_Obj r12t, FLA_Obj C2, FLA_Obj D2)
Definition: FLA_Apply_HUD_UT.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_Obj_min_dim(FLA_Obj obj)
Definition: FLA_Query.c:153
FLA_Error FLA_Scale_diag(FLA_Conj conj, FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Scale_diag.c:13
FLA_Error FLA_Set_to_identity(FLA_Obj A)
Definition: FLA_Set_to_identity.c:13
FLA_Error FLA_Househ3UD_UT(FLA_Obj chi_1, FLA_Obj x2, FLA_Obj y2, FLA_Obj tau)
Definition: FLA_Househ3UD_UT.c:16
Definition: FLA_type_defs.h:159

References FLA_Apply_HUD_UT(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x3_to_2x2(), FLA_Herk_external(), FLA_Househ3UD_UT(), FLA_MINUS_ONE, FLA_Obj_min_dim(), FLA_ONE, FLA_ONE_HALF, FLA_Part_1x2(), FLA_Part_2x2(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x2_to_3x3(), FLA_Scale_diag(), and FLA_Set_to_identity().

Referenced by FLA_UDdate_UT_internal().