libflame revision_anchor
Functions
bl1_maxabsmr.c File Reference

(r)

Functions

void bl1_smaxabsmr (uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, float *maxabs)
 
void bl1_dmaxabsmr (uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, double *maxabs)
 
void bl1_cmaxabsmr (uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, float *maxabs)
 
void bl1_zmaxabsmr (uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, double *maxabs)
 

Function Documentation

◆ bl1_cmaxabsmr()

void bl1_cmaxabsmr ( uplo1_t  uplo,
int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs,
float maxabs 
)
144{
145 float zero = bl1_d0();
147 float maxabs_cand;
148 float maxabs_temp;
149 int inca, lda;
150 int n_iter;
151 int n_elem_max;
152 int n_elem;
153 int j;
154
155 // Return early if possible.
156 if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
157
158 // Initialize with optimal values for column-major storage.
159 n_iter = n;
160 n_elem_max = m;
161 lda = a_cs;
162 inca = a_rs;
163
164 // An optimization: if A is row-major, then let's access the matrix by
165 // rows instead of by columns for increased spatial locality.
166 if ( bl1_is_row_storage( a_rs, a_cs ) )
167 {
170 bl1_toggle_uplo( uplo );
171 }
172
173 // Initialize the maximum absolute value candidate to the first element.
175
176 if ( bl1_is_upper( uplo ) )
177 {
178 for ( j = 0; j < n_iter; j++ )
179 {
180 n_elem = bl1_min( j + 1, n_elem_max );
181 a_begin = a + j*lda;
182
184 a_begin, inca,
185 &maxabs_temp );
186
188 }
189 }
190 else // if ( bl1_is_lower( uplo ) )
191 {
192 for ( j = 0; j < n_iter; j++ )
193 {
194 n_elem = bl1_max( 0, n_elem_max - j );
195 a_begin = a + j*lda + j*inca;
196
198 a_begin, inca,
199 &maxabs_temp );
200
202 }
203 }
204
206}
int i
Definition bl1_axmyv2.c:145
int bl1_is_row_storage(int rs, int cs)
Definition bl1_is.c:95
int bl1_is_upper(uplo1_t uplo)
Definition bl1_is.c:54
int bl1_zero_dim2(int m, int n)
Definition bl1_is.c:118
double bl1_d0(void)
Definition bl1_constants.c:118
void bl1_cmaxabsv(int n, scomplex *x, int incx, float *maxabs)
Definition bl1_maxabsv.c:55
Definition blis_type_defs.h:133

References bl1_cmaxabsv(), bl1_d0(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value_herm().

◆ bl1_dmaxabsmr()

void bl1_dmaxabsmr ( uplo1_t  uplo,
int  m,
int  n,
double a,
int  a_rs,
int  a_cs,
double maxabs 
)
79{
80 double zero = bl1_d0();
81 double* a_begin;
82 double maxabs_cand;
83 double maxabs_temp;
84 int inca, lda;
85 int n_iter;
86 int n_elem_max;
87 int n_elem;
88 int j;
89
90 // Return early if possible.
91 if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
92
93 // Initialize with optimal values for column-major storage.
94 n_iter = n;
95 n_elem_max = m;
96 lda = a_cs;
97 inca = a_rs;
98
99 // An optimization: if A is row-major, then let's access the matrix by
100 // rows instead of by columns for increased spatial locality.
101 if ( bl1_is_row_storage( a_rs, a_cs ) )
102 {
105 bl1_toggle_uplo( uplo );
106 }
107
108 // Initialize the maximum absolute value candidate to the first element.
110
111 if ( bl1_is_upper( uplo ) )
112 {
113 for ( j = 0; j < n_iter; j++ )
114 {
115 n_elem = bl1_min( j + 1, n_elem_max );
116 a_begin = a + j*lda;
117
119 a_begin, inca,
120 &maxabs_temp );
121
123 }
124 }
125 else // if ( bl1_is_lower( uplo ) )
126 {
127 for ( j = 0; j < n_iter; j++ )
128 {
129 n_elem = bl1_max( 0, n_elem_max - j );
130 a_begin = a + j*lda + j*inca;
131
133 a_begin, inca,
134 &maxabs_temp );
135
137 }
138 }
139
141}
void bl1_dmaxabsv(int n, double *x, int incx, double *maxabs)
Definition bl1_maxabsv.c:34

References bl1_d0(), bl1_dmaxabsv(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value_herm().

◆ bl1_smaxabsmr()

void bl1_smaxabsmr ( uplo1_t  uplo,
int  m,
int  n,
float a,
int  a_rs,
int  a_cs,
float maxabs 
)
14{
15 float zero = bl1_s0();
16 float* a_begin;
17 float maxabs_cand;
18 float maxabs_temp;
19 int inca, lda;
20 int n_iter;
21 int n_elem_max;
22 int n_elem;
23 int j;
24
25 // Return early if possible.
26 if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
27
28 // Initialize with optimal values for column-major storage.
29 n_iter = n;
30 n_elem_max = m;
31 lda = a_cs;
32 inca = a_rs;
33
34 // An optimization: if A is row-major, then let's access the matrix by
35 // rows instead of by columns for increased spatial locality.
37 {
40 bl1_toggle_uplo( uplo );
41 }
42
43 // Initialize the maximum absolute value candidate to the first element.
45
46 if ( bl1_is_upper( uplo ) )
47 {
48 for ( j = 0; j < n_iter; j++ )
49 {
50 n_elem = bl1_min( j + 1, n_elem_max );
51 a_begin = a + j*lda;
52
55 &maxabs_temp );
56
58 }
59 }
60 else // if ( bl1_is_lower( uplo ) )
61 {
62 for ( j = 0; j < n_iter; j++ )
63 {
64 n_elem = bl1_max( 0, n_elem_max - j );
65 a_begin = a + j*lda + j*inca;
66
69 &maxabs_temp );
70
72 }
73 }
74
76}
void bl1_smaxabsv(int n, float *x, int incx, float *maxabs)
Definition bl1_maxabsv.c:13
float bl1_s0(void)
Definition bl1_constants.c:111

References bl1_is_row_storage(), bl1_is_upper(), bl1_s0(), bl1_smaxabsv(), and bl1_zero_dim2().

Referenced by FLA_Max_abs_value_herm().

◆ bl1_zmaxabsmr()

void bl1_zmaxabsmr ( uplo1_t  uplo,
int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs,
double maxabs 
)
209{
210 double zero = bl1_d0();
212 double maxabs_cand;
213 double maxabs_temp;
214 int inca, lda;
215 int n_iter;
216 int n_elem_max;
217 int n_elem;
218 int j;
219
220 // Return early if possible.
221 if ( bl1_zero_dim2( m, n ) ) { *maxabs = zero; return; }
222
223 // Initialize with optimal values for column-major storage.
224 n_iter = n;
225 n_elem_max = m;
226 lda = a_cs;
227 inca = a_rs;
228
229 // An optimization: if A is row-major, then let's access the matrix by
230 // rows instead of by columns for increased spatial locality.
231 if ( bl1_is_row_storage( a_rs, a_cs ) )
232 {
235 bl1_toggle_uplo( uplo );
236 }
237
238 // Initialize the maximum absolute value candidate to the first element.
240
241 if ( bl1_is_upper( uplo ) )
242 {
243 for ( j = 0; j < n_iter; j++ )
244 {
245 n_elem = bl1_min( j + 1, n_elem_max );
246 a_begin = a + j*lda;
247
249 a_begin, inca,
250 &maxabs_temp );
251
253 }
254 }
255 else // if ( bl1_is_lower( uplo ) )
256 {
257 for ( j = 0; j < n_iter; j++ )
258 {
259 n_elem = bl1_max( 0, n_elem_max - j );
260 a_begin = a + j*lda + j*inca;
261
263 a_begin, inca,
264 &maxabs_temp );
265
267 }
268 }
269
271}
void bl1_zmaxabsv(int n, dcomplex *x, int incx, double *maxabs)
Definition bl1_maxabsv.c:76
Definition blis_type_defs.h:138

References bl1_d0(), bl1_is_row_storage(), bl1_is_upper(), bl1_zero_dim2(), and bl1_zmaxabsv().

Referenced by FLA_Max_abs_value_herm().