libflame  revision_anchor
Functions
FLASH_Apply_CAQ_UT_inc_create_workspace.c File Reference

(r)

Functions

FLA_Error FLASH_Apply_CAQ_UT_inc_create_workspace (dim_t p, FLA_Obj TW, FLA_Obj B, FLA_Obj *W)
 

Function Documentation

◆ FLASH_Apply_CAQ_UT_inc_create_workspace()

FLA_Error FLASH_Apply_CAQ_UT_inc_create_workspace ( dim_t  p,
FLA_Obj  TW,
FLA_Obj  B,
FLA_Obj W 
)
14 {
15  FLA_Datatype datatype;
16  dim_t depth;
17  dim_t b_alg;
18  dim_t b_flash;
19  dim_t m, n;
20 
21  // Query the depth.
22  depth = FLASH_Obj_depth( TW );
23 
24  // *** The current Apply_CAQ_UT_inc algorithm implemented assumes that
25  // the matrix has a hierarchical depth of 1.
26  if ( depth != 1 )
27  {
28  FLA_Print_message( "FLASH_Apply_CAQ_UT_inc() currently only supports matrices of depth 1",
29  __FILE__, __LINE__ );
30  FLA_Abort();
31  }
32 
33  // Query the datatype of matrix TW.
34  datatype = FLA_Obj_datatype( TW );
35 
36  // Inspect the length of a the top-left element of TW to get the
37  // algorithmic blocksize we'll use throughout the Apply_CAQ_UT_inc
38  // algorithm.
39  b_alg = FLASH_Obj_scalar_length_tl( TW );
40 
41  // The width of the top-left element gives us the storage blocksize.
42  b_flash = FLASH_Obj_scalar_width_tl( TW );
43 
44  // The element length of W need to be p: one panel for each
45  // factorized subproblem.
46  m = p;
47 
48  // Query the element (not scalar) width of the right-hand side
49  // matrix B. This is done so we can create W with full blocks for the
50  // right "edge cases" of B.
51  n = FLA_Obj_width( B );
52 
53  // Create hierarchical matrix W.
54  FLASH_Obj_create_ext( datatype, m * b_alg, n * b_flash,
55  depth, &b_alg, &b_flash,
56  W );
57 
58  return FLA_SUCCESS;
59 }
dim_t FLASH_Obj_scalar_length_tl(FLA_Obj H)
Definition: FLASH_View.c:723
FLA_Error FLASH_Obj_create_ext(FLA_Datatype datatype, dim_t m, dim_t n, dim_t depth, dim_t *b_m, dim_t *b_n, FLA_Obj *H)
Definition: FLASH_Obj.c:151
dim_t FLASH_Obj_depth(FLA_Obj H)
Definition: FLASH_Obj.c:20
dim_t FLASH_Obj_scalar_width_tl(FLA_Obj H)
Definition: FLASH_View.c:737
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void FLA_Abort(void)
Definition: FLA_Error.c:248
void FLA_Print_message(char *str, char *file, int line)
Definition: FLA_Error.c:234
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_Abort(), FLA_Obj_datatype(), FLA_Obj_width(), FLA_Print_message(), FLASH_Obj_create_ext(), FLASH_Obj_depth(), FLASH_Obj_scalar_length_tl(), and FLASH_Obj_scalar_width_tl().

Referenced by FLASH_CAQR_UT_inc_solve().