Functions | |
FLA_Error | FLASH_Random_spd_matrix (FLA_Uplo uplo, FLA_Obj H) |
References FLA_Check_error_level(), FLA_Check_valid_uplo(), FLA_Random_spd_matrix(), FLASH_Obj_create_flat_copy_of_hier(), FLASH_Obj_free(), and FLASH_Obj_hierarchify().
00036 { 00037 FLA_Obj F; 00038 FLA_Error e_val; 00039 00040 if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) 00041 { 00042 e_val = FLA_Check_valid_uplo( uplo ); 00043 FLA_Check_error_code( e_val ); 00044 } 00045 00046 // Create a temporary flat copy of the hierarchical object. 00047 FLASH_Obj_create_flat_copy_of_hier( H, &F ); 00048 00049 // Randomize the flat matrix object to be SPD. 00050 FLA_Random_spd_matrix( uplo, F ); 00051 00052 // Copy the flat object's contents back to the hierarchical object. 00053 FLASH_Obj_hierarchify( F, H ); 00054 00055 // Free the temporary flat object. 00056 FLASH_Obj_free( &F ); 00057 00058 return FLA_SUCCESS; 00059 }