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_Symm_ll_unb_var4(FLA_Obj alpha,FLA_Obj A,FLA_Obj B,FLA_Obj beta,FLA_Obj C)15 FLA_Error FLA_Symm_ll_unb_var4( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
16 {
17   FLA_Obj ATL,   ATR,      A00,  a01,     A02,
18           ABL,   ABR,      a10t, alpha11, a12t,
19                            A20,  a21,     A22;
20 
21   FLA_Obj BT,              B0,
22           BB,              b1t,
23                            B2;
24 
25   FLA_Obj CT,              C0,
26           CB,              c1t,
27                            C2;
28 
29   FLA_Scal_external( beta, C );
30 
31   FLA_Part_2x2( A,    &ATL, &ATR,
32                       &ABL, &ABR,     0, 0, FLA_TL );
33 
34   FLA_Part_2x1( B,    &BT,
35                       &BB,            0, FLA_TOP );
36 
37   FLA_Part_2x1( C,    &CT,
38                       &CB,            0, FLA_TOP );
39 
40   while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){
41 
42     FLA_Repart_2x2_to_3x3( ATL, /**/ ATR,       &A00,  /**/ &a01,     &A02,
43                         /* ************* */   /* ************************** */
44                                                 &a10t, /**/ &alpha11, &a12t,
45                            ABL, /**/ ABR,       &A20,  /**/ &a21,     &A22,
46                            1, 1, FLA_BR );
47 
48     FLA_Repart_2x1_to_3x1( BT,                &B0,
49                         /* ** */            /* ** */
50                                               &b1t,
51                            BB,                &B2,        1, FLA_BOTTOM );
52 
53     FLA_Repart_2x1_to_3x1( CT,                &C0,
54                         /* ** */            /* ** */
55                                               &c1t,
56                            CB,                &C2,        1, FLA_BOTTOM );
57 
58     /*------------------------------------------------------------*/
59 
60     /* C0 = C0 + a10t' * b1t */
61     FLA_Ger_external( alpha, a10t, b1t, C0 );
62 
63     /* c1t = c1t + alpha11 * b1t */
64     FLA_Axpys_external( alpha, alpha11, b1t, FLA_ONE, c1t );
65 
66     /* C2 = C2 + a21 * b1t */
67     FLA_Ger_external( alpha, a21, b1t, C2 );
68 
69     /*------------------------------------------------------------*/
70 
71     FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR,       A00,  a01,     /**/ A02,
72                                                      a10t, alpha11, /**/ a12t,
73                             /* ************** */  /* ************************ */
74                               &ABL, /**/ &ABR,       A20,  a21,     /**/ A22,
75                               FLA_TL );
76 
77     FLA_Cont_with_3x1_to_2x1( &BT,                B0,
78                                                   b1t,
79                             /* ** */           /* ** */
80                               &BB,                B2,     FLA_TOP );
81 
82     FLA_Cont_with_3x1_to_2x1( &CT,                C0,
83                                                   c1t,
84                             /* ** */           /* ** */
85                               &CB,                C2,     FLA_TOP );
86 
87   }
88 
89   return FLA_SUCCESS;
90 }
91 
92 #endif
93