libflame revision_anchor
Functions
FLA_Bsvd_find_max_min.c File Reference

(r)

Functions

FLA_Error FLA_Bsvd_find_max (FLA_Obj d, FLA_Obj e, FLA_Obj smax, FLA_Obj smin)
 
FLA_Error FLA_Bsvd_find_max_min_ops (int m_A, float *buff_d, int inc_d, float *buff_e, int inc_e, float *smax, float *smin)
 
FLA_Error FLA_Bsvd_find_max_min_opd (int m_A, double *buff_d, int inc_d, double *buff_e, int inc_e, double *smax, double *smin)
 

Function Documentation

◆ FLA_Bsvd_find_max()

FLA_Error FLA_Bsvd_find_max ( FLA_Obj  d,
FLA_Obj  e,
FLA_Obj  smax,
FLA_Obj  smin 
)
14{
15 FLA_Datatype datatype;
16 int m_A;
17 int inc_d;
18 int inc_e;
19
20 datatype = FLA_Obj_datatype( d );
21
23
26
27
28 switch ( datatype )
29 {
30 case FLA_FLOAT:
31 {
32 float* buff_d = FLA_FLOAT_PTR( d );
33 float* buff_e = FLA_FLOAT_PTR( e );
34 float* buff_smax = FLA_FLOAT_PTR( smax );
35 float* buff_smin = FLA_FLOAT_PTR( smin );
36
41 buff_smin );
42
43 break;
44 }
45
46 case FLA_DOUBLE:
47 {
48 double* buff_d = FLA_DOUBLE_PTR( d );
49 double* buff_e = FLA_DOUBLE_PTR( e );
50 double* buff_smax = FLA_DOUBLE_PTR( smax );
51 double* buff_smin = FLA_DOUBLE_PTR( smin );
52
57 buff_smin );
58
59 break;
60 }
61 }
62
63 return FLA_SUCCESS;
64}
FLA_Error FLA_Bsvd_find_max_min_opd(int m_A, double *buff_d, int inc_d, double *buff_e, int inc_e, double *smax, double *smin)
Definition FLA_Bsvd_find_max_min.c:103
FLA_Error FLA_Bsvd_find_max_min_ops(int m_A, float *buff_d, int inc_d, float *buff_e, int inc_e, float *smax, float *smin)
Definition FLA_Bsvd_find_max_min.c:68
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
int i
Definition bl1_axmyv2.c:145

References FLA_Bsvd_find_max_min_opd(), FLA_Bsvd_find_max_min_ops(), FLA_Obj_datatype(), FLA_Obj_vector_dim(), FLA_Obj_vector_inc(), and i.

◆ FLA_Bsvd_find_max_min_opd()

FLA_Error FLA_Bsvd_find_max_min_opd ( int  m_A,
double buff_d,
int  inc_d,
double buff_e,
int  inc_e,
double smax,
double smin 
)
108{
109 double smax_cand;
110 double smin_cand;
111 int i;
112
113 smax_cand = fabs( buff_d[ (m_A-1)*inc_d ] );
115
116 for ( i = 0; i < m_A - 1; ++i )
117 {
118 double abs_di = fabs( buff_d[ i*inc_d ] );
119 double abs_ei = fabs( buff_e[ i*inc_e ] );
120
121 // Track the minimum element.
123
124 // Track the maximum element.
127 }
128
129 // Save the results of the search.
130 *smax = smax_cand;
131 *smin = smin_cand;
132
133 return FLA_SUCCESS;
134}

References i.

Referenced by FLA_Bsvd_find_max(), and FLA_Bsvd_sinval_v_opd_var1().

◆ FLA_Bsvd_find_max_min_ops()

FLA_Error FLA_Bsvd_find_max_min_ops ( int  m_A,
float buff_d,
int  inc_d,
float buff_e,
int  inc_e,
float smax,
float smin 
)
73{
74 float smax_cand;
75 float smin_cand;
76 int i;
77
78 smax_cand = fabsf( buff_d[ (m_A-1)*inc_d ] );
80
81 for ( i = 0; i < m_A - 1; ++i )
82 {
83 float abs_di = fabsf( buff_d[ i*inc_d ] );
84 float abs_ei = fabsf( buff_e[ i*inc_e ] );
85
86 // Track the minimum element.
88
89 // Track the maximum element.
92 }
93
94 // Save the results of the search.
95 *smax = smax_cand;
96 *smin = smin_cand;
97
98 return FLA_SUCCESS;
99}

References i.

Referenced by FLA_Bsvd_find_max(), and FLA_Bsvd_sinval_v_ops_var1().