libflame  revision_anchor
Functions
FLA_Trsv_lc.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLA_Trsv_lc_blk_var1 (FLA_Diag diagA, FLA_Obj A, FLA_Obj x, fla_trsv_t *cntl)
 
FLA_Error FLA_Trsv_lc_blk_var2 (FLA_Diag diagA, FLA_Obj A, FLA_Obj x, fla_trsv_t *cntl)
 

Function Documentation

◆ FLA_Trsv_lc_blk_var1()

FLA_Error FLA_Trsv_lc_blk_var1 ( FLA_Diag  diagA,
FLA_Obj  A,
FLA_Obj  x,
fla_trsv_t cntl 
)

References FLA_Cont_with_3x1_to_2x1(), FLA_Cont_with_3x3_to_2x2(), FLA_Determine_blocksize(), FLA_Gemv_internal(), FLA_MINUS_ONE, FLA_Obj_length(), FLA_ONE, FLA_Part_2x1(), FLA_Part_2x2(), FLA_Repart_2x1_to_3x1(), FLA_Repart_2x2_to_3x3(), FLA_Trsv_internal(), and x1.

Referenced by FLA_Trsv_lc().

16 {
17  FLA_Obj ATL, ATR, A00, A01, A02,
18  ABL, ABR, A10, A11, A12,
19  A20, A21, A22;
20 
21  FLA_Obj xT, x0,
22  xB, x1,
23  x2;
24 
25  dim_t b;
26 
27  FLA_Part_2x2( A, &ATL, &ATR,
28  &ABL, &ABR, 0, 0, FLA_BR );
29 
30  FLA_Part_2x1( x, &xT,
31  &xB, 0, FLA_BOTTOM );
32 
33  while ( FLA_Obj_length( ABR ) < FLA_Obj_length( A ) ){
34 
35  b = FLA_Determine_blocksize( ATL, FLA_TL, FLA_Cntl_blocksize( cntl ) );
36 
37  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, &A01, /**/ &A02,
38  &A10, &A11, /**/ &A12,
39  /* ************* */ /* ******************** */
40  ABL, /**/ ABR, &A20, &A21, /**/ &A22,
41  b, b, FLA_TL );
42 
43  FLA_Repart_2x1_to_3x1( xT, &x0,
44  &x1,
45  /* ** */ /* ** */
46  xB, &x2, b, FLA_TOP );
47 
48  /*------------------------------------------------------------*/
49 
50  /* x1 = x1 - A21' * x2; */
51  FLA_Gemv_internal( FLA_CONJ_TRANSPOSE,
52  FLA_MINUS_ONE, A21, x2, FLA_ONE, x1,
53  FLA_Cntl_sub_gemv( cntl ) );
54 
55  /* x1 = tril( A11' ) \ x1; */
56  FLA_Trsv_internal( FLA_LOWER_TRIANGULAR, FLA_CONJ_TRANSPOSE, diagA,
57  A11, x1,
58  FLA_Cntl_sub_trsv( cntl ) );
59 
60  /*------------------------------------------------------------*/
61 
62  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, /**/ A01, A02,
63  /* ************** */ /* ****************** */
64  A10, /**/ A11, A12,
65  &ABL, /**/ &ABR, A20, /**/ A21, A22,
66  FLA_BR );
67 
68  FLA_Cont_with_3x1_to_2x1( &xT, x0,
69  /* ** */ /* ** */
70  x1,
71  &xB, x2, FLA_BOTTOM );
72 
73  }
74 
75  return FLA_SUCCESS;
76 }
FLA_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
FLA_Error FLA_Gemv_internal(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
Definition: FLA_Gemv_internal.c:16
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
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_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
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_Obj FLA_ONE
Definition: FLA_Init.c:18
Definition: FLA_type_defs.h:158
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
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
x1
Definition: bl1_dotsv2.c:374
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
FLA_Error FLA_Trsv_internal(FLA_Uplo uplo, FLA_Trans transa, FLA_Diag diag, FLA_Obj A, FLA_Obj x, fla_trsv_t *cntl)
Definition: FLA_Trsv_internal.c:16

◆ FLA_Trsv_lc_blk_var2()

FLA_Error FLA_Trsv_lc_blk_var2 ( FLA_Diag  diagA,
FLA_Obj  A,
FLA_Obj  x,
fla_trsv_t cntl 
)

References FLA_Cont_with_3x1_to_2x1(), FLA_Cont_with_3x3_to_2x2(), FLA_Determine_blocksize(), FLA_Gemv_internal(), FLA_MINUS_ONE, FLA_Obj_length(), FLA_ONE, FLA_Part_2x1(), FLA_Part_2x2(), FLA_Repart_2x1_to_3x1(), FLA_Repart_2x2_to_3x3(), FLA_Trsv_internal(), and x1.

Referenced by FLA_Trsv_lc().

14 {
15  FLA_Obj ATL, ATR, A00, A01, A02,
16  ABL, ABR, A10, A11, A12,
17  A20, A21, A22;
18 
19  FLA_Obj xT, x0,
20  xB, x1,
21  x2;
22 
23  dim_t b;
24 
25  FLA_Part_2x2( A, &ATL, &ATR,
26  &ABL, &ABR, 0, 0, FLA_BR );
27 
28  FLA_Part_2x1( x, &xT,
29  &xB, 0, FLA_BOTTOM );
30 
31  while ( FLA_Obj_length( ABR ) < FLA_Obj_length( A ) ){
32 
33  b = FLA_Determine_blocksize( ATL, FLA_TL, FLA_Cntl_blocksize( cntl ) );
34 
35  FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, &A01, /**/ &A02,
36  &A10, &A11, /**/ &A12,
37  /* ************* */ /* ******************** */
38  ABL, /**/ ABR, &A20, &A21, /**/ &A22,
39  b, b, FLA_TL );
40 
41  FLA_Repart_2x1_to_3x1( xT, &x0,
42  &x1,
43  /* ** */ /* ** */
44  xB, &x2, b, FLA_TOP );
45 
46  /*------------------------------------------------------------*/
47 
48  /* x1 = tril( A11' ) \ x1; */
49  FLA_Trsv_internal( FLA_LOWER_TRIANGULAR, FLA_CONJ_TRANSPOSE, diagA,
50  A11, x1,
51  FLA_Cntl_sub_trsv( cntl ) );
52 
53  /* x0 = x0 - A10' * x1; */
54  FLA_Gemv_internal( FLA_CONJ_TRANSPOSE,
55  FLA_MINUS_ONE, A10, x1, FLA_ONE, x0,
56  FLA_Cntl_sub_gemv( cntl ) );
57 
58  /*------------------------------------------------------------*/
59 
60  FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, /**/ A01, A02,
61  /* ************** */ /* ****************** */
62  A10, /**/ A11, A12,
63  &ABL, /**/ &ABR, A20, /**/ A21, A22,
64  FLA_BR );
65 
66  FLA_Cont_with_3x1_to_2x1( &xT, x0,
67  /* ** */ /* ** */
68  x1,
69  &xB, x2, FLA_BOTTOM );
70 
71  }
72 
73  return FLA_SUCCESS;
74 }
FLA_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
FLA_Error FLA_Gemv_internal(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
Definition: FLA_Gemv_internal.c:16
unsigned long dim_t
Definition: FLA_type_defs.h:71
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
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_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
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_Obj FLA_ONE
Definition: FLA_Init.c:18
Definition: FLA_type_defs.h:158
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
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
x1
Definition: bl1_dotsv2.c:374
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
FLA_Error FLA_Trsv_internal(FLA_Uplo uplo, FLA_Trans transa, FLA_Diag diag, FLA_Obj A, FLA_Obj x, fla_trsv_t *cntl)
Definition: FLA_Trsv_internal.c:16