libflame  revision_anchor
Functions
FLA_Amax_external.c File Reference

(r)

Functions

FLA_Error FLA_Amax_external (FLA_Obj x, FLA_Obj index)
 

Function Documentation

◆ FLA_Amax_external()

FLA_Error FLA_Amax_external ( FLA_Obj  x,
FLA_Obj  index 
)
14 {
15  FLA_Datatype datatype;
16  int num_elem;
17  int inc_x;
18  int *buff_index;
19 
20  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
21  FLA_Amax_check( x, index );
22 
23  buff_index = ( int * ) FLA_INT_PTR( index );
24 
25  if ( FLA_Obj_has_zero_dim( x ) )
26  {
27  *buff_index = 0;
28  return FLA_SUCCESS;
29  }
30 
31  datatype = FLA_Obj_datatype( x );
32 
33  inc_x = FLA_Obj_vector_inc( x );
34  num_elem = FLA_Obj_vector_dim( x );
35 
36 
37  switch ( datatype ){
38 
39  case FLA_FLOAT:
40  {
41  float* buff_x = ( float * ) FLA_FLOAT_PTR( x );
42 
43  bl1_samax( num_elem,
44  buff_x, inc_x,
45  buff_index );
46 
47  break;
48  }
49 
50  case FLA_DOUBLE:
51  {
52  double* buff_x = ( double * ) FLA_DOUBLE_PTR( x );
53 
54  bl1_damax( num_elem,
55  buff_x, inc_x,
56  buff_index );
57 
58  break;
59  }
60 
61  case FLA_COMPLEX:
62  {
63  scomplex* buff_x = ( scomplex * ) FLA_COMPLEX_PTR( x );
64 
65  bl1_camax( num_elem,
66  buff_x, inc_x,
67  buff_index );
68 
69  break;
70  }
71 
72  case FLA_DOUBLE_COMPLEX:
73  {
74  dcomplex* buff_x = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( x );
75 
76  bl1_zamax( num_elem,
77  buff_x, inc_x,
78  buff_index );
79 
80  break;
81  }
82 
83  }
84 
85  return FLA_SUCCESS;
86 }
FLA_Error FLA_Amax_check(FLA_Obj x, FLA_Obj index)
Definition: FLA_Amax_check.c:13
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
dim_t FLA_Obj_vector_inc(FLA_Obj obj)
Definition: FLA_Query.c:145
dim_t FLA_Obj_vector_dim(FLA_Obj obj)
Definition: FLA_Query.c:137
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_samax(int n, float *x, int incx, int *index)
Definition: bl1_amax.c:13
void bl1_zamax(int n, dcomplex *x, int incx, int *index)
Definition: bl1_amax.c:46
void bl1_damax(int n, double *x, int incx, int *index)
Definition: bl1_amax.c:24
void bl1_camax(int n, scomplex *x, int incx, int *index)
Definition: bl1_amax.c:35
Definition: blis_type_defs.h:138
Definition: blis_type_defs.h:133

References bl1_camax(), bl1_damax(), bl1_samax(), bl1_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(), FLA_LU_piv_unb_var5(), FLA_QR_UT_piv_unb_var1(), and FLA_QR_UT_piv_unb_var2().