libflame revision_anchor
FLA_UDdate_UT.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLA_UDdate_UT (FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T)
 
FLA_Error FLA_UDdate_UT_internal (FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T, fla_uddateut_t *cntl)
 
FLA_Error FLA_UDdate_UT_create_T (FLA_Obj R, FLA_Obj *T)
 
FLA_Error FLA_UDdate_UT_update_rhs (FLA_Obj T, FLA_Obj bR, FLA_Obj C, FLA_Obj bC, FLA_Obj D, FLA_Obj bD)
 
FLA_Error FLA_UDdate_UT_solve (FLA_Obj R, FLA_Obj bR, FLA_Obj x)
 

Function Documentation

◆ FLA_UDdate_UT()

FLA_Error FLA_UDdate_UT ( FLA_Obj R,
FLA_Obj C,
FLA_Obj D,
FLA_Obj T )
17{
18 FLA_Error r_val;
19
20 // Check parameters.
21 if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
22 FLA_UDdate_UT_check( R, C, D, T );
23
24 // Invoke the _internal() back-end with the standard control tree.
26
27 return r_val;
28}
fla_uddateut_t * fla_uddateut_cntl_leaf
Definition FLA_UDdate_UT_cntl_init.c:16
FLA_Error FLA_UDdate_UT_internal(FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T, fla_uddateut_t *cntl)
Definition FLA_UDdate_UT_internal.c:16
FLA_Error FLA_UDdate_UT_check(FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T)
Definition FLA_UDdate_UT_check.c:13
unsigned int FLA_Check_error_level(void)
Definition FLA_Check.c:18
int FLA_Error
Definition FLA_type_defs.h:47

References FLA_Check_error_level(), FLA_UDdate_UT_check(), FLA_UDdate_UT_internal(), and fla_uddateut_cntl_leaf.

◆ FLA_UDdate_UT_create_T()

FLA_Error FLA_UDdate_UT_create_T ( FLA_Obj R,
FLA_Obj * T )
14{
15 FLA_Datatype datatype;
16 dim_t b_alg, k;
17 dim_t rs_T, cs_T;
18
19 // Query the datatype of R.
20 datatype = FLA_Obj_datatype( R );
21
22 // Query the blocksize from the library.
23 b_alg = FLA_Query_blocksize( datatype, FLA_DIMENSION_MIN );
24
25 // We want the width of R, which is the same as that of C and D. Also,
26 // R should be square, so we could grab either dimension.
27 k = FLA_Obj_width( R );
28
29 // Figure out whether T should be row-major or column-major.
30 if ( FLA_Obj_row_stride( R ) == 1 )
31 {
32 rs_T = 1;
33 cs_T = b_alg;
34 }
35 else // if ( FLA_Obj_col_stride( R ) == 1 )
36 {
37 rs_T = k;
38 cs_T = 1;
39 }
40
41 // Create a b_alg x k matrix to hold the block Householder transforms that
42 // will be accumulated within the UDdate operation algorithm.
43 FLA_Obj_create( datatype, b_alg, k, rs_T, cs_T, T );
44
45 return FLA_SUCCESS;
46}
dim_t FLA_Obj_width(FLA_Obj obj)
Definition FLA_Query.c:123
FLA_Error FLA_Obj_create(FLA_Datatype datatype, dim_t m, dim_t n, dim_t rs, dim_t cs, FLA_Obj *obj)
Definition FLA_Obj.c:55
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition FLA_Query.c:167
dim_t FLA_Query_blocksize(FLA_Datatype dt, FLA_Dimension dim)
Definition FLA_Blocksize.c:161
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition FLA_Query.c:13
int FLA_Datatype
Definition FLA_type_defs.h:49
unsigned long dim_t
Definition FLA_type_defs.h:71

References FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Query_blocksize().

◆ FLA_UDdate_UT_internal()

