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 
FLA_Trmm_rlc_blk_var3(FLA_Diag diagA,FLA_Obj alpha,FLA_Obj A,FLA_Obj B,fla_trmm_t * cntl)13 FLA_Error FLA_Trmm_rlc_blk_var3( FLA_Diag diagA, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_trmm_t* cntl )
14 {
15   FLA_Obj BT,              B0,
16           BB,              B1,
17                            B2;
18 
19   dim_t b;
20 
21   FLA_Part_2x1( B,    &BT,
22                       &BB,            0, FLA_TOP );
23 
24   while ( FLA_Obj_length( BT ) < FLA_Obj_length( B ) ){
25 
26     b = FLA_Determine_blocksize( BB, FLA_BOTTOM, FLA_Cntl_blocksize( cntl ) );
27 
28     FLA_Repart_2x1_to_3x1( BT,                &B0,
29                         /* ** */            /* ** */
30                                               &B1,
31                            BB,                &B2,        b, FLA_BOTTOM );
32 
33     /*------------------------------------------------------------*/
34 
35     /* B1 = B1 * tril( A ); */
36     FLA_Trmm_internal( FLA_RIGHT, FLA_LOWER_TRIANGULAR, FLA_CONJ_NO_TRANSPOSE, diagA,
37                        alpha, A, B1,
38                        FLA_Cntl_sub_trmm( cntl ) );
39 
40     /*------------------------------------------------------------*/
41 
42     FLA_Cont_with_3x1_to_2x1( &BT,                B0,
43                                                   B1,
44                             /* ** */           /* ** */
45                               &BB,                B2,     FLA_TOP );
46 
47   }
48 
49   return FLA_SUCCESS;
50 }
51 
52