libflame
revision_anchor
|
Functions | |
FLA_Error | FLA_Amax_external (FLA_Obj x, FLA_Obj index) |
FLA_Error FLA_Amax_external | ( | FLA_Obj | x, |
FLA_Obj | index | ||
) |
References bli_camax(), bli_damax(), bli_samax(), bli_zamax(), FLA_Amax_check(), FLA_Check_error_level(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_vector_dim(), and FLA_Obj_vector_inc().
Referenced by FLA_Amax(), FLA_LU_piv_unb_var3(), FLA_LU_piv_unb_var3b(), FLA_LU_piv_unb_var4(), and FLA_LU_piv_unb_var5().
{ FLA_Datatype datatype; int num_elem; int inc_x; int *buff_index; if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING ) FLA_Amax_check( x, index ); buff_index = ( int * ) FLA_INT_PTR( index ); if ( FLA_Obj_has_zero_dim( x ) ) { *buff_index = 0; return FLA_SUCCESS; } datatype = FLA_Obj_datatype( x ); inc_x = FLA_Obj_vector_inc( x ); num_elem = FLA_Obj_vector_dim( x ); switch ( datatype ){ case FLA_FLOAT: { float* buff_x = ( float * ) FLA_FLOAT_PTR( x ); bli_samax( num_elem, buff_x, inc_x, buff_index ); break; } case FLA_DOUBLE: { double* buff_x = ( double * ) FLA_DOUBLE_PTR( x ); bli_damax( num_elem, buff_x, inc_x, buff_index ); break; } case FLA_COMPLEX: { scomplex* buff_x = ( scomplex * ) FLA_COMPLEX_PTR( x ); bli_camax( num_elem, buff_x, inc_x, buff_index ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex* buff_x = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( x ); bli_zamax( num_elem, buff_x, inc_x, buff_index ); break; } } return FLA_SUCCESS; }