FLA_Error FLA_UDdate_UT_internal ( FLA_Obj R,
FLA_Obj C,
FLA_Obj D,
FLA_Obj T,
fla_uddateut_t * cntl )
19{
20 FLA_Error r_val = FLA_SUCCESS;
21
22 if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
23 FLA_UDdate_UT_internal_check( R, C, D, T, cntl );
24
25 if ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
26 FLA_Obj_elemtype( R ) == FLA_MATRIX &&
27 FLA_Cntl_variant( cntl ) == FLA_SUBPROBLEM )
28 {
29 // Recurse
30 r_val = FLA_UDdate_UT_internal( *FLASH_OBJ_PTR_AT( R ),
31 *FLASH_OBJ_PTR_AT( C ),
32 *FLASH_OBJ_PTR_AT( D ),
33 *FLASH_OBJ_PTR_AT( T ),
35 }
36 else if ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
37 FLA_Obj_elemtype( R ) == FLA_SCALAR &&
39 {
40 // Enqueue
41 ENQUEUE_FLASH_UDdate_UT( R, C, D, T, cntl );
42 }
43 else
44 {
45 if ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
46 FLA_Obj_elemtype( R ) == FLA_SCALAR &&
48 {
49 // Execute leaf.
51 }
52
53 if ( FLA_Cntl_variant( cntl ) == FLA_UNBLOCKED_VARIANT1 )
54 {
55 r_val = FLA_UDdate_UT_unb_var1( R, C, D, T );
56 }
57 else if ( FLA_Cntl_variant( cntl ) == FLA_UNB_OPT_VARIANT1 )
58 {
59 r_val = FLA_UDdate_UT_opt_var1( R, C, D, T );
60 }
61 else if ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT1 )
62 {
63 r_val = FLA_UDdate_UT_blk_var1( R, C, D, T, cntl );
64 }
65 else if ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT2 )
66 {
67 r_val = FLA_UDdate_UT_blk_var2( R, C, D, T, cntl );
68 }
69 else
70 {
71 FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
72 }
73 }
74
75 return r_val;
76}
FLA_Bool FLASH_Queue_get_enabled(void)
Definition FLASH_Queue.c:171
FLA_Error FLA_UDdate_UT_blk_var1(FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T, fla_uddateut_t *cntl)
Definition FLA_UDdate_UT_blk_var1.c:13
FLA_Error FLA_UDdate_UT_blk_var2(FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T, fla_uddateut_t *cntl)
Definition FLA_UDdate_UT_blk_var2.c:13
fla_uddateut_t * fla_uddateut_cntl_leaf
Definition FLA_UDdate_UT_cntl_init.c:16
fla_uddateut_t * flash_uddateut_cntl
Definition FLASH_UDdate_UT_cntl_init.c:14
FLA_Error FLA_UDdate_UT_internal(FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T, fla_uddateut_t *cntl)
Definition FLA_UDdate_UT_internal.c:16
FLA_Error FLA_UDdate_UT_internal_check(FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T, fla_uddateut_t *cntl)
Definition FLA_UDdate_UT_internal_check.c:13
FLA_Error FLA_UDdate_UT_opt_var1(FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T)
Definition FLA_UDdate_UT_opt_var1.c:13
FLA_Error FLA_UDdate_UT_unb_var1(FLA_Obj R, FLA_Obj C, FLA_Obj D, FLA_Obj T)
Definition FLA_UDdate_UT_unb_var1.c:13
FLA_Elemtype FLA_Obj_elemtype(FLA_Obj obj)
Definition FLA_Query.c:51

References FLA_Check_error_level(), FLA_Obj_elemtype(), FLA_UDdate_UT_blk_var1(), FLA_UDdate_UT_blk_var2(), FLA_UDdate_UT_internal(), FLA_UDdate_UT_internal_check(), FLA_UDdate_UT_opt_var1(), FLA_UDdate_UT_unb_var1(), fla_uddateut_cntl_leaf, FLASH_Queue_get_enabled(), and flash_uddateut_cntl.

Referenced by FLA_UDdate_UT(), FLA_UDdate_UT_blk_var1(), FLA_UDdate_UT_blk_var2(), FLA_UDdate_UT_inc_blk_var1(), FLA_UDdate_UT_internal(), and FLA_UDdate_UT_task().

◆ FLA_UDdate_UT_solve()

