FLA_Random_spd_matrix.c File Reference

(r)


Functions

FLA_Error FLA_Random_spd_matrix (FLA_Uplo uplo, FLA_Obj A)
void FLA_F2C() fla_random_spd_matrix_f (F_INT *uplo, F_INT *A, F_INT *IERROR)

Function Documentation

FLA_Error FLA_Random_spd_matrix ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_error_level(), FLA_Herk_external(), FLA_Obj_create_conf_to(), FLA_Obj_free(), FLA_Obj_is_real(), FLA_ONE, FLA_Random_matrix(), FLA_Random_spd_matrix_check(), FLA_Symmetrize(), FLA_Syrk_external(), and FLA_ZERO.

Referenced by fla_random_spd_matrix_f(), and FLASH_Random_spd_matrix().

00036 {
00037   FLA_Obj R;
00038 
00039   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
00040     FLA_Random_spd_matrix_check( uplo, A );
00041 
00042   // Create a temporary object R conformal to A.
00043   FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, A, &R );
00044 
00045   if ( FLA_Obj_is_real( A ) )
00046   {
00047     // Fill R with random real entries.
00048     FLA_Random_matrix( R );
00049     
00050     // A = R * R';
00051     FLA_Syrk_external( uplo, FLA_NO_TRANSPOSE, FLA_ONE, R, FLA_ZERO, A );
00052   }
00053   else
00054   {
00055     // Fill R with random complex entries.
00056     FLA_Random_matrix( R );
00057     
00058     // A = R * conjg( R' );
00059     FLA_Herk_external( uplo, FLA_NO_TRANSPOSE, FLA_ONE, R, FLA_ZERO, A );
00060   }
00061 
00062   // Free R.
00063   FLA_Obj_free( &R );
00064 
00065   // Make A symmetric, preserving the uplo triangle.
00066   FLA_Symmetrize( uplo, A );
00067 
00068   return FLA_SUCCESS;
00069 }

void FLA_F2C() fla_random_spd_matrix_f ( F_INT *  uplo,
F_INT *  A,
F_INT *  IERROR 
)

References FLA_Random_spd_matrix().

00073 {
00074   *IERROR = FLA_Random_spd_matrix( *( ( FLA_Uplo * ) uplo ),
00075                                    *( ( FLA_Obj  * ) A    ) );
00076 }


Generated on Mon Jul 6 05:45:53 2009 for libflame by  doxygen 1.5.9