1 /*
2
3 Copyright (C) 2014, The University of Texas at Austin
4
5 This file is part of libflame and is available under the 3-Clause
6 BSD license, which can be found in the LICENSE file at the top-level
7 directory, or at http://opensource.org/licenses/BSD-3-Clause
8
9 */
10
11 #include "FLAME.h"
12
13 #ifdef FLA_ENABLE_NON_CRITICAL_CODE
14
FLA_Trinv_un_unb_var4(FLA_Obj A)15 FLA_Error FLA_Trinv_un_unb_var4( FLA_Obj A )
16 {
17 FLA_Obj ATL, ATR, A00, a01, A02,
18 ABL, ABR, a10t, alpha11, a12t,
19 A20, a21, A22;
20
21 FLA_Part_2x2( A, &ATL, &ATR,
22 &ABL, &ABR, 0, 0, FLA_TL );
23
24 while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){
25
26 FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02,
27 /* ************* */ /* ************************** */
28 &a10t, /**/ &alpha11, &a12t,
29 ABL, /**/ ABR, &A20, /**/ &a21, &A22,
30 1, 1, FLA_BR );
31
32 /*------------------------------------------------------------*/
33
34 // a12t = a12t / triu( A22' );
35 FLA_Scal_external( FLA_MINUS_ONE, a12t );
36 FLA_Trsv_external( FLA_UPPER_TRIANGULAR, FLA_TRANSPOSE, FLA_NONUNIT_DIAG, A22, a12t );
37
38 // A02 = -a01 * a12t + A02;
39 FLA_Ger_external( FLA_MINUS_ONE, a01, a12t, A02 );
40
41 // a01 = triu( A00 ) * a01;
42 FLA_Trmv_external( FLA_UPPER_TRIANGULAR, FLA_NO_TRANSPOSE, FLA_NONUNIT_DIAG, A00, a01 );
43
44 // alpha11 = 1.0 / alpha11;
45 FLA_Invert( FLA_NO_CONJUGATE, alpha11 );
46
47 /*------------------------------------------------------------*/
48
49 FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02,
50 a10t, alpha11, /**/ a12t,
51 /* ************** */ /* ************************ */
52 &ABL, /**/ &ABR, A20, a21, /**/ A22,
53 FLA_TL );
54
55 }
56
57 return FLA_SUCCESS;
58 }
59
60 #endif
61