libflame revision_anchor
Functions
FLA_Sort_evd.c File Reference

(r)

Functions

FLA_Error FLA_Sort_evd (FLA_Direct direct, FLA_Obj l, FLA_Obj V)
 
FLA_Error FLA_Sort_evd_f_ops (int m_A, float *l, int inc_l, float *V, int rs_V, int cs_V)
 
FLA_Error FLA_Sort_evd_b_ops (int m_A, float *l, int inc_l, float *V, int rs_V, int cs_V)
 
FLA_Error FLA_Sort_evd_f_opd (int m_A, double *l, int inc_l, double *V, int rs_V, int cs_V)
 
FLA_Error FLA_Sort_evd_b_opd (int m_A, double *l, int inc_l, double *V, int rs_V, int cs_V)
 
FLA_Error FLA_Sort_evd_f_opc (int m_A, float *l, int inc_l, scomplex *V, int rs_V, int cs_V)
 
FLA_Error FLA_Sort_evd_b_opc (int m_A, float *l, int inc_l, scomplex *V, int rs_V, int cs_V)
 
FLA_Error FLA_Sort_evd_f_opz (int m_A, double *l, int inc_l, dcomplex *V, int rs_V, int cs_V)
 
FLA_Error FLA_Sort_evd_b_opz (int m_A, double *l, int inc_l, dcomplex *V, int rs_V, int cs_V)
 

Function Documentation

◆ FLA_Sort_evd()

FLA_Error FLA_Sort_evd ( FLA_Direct  direct,
FLA_Obj  l,
FLA_Obj  V 
)
14{
15 FLA_Datatype datatype;
16 dim_t m_A;
19
22
23 datatype = FLA_Obj_datatype( V );
24
25 m_A = FLA_Obj_length( V );
26
29
31
32 switch ( datatype )
33 {
34 case FLA_FLOAT:
35 {
36 float* l_p = ( float* ) FLA_FLOAT_PTR( l );
37 float* V_p = ( float* ) FLA_FLOAT_PTR( V );
38
39 if ( direct == FLA_FORWARD )
41 l_p, inc_l,
42 V_p, rs_V, cs_V );
43 else // if ( direct == FLA_BACKWARD )
45 l_p, inc_l,
46 V_p, rs_V, cs_V );
47
48 break;
49 }
50
51 case FLA_DOUBLE:
52 {
53 double* l_p = ( double* ) FLA_DOUBLE_PTR( l );
54 double* V_p = ( double* ) FLA_DOUBLE_PTR( V );
55
56 if ( direct == FLA_FORWARD )
58 l_p, inc_l,
59 V_p, rs_V, cs_V );
60 else // if ( direct == FLA_BACKWARD )
62 l_p, inc_l,
63 V_p, rs_V, cs_V );
64
65 break;
66 }
67
68 case FLA_COMPLEX:
69 {
70 float* l_p = ( float* ) FLA_FLOAT_PTR( l );
72
73 if ( direct == FLA_FORWARD )
75 l_p, inc_l,
76 V_p, rs_V, cs_V );
77 else // if ( direct == FLA_BACKWARD )
79 l_p, inc_l,
80 V_p, rs_V, cs_V );
81
82 break;
83 }
84
86 {
87 double* l_p = ( double* ) FLA_DOUBLE_PTR( l );
89
90 if ( direct == FLA_FORWARD )
92 l_p, inc_l,
93 V_p, rs_V, cs_V );
94 else // if ( direct == FLA_BACKWARD )
96 l_p, inc_l,
97 V_p, rs_V, cs_V );
98
99 break;
100 }
101
102 }
103
104 return FLA_SUCCESS;
105}
FLA_Error FLA_Sort_evd_f_ops(int m_A, float *l, int inc_l, float *V, int rs_V, int cs_V)
Definition FLA_Sort_evd.c:109
FLA_Error FLA_Sort_evd_b_opz(int m_A, double *l, int inc_l, dcomplex *V, int rs_V, int cs_V)
Definition FLA_Sort_evd.c:245
FLA_Error FLA_Sort_evd_b_ops(int m_A, float *l, int inc_l, float *V, int rs_V, int cs_V)
Definition FLA_Sort_evd.c:116
FLA_Error FLA_Sort_evd_f_opz(int m_A, double *l, int inc_l, dcomplex *V, int rs_V, int cs_V)
Definition FLA_Sort_evd.c:209
FLA_Error FLA_Sort_evd_f_opd(int m_A, double *l, int inc_l, double *V, int rs_V, int cs_V)
Definition FLA_Sort_evd.c:123
FLA_Error FLA_Sort_evd_b_opc(int m_A, float *l, int inc_l, scomplex *V, int rs_V, int cs_V)
Definition FLA_Sort_evd.c:202
FLA_Error FLA_Sort_evd_b_opd(int m_A, double *l, int inc_l, double *V, int rs_V, int cs_V)
Definition FLA_Sort_evd.c:159
FLA_Error FLA_Sort_evd_f_opc(int m_A, float *l, int inc_l, scomplex *V, int rs_V, int cs_V)
Definition FLA_Sort_evd.c:195
FLA_Error FLA_Sort_evd_check(FLA_Direct direct, FLA_Obj l, FLA_Obj V)
Definition FLA_Sort_evd_check.c:13
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition FLA_Query.c:167
dim_t FLA_Obj_length(FLA_Obj obj)
Definition FLA_Query.c:116
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition FLA_Query.c:174
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
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition FLA_Query.c:13
int FLA_Datatype
Definition FLA_type_defs.h:49
unsigned long dim_t
Definition FLA_type_defs.h:71
int i
Definition bl1_axmyv2.c:145
Definition blis_type_defs.h:138
Definition blis_type_defs.h:133

References FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_vector_inc(), FLA_Sort_evd_b_opc(), FLA_Sort_evd_b_opd(), FLA_Sort_evd_b_ops(), FLA_Sort_evd_b_opz(), FLA_Sort_evd_check(), FLA_Sort_evd_f_opc(), FLA_Sort_evd_f_opd(), FLA_Sort_evd_f_ops(), FLA_Sort_evd_f_opz(), and i.

Referenced by FLA_Hevd_lv_unb_var1(), and FLA_Hevd_lv_unb_var2().

◆ FLA_Sort_evd_b_opc()

FLA_Error FLA_Sort_evd_b_opc ( int  m_A,
float l,
int  inc_l,
scomplex V,
int  rs_V,
int  cs_V 
)
205{
206 return FLA_SUCCESS;
207}

References i.

Referenced by FLA_Sort_evd().

◆ FLA_Sort_evd_b_opd()

FLA_Error FLA_Sort_evd_b_opd ( int  m_A,
double l,
int  inc_l,
double V,
int  rs_V,
int  cs_V 
)
162{
163 int i, ii, j, k;
164 double p;
165
166 for ( ii = 1; ii < m_A; ++ii )
167 {
168 i = ii - 1;
169 k = i;
170
171 p = l[ i*inc_l ];
172
173 for ( j = ii; j < m_A; ++j )
174 {
175 if ( l[ j*inc_l ] > p )
176 {
177 k = j;
178 p = l[ j*inc_l ];
179 }
180 }
181
182 if ( k != i )
183 {
184 l[ k*inc_l ] = l[ i ];
185 l[ i ] = p;
187 V + i*cs_V, rs_V,
188 V + k*cs_V, rs_V );
189 }
190 }
191
192 return FLA_SUCCESS;
193}
void bl1_dswapv(int n, double *x, int incx, double *y, int incy)
Definition bl1_swapv.c:23

References bl1_dswapv(), and i.

Referenced by FLA_Sort_evd().

◆ FLA_Sort_evd_b_ops()

FLA_Error FLA_Sort_evd_b_ops ( int  m_A,
float l,
int  inc_l,
float V,
int  rs_V,
int  cs_V 
)
119{
120 return FLA_SUCCESS;
121}

References i.

Referenced by FLA_Sort_evd().

◆ FLA_Sort_evd_b_opz()

FLA_Error FLA_Sort_evd_b_opz ( int  m_A,
double l,
int  inc_l,
dcomplex V,
int  rs_V,
int  cs_V 
)
248{
249 int i, ii, j, k;
250 double p;
251
252 for ( ii = 1; ii < m_A; ++ii )
253 {
254 i = ii - 1;
255 k = i;
256
257 p = l[ i*inc_l ];
258
259 for ( j = ii; j < m_A; ++j )
260 {
261 if ( l[ j*inc_l ] > p )
262 {
263 k = j;
264 p = l[ j*inc_l ];
265 }
266 }
267
268 if ( k != i )
269 {
270 l[ k*inc_l ] = l[ i ];
271 l[ i ] = p;
273 V + i*cs_V, rs_V,
274 V + k*cs_V, rs_V );
275 }
276 }
277
278 return FLA_SUCCESS;
279}
void bl1_zswapv(int n, dcomplex *x, int incx, dcomplex *y, int incy)
Definition bl1_swapv.c:43

References bl1_zswapv(), and i.

Referenced by FLA_Sort_evd().

◆ FLA_Sort_evd_f_opc()

FLA_Error FLA_Sort_evd_f_opc ( int  m_A,
float l,
int  inc_l,
scomplex V,
int  rs_V,
int  cs_V 
)
198{
199 return FLA_SUCCESS;
200}

References i.

Referenced by FLA_Sort_evd().

◆ FLA_Sort_evd_f_opd()

FLA_Error FLA_Sort_evd_f_opd ( int  m_A,
double l,
int  inc_l,
double V,
int  rs_V,
int  cs_V 
)
126{
127 int i, ii, j, k;
128 double p;
129
130 for ( ii = 1; ii < m_A; ++ii )
131 {
132 i = ii - 1;
133 k = i;
134
135 p = l[ i*inc_l ];
136
137 for ( j = ii; j < m_A; ++j )
138 {
139 if ( l[ j*inc_l ] < p )
140 {
141 k = j;
142 p = l[ j*inc_l ];
143 }
144 }
145
146 if ( k != i )
147 {
148 l[ k*inc_l ] = l[ i ];
149 l[ i ] = p;
151 V + i*cs_V, rs_V,
152 V + k*cs_V, rs_V );
153 }
154 }
155
156 return FLA_SUCCESS;
157}

References bl1_dswapv(), and i.

Referenced by FLA_Sort_evd().

◆ FLA_Sort_evd_f_ops()

FLA_Error FLA_Sort_evd_f_ops ( int  m_A,
float l,
int  inc_l,
float V,
int  rs_V,
int  cs_V 
)
112{
113 return FLA_SUCCESS;
114}

References i.

Referenced by FLA_Sort_evd().

◆ FLA_Sort_evd_f_opz()

FLA_Error FLA_Sort_evd_f_opz ( int  m_A,
double l,
int  inc_l,
dcomplex V,
int  rs_V,
int  cs_V 
)
212{
213 int i, ii, j, k;
214 double p;
215
216 for ( ii = 1; ii < m_A; ++ii )
217 {
218 i = ii - 1;
219 k = i;
220
221 p = l[ i*inc_l ];
222
223 for ( j = ii; j < m_A; ++j )
224 {
225 if ( l[ j*inc_l ] < p )
226 {
227 k = j;
228 p = l[ j*inc_l ];
229 }
230 }
231
232 if ( k != i )
233 {
234 l[ k*inc_l ] = l[ i ];
235 l[ i ] = p;
237 V + i*cs_V, rs_V,
238 V + k*cs_V, rs_V );
239 }
240 }
241
242 return FLA_SUCCESS;
243}

References bl1_zswapv(), and i.

Referenced by FLA_Sort_evd().