libflame  revision_anchor
Functions
FLA_QR_UT_create_T.c File Reference

(r)

Functions

FLA_Error FLA_QR_UT_create_T (FLA_Obj A, FLA_Obj *T)
 

Function Documentation

◆ FLA_QR_UT_create_T()

FLA_Error FLA_QR_UT_create_T ( FLA_Obj  A,
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 A.
20  datatype = FLA_Obj_datatype( A );
21 
22  // Query the blocksize from the library.
23  b_alg = FLA_Query_blocksize( datatype, FLA_DIMENSION_MIN );
24 
25  // Scale the blocksize by a pre-set global constant.
26  b_alg = ( dim_t )( ( ( double ) b_alg ) * FLA_QR_INNER_TO_OUTER_B_RATIO );
27 
28  // Adjust the blocksize with respect to the min-dim of A.
29  b_alg = min(b_alg, FLA_Obj_min_dim( A ));
30 
31  // Query the width of A.
32  k = FLA_Obj_width( A );
33 
34  // Figure out whether T should be row-major or column-major.
35  if ( FLA_Obj_row_stride( A ) == 1 )
36  {
37  rs_T = 1;
38  cs_T = b_alg;
39  }
40  else // if ( FLA_Obj_col_stride( A ) == 1 )
41  {
42  rs_T = k;
43  cs_T = 1;
44  }
45 
46  // Create a b_alg x k matrix to hold the block Householder transforms that
47  // will be accumulated within the QR factorization algorithm.
48  FLA_Obj_create( datatype, b_alg, k, rs_T, cs_T, T );
49 
50  return FLA_SUCCESS;
51 }
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
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition: FLA_Query.c:153
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_min_dim(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Query_blocksize().

Referenced by FLA_Random_unitary_matrix(), FLA_Svd_ext_u_unb_var1(), FLA_Svd_uv_unb_var1(), and FLA_Svd_uv_unb_var2().