FLA_Hermitianize.c File Reference

(r)


Functions

FLA_Error FLA_Hermitianize (FLA_Uplo uplo, FLA_Obj A)
void FLA_F2C() fla_hermitianize_f (F_INT *uplo, F_INT *A, F_INT *IERROR)

Function Documentation

FLA_Error FLA_Hermitianize ( FLA_Uplo  uplo,
FLA_Obj  A 
)

References FLA_Check_error_level(), FLA_Conjugate_r(), FLA_Hermitianize_check(), FLA_Obj_datatype(), FLA_Obj_is_real(), FLA_Obj_ldim(), FLA_Obj_width(), FLA_Symmetrize(), FLA_ZERO, dcomplex::imag, and scomplex::imag.

Referenced by fla_hermitianize_f(), and FLA_Random_herm_matrix().

00036 {
00037   FLA_Datatype datatype;
00038   int          j;
00039   int          n_A, ldim_A;
00040 
00041   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
00042     FLA_Hermitianize_check( uplo, A );
00043 
00044   FLA_Symmetrize( uplo, A );
00045 
00046   if ( FLA_Obj_is_real( A ) ) return FLA_SUCCESS;
00047 
00048   if ( uplo == FLA_LOWER_TRIANGULAR )
00049     FLA_Conjugate_r( FLA_UPPER_TRIANGULAR, A );
00050   else
00051     FLA_Conjugate_r( FLA_LOWER_TRIANGULAR, A );
00052 
00053 
00054   datatype = FLA_Obj_datatype( A );
00055 
00056   n_A      = FLA_Obj_width( A );
00057   ldim_A   = FLA_Obj_ldim( A );
00058 
00059   switch ( datatype ){
00060 
00061   case FLA_COMPLEX:
00062   {
00063     scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
00064     scomplex *buff_0 = ( scomplex * ) FLA_COMPLEX_PTR( FLA_ZERO );
00065 
00066     for ( j = 0; j < n_A; j++ )
00067       buff_A[ j*ldim_A + j ].imag = buff_0->imag;
00068 
00069     break;
00070   }
00071 
00072   case FLA_DOUBLE_COMPLEX:
00073   {
00074     dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
00075     dcomplex *buff_0 = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( FLA_ZERO );
00076 
00077     for ( j = 0; j < n_A; j++ )
00078       buff_A[ j*ldim_A + j ].imag = buff_0->imag;
00079 
00080     break;
00081   }
00082 
00083   }
00084 
00085   return FLA_SUCCESS;
00086 }

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

References FLA_Hermitianize().

00090 {
00091   *IERROR = FLA_Hermitianize( *( ( FLA_Uplo * ) uplo ),
00092                               *( ( FLA_Obj  * ) A    ) );
00093 }


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