88 {
91 const_blas_data_mapper<Scalar,Index,StorageOrder> rhs(_rhs,rhsStride);
92 Index packet_cols8 = nr>=8 ? (
cols/8) * 8 : 0;
93 Index packet_cols4 = nr>=4 ? (
cols/4) * 4 : 0;
94
95
96 for(
Index j2=0; j2<k2; j2+=nr)
97 {
98 for(
Index k=k2; k<end_k; k++)
99 {
100 blockB[
count+0] = rhs(k,j2+0);
101 blockB[
count+1] = rhs(k,j2+1);
102 if (nr>=4)
103 {
104 blockB[
count+2] = rhs(k,j2+2);
105 blockB[
count+3] = rhs(k,j2+3);
106 }
107 if (nr>=8)
108 {
109 blockB[
count+4] = rhs(k,j2+4);
110 blockB[
count+5] = rhs(k,j2+5);
111 blockB[
count+6] = rhs(k,j2+6);
112 blockB[
count+7] = rhs(k,j2+7);
113 }
115 }
116 }
117
118
119 Index end8 = nr>=8 ? (std::min)(k2+rows,packet_cols8) : k2;
120 if(nr>=8)
121 {
122 for(
Index j2=k2; j2<end8; j2+=8)
123 {
124
125
126 for(
Index k=k2; k<j2; k++)
127 {
128 blockB[
count+0] = numext::conj(rhs(j2+0,k));
129 blockB[
count+1] = numext::conj(rhs(j2+1,k));
130 blockB[
count+2] = numext::conj(rhs(j2+2,k));
131 blockB[
count+3] = numext::conj(rhs(j2+3,k));
132 blockB[
count+4] = numext::conj(rhs(j2+4,k));
133 blockB[
count+5] = numext::conj(rhs(j2+5,k));
134 blockB[
count+6] = numext::conj(rhs(j2+6,k));
135 blockB[
count+7] = numext::conj(rhs(j2+7,k));
137 }
138
140 for(
Index k=j2; k<j2+8; k++)
141 {
142
143 for (
Index w=0 ; w<h; ++w)
144 blockB[count+w] = rhs(k,j2+w);
145
146 blockB[
count+h] = numext::real(rhs(k,k));
147
148
149 for (
Index w=h+1 ; w<8; ++w)
150 blockB[count+w] = numext::conj(rhs(j2+w,k));
152 ++h;
153 }
154
155 for(
Index k=j2+8; k<end_k; k++)
156 {
157 blockB[
count+0] = rhs(k,j2+0);
158 blockB[
count+1] = rhs(k,j2+1);
159 blockB[
count+2] = rhs(k,j2+2);
160 blockB[
count+3] = rhs(k,j2+3);
161 blockB[
count+4] = rhs(k,j2+4);
162 blockB[
count+5] = rhs(k,j2+5);
163 blockB[
count+6] = rhs(k,j2+6);
164 blockB[
count+7] = rhs(k,j2+7);
166 }
167 }
168 }
169 if(nr>=4)
170 {
171 for(
Index j2=end8; j2<(std::min)(k2+rows,packet_cols4); j2+=4)
172 {
173
174
175 for(
Index k=k2; k<j2; k++)
176 {
177 blockB[
count+0] = numext::conj(rhs(j2+0,k));
178 blockB[
count+1] = numext::conj(rhs(j2+1,k));
179 blockB[
count+2] = numext::conj(rhs(j2+2,k));
180 blockB[
count+3] = numext::conj(rhs(j2+3,k));
182 }
183
185 for(
Index k=j2; k<j2+4; k++)
186 {
187
188 for (
Index w=0 ; w<h; ++w)
189 blockB[count+w] = rhs(k,j2+w);
190
191 blockB[
count+h] = numext::real(rhs(k,k));
192
193
194 for (
Index w=h+1 ; w<4; ++w)
195 blockB[count+w] = numext::conj(rhs(j2+w,k));
197 ++h;
198 }
199
200 for(
Index k=j2+4; k<end_k; k++)
201 {
202 blockB[
count+0] = rhs(k,j2+0);
203 blockB[
count+1] = rhs(k,j2+1);
204 blockB[
count+2] = rhs(k,j2+2);
205 blockB[
count+3] = rhs(k,j2+3);
207 }
208 }
209 }
210
211
212 if(nr>=8)
213 {
214 for(
Index j2=k2+rows; j2<packet_cols8; j2+=8)
215 {
216 for(
Index k=k2; k<end_k; k++)
217 {
218 blockB[
count+0] = numext::conj(rhs(j2+0,k));
219 blockB[
count+1] = numext::conj(rhs(j2+1,k));
220 blockB[
count+2] = numext::conj(rhs(j2+2,k));
221 blockB[
count+3] = numext::conj(rhs(j2+3,k));
222 blockB[
count+4] = numext::conj(rhs(j2+4,k));
223 blockB[
count+5] = numext::conj(rhs(j2+5,k));
224 blockB[
count+6] = numext::conj(rhs(j2+6,k));
225 blockB[
count+7] = numext::conj(rhs(j2+7,k));
227 }
228 }
229 }
230 if(nr>=4)
231 {
232 for(
Index j2=(std::max)(packet_cols8,k2+rows); j2<packet_cols4; j2+=4)
233 {
234 for(
Index k=k2; k<end_k; k++)
235 {
236 blockB[
count+0] = numext::conj(rhs(j2+0,k));
237 blockB[
count+1] = numext::conj(rhs(j2+1,k));
238 blockB[
count+2] = numext::conj(rhs(j2+2,k));
239 blockB[
count+3] = numext::conj(rhs(j2+3,k));
241 }
242 }
243 }
244
245
246 for(
Index j2=packet_cols4; j2<
cols; ++j2)
247 {
248
249 Index half = (std::min)(end_k,j2);
250 for(
Index k=k2; k<half; k++)
251 {
252 blockB[
count] = numext::conj(rhs(j2,k));
254 }
255
256 if(half==j2 && half<k2+rows)
257 {
258 blockB[
count] = numext::real(rhs(j2,j2));
260 }
261 else
262 half--;
263
264
266 {
267 blockB[
count] = rhs(k,j2);
269 }
270 }
271 }
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33
IGL_INLINE void count(const Eigen::SparseMatrix< XType > &X, const int dim, Eigen::SparseVector< SType > &S)
Definition count.cpp:12
size_t cols(const T &raster)
Definition MarchingSquares.hpp:60
size_t rows(const T &raster)
Definition MarchingSquares.hpp:55