Go to the source code of this file.
Functions | |
double | FLASH_Max_elemwise_diff (FLA_Obj A, FLA_Obj B) |
FLA_Error | FLASH_Random_matrix (FLA_Obj H) |
FLA_Error | FLASH_Random_spd_matrix (FLA_Uplo uplo, FLA_Obj H) |
FLA_Error | FLASH_Norm1 (FLA_Obj H, FLA_Obj norm) |
FLA_Error | FLASH_Obj_shift_diagonal (FLA_Obj sigma, FLA_Obj H) |
FLA_Error | FLASH_Obj_set_to_scalar (FLA_Obj alpha, FLA_Obj H) |
References FLA_Max_elemwise_diff(), FLA_Obj_free(), and FLASH_Obj_create_flat_copy_of_hier().
00036 { 00037 FLA_Obj A_flat, B_flat; 00038 double max_diff; 00039 00040 // Create a temporary flat copy of the hierarchical objects. 00041 FLASH_Obj_create_flat_copy_of_hier( A, &A_flat ); 00042 FLASH_Obj_create_flat_copy_of_hier( B, &B_flat ); 00043 00044 // Get the maximum element-wise diff. 00045 max_diff = FLA_Max_elemwise_diff( A_flat, B_flat ); 00046 00047 // Free the temporary flat objects. 00048 FLA_Obj_free( &A_flat ); 00049 FLA_Obj_free( &B_flat ); 00050 00051 return max_diff; 00052 }
References FLA_Norm1(), FLA_Obj_free(), and FLASH_Obj_create_flat_copy_of_hier().
00036 { 00037 FLA_Obj F; 00038 00039 // Create a temporary flat copy of the hierarchical object. 00040 FLASH_Obj_create_flat_copy_of_hier( H, &F ); 00041 00042 // Compute the 1-norm of F and store it in norm. 00043 FLA_Norm1( F, norm ); 00044 00045 // Free the temporary flat object. 00046 FLA_Obj_free( &F ); 00047 00048 return FLA_SUCCESS; 00049 }
References FLA_Obj_free(), FLA_Obj_set_to_scalar(), FLASH_Obj_create_flat_copy_of_hier(), and FLASH_Obj_hierarchify().
00036 { 00037 FLA_Obj F; 00038 00039 // Create a temporary flat copy of the hierarchical object. 00040 FLASH_Obj_create_flat_copy_of_hier( H, &F ); 00041 00042 // Scale the flat matrix object by alpha. 00043 FLA_Obj_set_to_scalar( alpha, F ); 00044 00045 // Copy the flat object's contents back to the hierarchical object. 00046 FLASH_Obj_hierarchify( F, H ); 00047 00048 // Free the temporary flat object. 00049 FLA_Obj_free( &F ); 00050 00051 return FLA_SUCCESS; 00052 }
References FLA_Obj_free(), FLA_Obj_shift_diagonal(), FLASH_Obj_create_flat_copy_of_hier(), and FLASH_Obj_hierarchify().
00036 { 00037 FLA_Obj F; 00038 00039 // Create a temporary flat copy of the hierarchical object. 00040 FLASH_Obj_create_flat_copy_of_hier( H, &F ); 00041 00042 // Shift the diagonal of the flat matrix object by sigma. 00043 FLA_Obj_shift_diagonal( sigma, F ); 00044 00045 // Copy the flat object's contents back to the hierarchical object. 00046 FLASH_Obj_hierarchify( F, H ); 00047 00048 // Free the temporary flat object. 00049 FLA_Obj_free( &F ); 00050 00051 return FLA_SUCCESS; 00052 }
References FLA_Obj_free(), FLA_Random_matrix(), FLASH_Obj_create_flat_copy_of_hier(), and FLASH_Obj_hierarchify().
00036 { 00037 FLA_Obj F; 00038 00039 // Create a temporary flat copy of the hierarchical object. 00040 FLASH_Obj_create_flat_copy_of_hier( H, &F ); 00041 00042 // Randomize the flat matrix object. 00043 FLA_Random_matrix( F ); 00044 00045 // Copy the flat object's contents back to the hierarchical object. 00046 FLASH_Obj_hierarchify( F, H ); 00047 00048 // Free the temporary flat object. 00049 FLA_Obj_free( &F ); 00050 00051 return FLA_SUCCESS; 00052 }
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 }