libflame revision_anchor
bl1_setmr.c File Reference

(r)

Functions

void bl1_ssetmr (uplo1_t uplo, int m, int n, float *sigma, float *a, int a_rs, int a_cs)
 
void bl1_dsetmr (uplo1_t uplo, int m, int n, double *sigma, double *a, int a_rs, int a_cs)
 
void bl1_csetmr (uplo1_t uplo, int m, int n, scomplex *sigma, scomplex *a, int a_rs, int a_cs)
 
void bl1_zsetmr (uplo1_t uplo, int m, int n, dcomplex *sigma, dcomplex *a, int a_rs, int a_cs)
 

Function Documentation

◆ bl1_csetmr()

void bl1_csetmr ( uplo1_t uplo,
int m,
int n,
scomplex * sigma,
scomplex * a,
int a_rs,
int a_cs )
120{
121 scomplex* a_begin;
122 int lda, inca;
123 int n_iter;
124 int n_elem_max;
125 int n_elem;
126 int j;
127
128 // Return early if possible.
129 if ( bl1_zero_dim2( m, n ) ) return;
130
131 // Initialize with optimal values for column-major storage.
132 n_iter = n;
133 n_elem_max = m;
134 lda = a_cs;
135 inca = a_rs;
136
137 // An optimization: if A is row-major, then let's access the matrix by
138 // rows instead of by columns to increase spatial locality.
139 if ( bl1_is_row_storage( a_rs, a_cs ) )
140 {
141 bl1_swap_ints( n_iter, n_elem_max );
142 bl1_swap_ints( lda, inca );
143 bl1_toggle_uplo( uplo );
144 }
145
146 if ( bl1_is_upper( uplo ) )
147 {
148 for ( j = 0; j < n_iter; j++ )
149 {
150 n_elem = bl1_min( j, n_elem_max );
151 a_begin = a + j*lda;
152
153 bl1_csetv( n_elem,
154 sigma,
155 a_begin, inca );
156 }
157 }
158 else // if ( bl1_is_lower( uplo ) )
159 {
160 for ( j = 0; j < n_iter; j++ )
161 {
162 n_elem = bl1_max( 0, n_elem_max - j - 1 );
163 a_begin = a + j*lda + (j + 1)*inca;
164
165 bl1_csetv( n_elem,
166 sigma,
167 a_begin, inca );
168 }
169 }
170}
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
void bl1_csetv(int m, scomplex *sigma, scomplex *x, int incx)
Definition bl1_setv.c:52
Definition blis_type_defs.h:133

