Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::internal::symm_pack_rhs< Scalar, Index, nr, StorageOrder > Struct Template Reference

#include <src/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h>

Public Types

enum  { PacketSize = packet_traits<Scalar>::size }
 

Public Member Functions

void operator() (Scalar *blockB, const Scalar *_rhs, Index rhsStride, Index rows, Index cols, Index k2)
 

Detailed Description

template<typename Scalar, typename Index, int nr, int StorageOrder>
struct Eigen::internal::symm_pack_rhs< Scalar, Index, nr, StorageOrder >

Member Enumeration Documentation

◆ anonymous enum

template<typename Scalar , typename Index , int nr, int StorageOrder>
anonymous enum
Enumerator
PacketSize 
@ size
Definition GenericPacketMath.h:102
@ PacketSize
Definition SelfadjointMatrixMatrix.h:86

Member Function Documentation

◆ operator()()

template<typename Scalar , typename Index , int nr, int StorageOrder>
void Eigen::internal::symm_pack_rhs< Scalar, Index, nr, StorageOrder >::operator() ( Scalar *  blockB,
const Scalar *  _rhs,
Index  rhsStride,
Index  rows,
Index  cols,
Index  k2 
)
inline
88 {
89 Index end_k = k2 + rows;
90 Index count = 0;
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 // first part: normal case
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 }
114 count += nr;
115 }
116 }
117
118 // second part: diagonal block
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 // again we can split vertically in three different parts (transpose, symmetric, normal)
125 // transpose
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));
136 count += 8;
137 }
138 // symmetric
139 Index h = 0;
140 for(Index k=j2; k<j2+8; k++)
141 {
142 // normal
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 // transpose
149 for (Index w=h+1 ; w<8; ++w)
150 blockB[count+w] = numext::conj(rhs(j2+w,k));
151 count += 8;
152 ++h;
153 }
154 // normal
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);
165 count += 8;
166 }
167 }
168 }
169 if(nr>=4)
170 {
171 for(Index j2=end8; j2<(std::min)(k2+rows,packet_cols4); j2+=4)
172 {
173 // again we can split vertically in three different parts (transpose, symmetric, normal)
174 // transpose
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));
181 count += 4;
182 }
183 // symmetric
184 Index h = 0;
185 for(Index k=j2; k<j2+4; k++)
186 {
187 // normal
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 // transpose
194 for (Index w=h+1 ; w<4; ++w)
195 blockB[count+w] = numext::conj(rhs(j2+w,k));
196 count += 4;
197 ++h;
198 }
199 // normal
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);
206 count += 4;
207 }
208 }
209 }
210
211 // third part: transposed
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));
226 count += 8;
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));
240 count += 4;
241 }
242 }
243 }
244
245 // copy the remaining columns one at a time (=> the same with nr==1)
246 for(Index j2=packet_cols4; j2<cols; ++j2)
247 {
248 // transpose
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));
253 count += 1;
254 }
255
256 if(half==j2 && half<k2+rows)
257 {
258 blockB[count] = numext::real(rhs(j2,j2));
259 count += 1;
260 }
261 else
262 half--;
263
264 // normal
265 for(Index k=half+1; k<k2+rows; k++)
266 {
267 blockB[count] = rhs(k,j2);
268 count += 1;
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

The documentation for this struct was generated from the following file: