FLA_Iamax_external.c File Reference

(r)


Functions

FLA_Error FLA_Iamax_external (FLA_Obj x, FLA_Obj index)
void FLA_F2C() fla_iamax_external_f (F_INT *x, F_INT *index, F_INT *IERROR)

Function Documentation

FLA_Error FLA_Iamax_external ( FLA_Obj  x,
FLA_Obj  index 
)

References cblas_icamax(), cblas_idamax(), cblas_isamax(), cblas_izamax(), FLA_Check_error_level(), FLA_Iamax_check(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_ldim(), FLA_Obj_length(), FLA_Obj_vector_dim(), icamax(), idamax(), isamax(), and izamax().

Referenced by FLA_Iamax(), fla_iamax_external_f(), FLA_LU_piv_unb_var3(), FLA_LU_piv_unb_var3b(), FLA_LU_piv_unb_var4(), and FLA_LU_piv_unb_var5().

00036 {
00037   FLA_Datatype datatype;
00038   int          num_elem;
00039   int          m_x, inc_x, ldim_x;
00040   int         *buff_index;
00041 
00042   if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING ) 
00043     FLA_Iamax_check( x, index );
00044 
00045   buff_index = ( int * ) FLA_INT_PTR( index );
00046 
00047   if ( FLA_Obj_has_zero_dim( x ) )
00048   {
00049     *buff_index = 0;
00050     return FLA_SUCCESS;
00051   }
00052 
00053   datatype = FLA_Obj_datatype( x );
00054 
00055   m_x      = FLA_Obj_length( x );
00056   ldim_x   = FLA_Obj_ldim( x );
00057 
00058   inc_x    = ( m_x == 1 ? ldim_x : 1 );
00059   num_elem = FLA_Obj_vector_dim( x );
00060 
00061 
00062   switch ( datatype ){
00063 
00064   case FLA_FLOAT:
00065   {
00066     float* buff_x = ( float * ) FLA_FLOAT_PTR( x );
00067 
00068 #ifdef FLA_ENABLE_CBLAS_INTERFACE
00069     *buff_index = cblas_isamax( num_elem, buff_x, inc_x );
00070 #else
00071     *buff_index = FLA_C2F( isamax )( &num_elem, buff_x, &inc_x ) - 1;
00072 #endif
00073 
00074     break;
00075   }
00076   
00077   case FLA_DOUBLE:
00078   {
00079     double* buff_x = ( double * ) FLA_DOUBLE_PTR( x );
00080 
00081 #ifdef FLA_ENABLE_CBLAS_INTERFACE
00082     *buff_index = cblas_idamax( num_elem, buff_x, inc_x );
00083 #else
00084     *buff_index = FLA_C2F( idamax )( &num_elem, buff_x, &inc_x ) - 1;
00085 #endif
00086 
00087     break;
00088   }
00089   
00090   case FLA_COMPLEX:
00091   {
00092     scomplex* buff_x = ( scomplex * ) FLA_COMPLEX_PTR( x );
00093 
00094 #ifdef FLA_ENABLE_CBLAS_INTERFACE
00095     *buff_index = cblas_icamax( num_elem, buff_x, inc_x );
00096 #else
00097     *buff_index = FLA_C2F( icamax )( &num_elem, buff_x, &inc_x ) - 1;
00098 #endif
00099 
00100     break;
00101   }
00102 
00103   case FLA_DOUBLE_COMPLEX:
00104   {
00105     dcomplex* buff_x = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( x );
00106 
00107 #ifdef FLA_ENABLE_CBLAS_INTERFACE
00108     *buff_index = cblas_izamax( num_elem, buff_x, inc_x );
00109 #else
00110     *buff_index = FLA_C2F( izamax )( &num_elem, buff_x, &inc_x ) - 1;
00111 #endif
00112 
00113     break;
00114   }
00115 
00116   }
00117 
00118   return FLA_SUCCESS;
00119 }

void FLA_F2C() fla_iamax_external_f ( F_INT *  x,
F_INT *  index,
F_INT *  IERROR 
)

References FLA_Iamax_external().

00123 {
00124   *IERROR = FLA_Iamax_external( *( ( FLA_Obj * ) x     ),
00125                                 *( ( FLA_Obj * ) index ) );
00126 }


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