References bl1_csetv(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by FLA_Setr(), and FLA_Triangularize().

◆ bl1_dsetmr()

void bl1_dsetmr ( uplo1_t uplo,
int m,
int n,
double * sigma,
double * a,
int a_rs,
int a_cs )
67{
68 double* a_begin;
69 int lda, inca;
70 int n_iter;
71 int n_elem_max;
72 int n_elem;
73 int j;
74
75 // Return early if possible.
76 if ( bl1_zero_dim2( m, n ) ) return;
77
78 // Initialize with optimal values for column-major storage.
79 n_iter = n;
80 n_elem_max = m;
81 lda = a_cs;
82 inca = a_rs;
83
84 // An optimization: if A is row-major, then let's access the matrix by
85 // rows instead of by columns to increase spatial locality.
86 if ( bl1_is_row_storage( a_rs, a_cs ) )
87 {
88 bl1_swap_ints( n_iter, n_elem_max );
89 bl1_swap_ints( lda, inca );
90 bl1_toggle_uplo( uplo );
91 }
92
93 if ( bl1_is_upper( uplo ) )
94 {
95 for ( j = 0; j < n_iter; j++ )
96 {
97 n_elem = bl1_min( j, n_elem_max );
98 a_begin = a + j*lda;
99
100 bl1_dsetv( n_elem,
101 sigma,
102 a_begin, inca );
103 }
104 }
105 else // if ( bl1_is_lower( uplo ) )
106 {
107 for ( j = 0; j < n_iter; j++ )
108 {
109 n_elem = bl1_max( 0, n_elem_max - j - 1 );
110 a_begin = a + j*lda + (j + 1)*inca;
111
112 bl1_dsetv( n_elem,
113 sigma,
114 a_begin, inca );
115 }
116 }
117}
void bl1_dsetv(int m, double *sigma, double *x, int incx)
Definition bl1_setv.c:39

References bl1_dsetv(), bl1_is_row_storage(), bl1_is_upper(), and bl1_zero_dim2().

Referenced by FLA_Setr(), and FLA_Triangularize().

◆ bl1_ssetmr()

void bl1_ssetmr ( uplo1_t uplo,
int m,
int n,
float * sigma,
float * a,
int a_rs,
int a_cs )
14{
15 float* a_begin;
16 int lda, inca;
17 int n_iter;
18 int n_elem_max;
19 int n_elem;
20 int j;
21
22 // Return early if possible.
23 if ( bl1_zero_dim2( m, n ) ) return;
24
25 // Initialize with optimal values for column-major storage.
26 n_iter = n;
27 n_elem_max = m;
28 lda = a_cs;
29 inca = a_rs;
30
31 // An optimization: if A is row-major, then let's access the matrix by
32 // rows instead of by columns to increase spatial locality.
33 if ( bl1_is_row_storage( a_rs, a_cs ) )
34 {
35 bl1_swap_ints( n_iter, n_elem_max );
36 bl1_swap_ints( lda, inca );
37 bl1_toggle_uplo( uplo );
38 }
39
40 if ( bl1_is_upper( uplo ) )
41 {
42 for ( j = 0; j < n_iter; j++ )
43 {
44 n_elem = bl1_min( j, n_elem_max );
45 a_begin = a + j*lda;
46
47 bl1_ssetv( n_elem,
48 sigma,
49 a_begin, inca );
50 }
51 }
52 else // if ( bl1_is_lower( uplo ) )
53 {
54 for ( j = 0; j < n_iter; j++ )
55 {
56 n_elem = bl1_max( 0, n_elem_max - j - 1 );
57 a_begin = a + j*lda + (j + 1)*inca;
58
59 bl1_ssetv( n_elem,
60 sigma,
61 a_begin, inca );
62 }
63 }
64}
void bl1_ssetv(int m, float *sigma, float *x, int incx)
Definition bl1_setv.c:26

References bl1_is_row_storage(), bl1_is_upper(), bl1_ssetv(), and bl1_zero_dim2().

Referenced by FLA_Setr(), and FLA_Triangularize().

◆ bl1_zsetmr()

void bl1_zsetmr ( uplo1_t uplo,
int m,
int n,
dcomplex * sigma,
dcomplex * a,
int a_rs,
int a_cs )
173{
174 dcomplex* a_begin;
175 int lda, inca;
176 int n_iter;
177 int n_elem_max;
178 int n_elem;
179 int j;
180
181 // Return early if possible.
182 if ( bl1_zero_dim2( m, n ) ) return;
183
184 // Initialize with optimal values for column-major storage.
185 n_iter = n;
186 n_elem_max = m;
187 lda = a_cs;
188 inca = a_rs;
189
190 // An optimization: if A is row-major, then let's access the matrix by
191 // rows instead of by columns to increase spatial locality.
192 if ( bl1_is_row_storage( a_rs, a_cs ) )
193 {
194 bl1_swap_ints( n_iter, n_elem_max );
195 bl1_swap_ints( lda, inca );
196 bl1_toggle_uplo( uplo );
197 }
198
199 if ( bl1_is_upper( uplo ) )
200 {
201 for ( j = 0; j < n_iter; j++ )
202 {
203 n_elem = bl1_min( j, n_elem_max );
204 a_begin = a + j*lda;
205
206 bl1_zsetv( n_elem,
207 sigma,
208 a_begin, inca );
209 }
210 }
211 else // if ( bl1_is_lower( uplo ) )
212 {
213 for ( j = 0; j < n_iter; j++ )
214 {
215 n_elem = bl1_max( 0, n_elem_max - j - 1 );
216 a_begin = a + j*lda + (j + 1)*inca;
217
218 bl1_zsetv( n_elem,
219 sigma,
220 a_begin, inca );
221 }
222 }
223}
void bl1_zsetv(int m, dcomplex *sigma, dcomplex *x, int incx)
Definition bl1_setv.c:66
Definition blis_type_defs.h:138

References bl1_is_row_storage(), bl1_is_upper(), bl1_zero_dim2(), and bl1_zsetv().

Referenced by FLA_Setr(), and FLA_Triangularize().