libflame  revision_anchor
Functions
FLASH_Random_spd_matrix.c File Reference

(r)

Functions

FLA_Error FLASH_Random_spd_matrix (FLA_Uplo uplo, FLA_Obj H)
 

Function Documentation

◆ FLASH_Random_spd_matrix()

FLA_Error FLASH_Random_spd_matrix ( FLA_Uplo  uplo,
FLA_Obj  H 
)
14 {
15  FLA_Obj F;
16  FLA_Error e_val;
17 
18  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
19  {
20  e_val = FLA_Check_valid_uplo( uplo );
21  FLA_Check_error_code( e_val );
22  }
23 
24  // Exit early if one dimension is zero.
25  if ( FLA_Obj_has_zero_dim( H ) ) return FLA_SUCCESS;
26 
27  // Create a temporary flat copy of the hierarchical object.
29 
30  // Randomize the flat matrix object to be SPD.
31  FLA_Random_spd_matrix( uplo, F );
32 
33  // Copy the flat object's contents back to the hierarchical object.
34  FLASH_Obj_hierarchify( F, H );
35 
36  // Free the temporary flat object.
37  FLASH_Obj_free( &F );
38 
39  return FLA_SUCCESS;
40 }
void FLASH_Obj_free(FLA_Obj *H)
Definition: FLASH_Obj.c:638
FLA_Error FLASH_Obj_create_flat_copy_of_hier(FLA_Obj H, FLA_Obj *F)
Definition: FLASH_Obj.c:623
FLA_Error FLASH_Obj_hierarchify(FLA_Obj F, FLA_Obj H)
Definition: FLASH_Obj.c:773
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
FLA_Error FLA_Check_valid_uplo(FLA_Uplo uplo)
Definition: FLA_Check.c:76
int FLA_Error
Definition: FLA_type_defs.h:47
FLA_Error FLA_Random_spd_matrix(FLA_Uplo uplo, FLA_Obj A)
Definition: FLA_Random_spd_matrix.c:13
Definition: FLA_type_defs.h:159

References FLA_Check_error_level(), FLA_Check_valid_uplo(), FLA_Obj_has_zero_dim(), FLA_Random_spd_matrix(), FLASH_Obj_create_flat_copy_of_hier(), FLASH_Obj_free(), and FLASH_Obj_hierarchify().