FLA_Error FLA_UDdate_UT_solve ( FLA_Obj R,
FLA_Obj bR,
FLA_Obj x )
14{
15 // Check parameters.
16 if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
17 FLA_UDdate_UT_solve_check( R, bR, x );
18
19 // Copy the contents of bR to x so that after the triangular solve, the
20 // solution resides in x (and bR is preserved).
21 FLA_Copy_external( bR, x );
22
23 // Perform a triangular solve with R the right-hand side.
24 FLA_Trsm_external( FLA_LEFT, FLA_UPPER_TRIANGULAR,
25 FLA_NO_TRANSPOSE, FLA_NONUNIT_DIAG,
26 FLA_ONE, R, x );
27
28 return FLA_SUCCESS;
29}
FLA_Error FLA_UDdate_UT_solve_check(FLA_Obj R, FLA_Obj bR, FLA_Obj x)
Definition FLA_UDdate_UT_solve_check.c:13
FLA_Error FLA_Copy_external(FLA_Obj A, FLA_Obj B)
Definition FLA_Copy_external.c:13
FLA_Error FLA_Trsm_external(FLA_Side side, FLA_Uplo uplo, FLA_Trans trans, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, FLA_Obj B)
Definition FLA_Trsm_external.c:13
FLA_Obj FLA_ONE
Definition FLA_Init.c:18

References FLA_Check_error_level(), FLA_Copy_external(), FLA_ONE, FLA_Trsm_external(), and FLA_UDdate_UT_solve_check().

◆ FLA_UDdate_UT_update_rhs()

FLA_Error FLA_UDdate_UT_update_rhs ( FLA_Obj T,
FLA_Obj bR,
FLA_Obj C,
FLA_Obj bC,
FLA_Obj D,
FLA_Obj bD )
16{
17 FLA_Obj W;
18 FLA_Obj bC_copy;
19 FLA_Obj bD_copy;
20
21 // Check parameters.
22 if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
23 FLA_UDdate_UT_update_rhs_check( T, bR, C, bC, D, bD );
24
25 // Create workspace according to the algorithmic blocksize (length of T)
26 // and the number of right-hand sides.
28
29 // Make temporary copies of the bC and bD right-hand side objects so we
30 // don't destory their original contents.
31 FLA_Obj_create_copy_of( FLA_NO_TRANSPOSE, bC, &bC_copy );
32 FLA_Obj_create_copy_of( FLA_NO_TRANSPOSE, bD, &bD_copy );
33
34 // Apply the updowndating Q' to the right-hand sides.
35 FLA_Apply_QUD_UT( FLA_LEFT, FLA_CONJ_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE,
36 T, W,
37 bR,
38 C, bC_copy,
39 D, bD_copy );
40
41 // Free the temporary objects.
42 FLA_Obj_free( &bC_copy );
43 FLA_Obj_free( &bD_copy );
44
45 // Free the workspace object.
46 FLA_Obj_free( &W );
47
48 return FLA_SUCCESS;
49}
FLA_Error FLA_Apply_QUD_UT(FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj T, FLA_Obj W, FLA_Obj R, FLA_Obj U, FLA_Obj C, FLA_Obj V, FLA_Obj D)
Definition FLA_Apply_QUD_UT.c:16
FLA_Error FLA_Apply_QUD_UT_create_workspace(FLA_Obj T, FLA_Obj R, FLA_Obj *W)
Definition FLA_Apply_QUD_UT_create_workspace.c:13
FLA_Error FLA_UDdate_UT_update_rhs_check(FLA_Obj T, FLA_Obj bR, FLA_Obj C, FLA_Obj bC, FLA_Obj D, FLA_Obj bD)
Definition FLA_UDdate_UT_update_rhs_check.c:13
FLA_Error FLA_Obj_create_copy_of(FLA_Trans trans, FLA_Obj old, FLA_Obj *obj)
Definition FLA_Obj.c:345
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition FLA_Obj.c:588
Definition FLA_type_defs.h:159

References FLA_Apply_QUD_UT(), FLA_Apply_QUD_UT_create_workspace(), FLA_Check_error_level(), FLA_Obj_create_copy_of(), FLA_Obj_free(), and FLA_UDdate_UT_update_rhs_check().