10#ifndef EIGEN_SELFADJOINT_MATRIX_MATRIX_H
11#define EIGEN_SELFADJOINT_MATRIX_MATRIX_H
18template<
typename Scalar,
typename Index,
int Pack1,
int Pack2_dummy,
int StorageOrder>
21 template<
int BlockRows>
inline
25 for(Index k=0; k<i; k++)
27 blockA[count++] = lhs(i+w,k);
32 for(Index w=0; w<h; w++)
33 blockA[count++] = numext::conj(lhs(k, i+w));
35 blockA[count++] = numext::real(lhs(k,k));
38 blockA[count++] = lhs(i+w, k);
44 blockA[count++] = numext::conj(lhs(k, i+w));
46 void operator()(Scalar* blockA,
const Scalar*
_lhs, Index
lhsStride, Index cols, Index rows)
53 const Index
peeled_mc3 =
Pack1>=3*PacketSize ? (rows/(3*PacketSize))*(3*PacketSize) : 0;
55 const Index
peeled_mc1 =
Pack1>=1*PacketSize ? (rows/(1*PacketSize))*(1*PacketSize) : 0;
57 if(
Pack1>=3*PacketSize)
61 if(
Pack1>=2*PacketSize)
65 if(
Pack1>=1*PacketSize)
72 for(Index k=0; k<i; k++)
73 blockA[count++] = lhs(i, k);
75 blockA[count++] = numext::real(lhs(i, i));
77 for(Index k=i+1; k<cols; k++)
78 blockA[count++] = numext::conj(lhs(k, i));
83template<
typename Scalar,
typename Index,
int nr,
int StorageOrder>
87 void operator()(Scalar* blockB,
const Scalar*
_rhs, Index
rhsStride, Index rows, Index cols, Index
k2)
100 blockB[count+0] = rhs(k,
j2+0);
101 blockB[count+1] = rhs(k,
j2+1);
104 blockB[count+2] = rhs(k,
j2+2);
105 blockB[count+3] = rhs(k,
j2+3);
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);
126 for(Index k=
k2; k<
j2; k++)
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));
140 for(Index k=
j2; k<
j2+8; k++)
143 for (Index w=0 ; w<h; ++w)
144 blockB[count+w] = rhs(k,
j2+w);
146 blockB[count+h] = numext::real(rhs(k,k));
149 for (Index w=h+1 ; w<8; ++w)
150 blockB[count+w] = numext::conj(rhs(
j2+w,k));
155 for(Index k=
j2+8; k<
end_k; k++)
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);
175 for(Index k=
k2; k<
j2; k++)
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));
185 for(Index k=
j2; k<
j2+4; k++)
188 for (Index w=0 ; w<h; ++w)
189 blockB[count+w] = rhs(k,
j2+w);
191 blockB[count+h] = numext::real(rhs(k,k));
194 for (Index w=h+1 ; w<4; ++w)
195 blockB[count+w] = numext::conj(rhs(
j2+w,k));
200 for(Index k=
j2+4; k<
end_k; k++)
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);
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));
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));
249 Index half = (std::min)(
end_k,
j2);
250 for(Index k=
k2; k<half; k++)
252 blockB[count] = numext::conj(rhs(
j2,k));
256 if(half==
j2 && half<
k2+rows)
258 blockB[count] = numext::real(rhs(
j2,
j2));
265 for(Index k=half+1; k<
k2+rows; k++)
267 blockB[count] = rhs(k,
j2);
277template <
typename Scalar,
typename Index,
283template <
typename Scalar,
typename Index,
289 static EIGEN_STRONG_INLINE
void run(
290 Index rows, Index cols,
306template <
typename Scalar,
typename Index,
312 static EIGEN_DONT_INLINE
void run(
313 Index rows, Index cols,
317 const Scalar& alpha);
320template <
typename Scalar,
typename Index,
324 Index rows, Index cols,
348 kc = (std::min)(kc,mc);
350 std::size_t
sizeB = kc*cols;
351 ei_declare_aligned_stack_constructed_variable(Scalar, blockA, kc*mc, 0);
360 for(Index
k2=0;
k2<size;
k2+=kc)
390 for(Index i2=k2+kc; i2<size; i2+=mc)
392 const Index actual_mc = (std::min)(i2+mc,size)-i2;
393 gemm_pack_lhs<Scalar, Index, LhsMapper, Traits::mr, Traits::LhsProgress, LhsStorageOrder,false>()
394 (blockA, lhs.getSubMapper(i2, k2), actual_kc, actual_mc);
396 gebp_kernel(res.getSubMapper(i2, 0), blockA, blockB, actual_mc, actual_kc, cols, alpha);
402template <
typename Scalar,
typename Index,
403 int LhsStorageOrder,
bool ConjugateLhs,
404 int RhsStorageOrder,
bool ConjugateRhs>
408 static EIGEN_DONT_INLINE
void run(
409 Index rows, Index cols,
413 const Scalar& alpha);
416template <
typename Scalar,
typename Index,
420 Index rows, Index cols,
439 std::size_t
sizeB = kc*cols;
440 ei_declare_aligned_stack_constructed_variable(Scalar, blockA, kc*mc, 0);
448 for(Index
k2=0;
k2<size;
k2+=kc)
455 for(Index
i2=0;
i2<rows;
i2+=mc)
473template<
typename Lhs,
int LhsMode,
typename Rhs,
int RhsMode>
490 template<
typename Dest>
495 typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(
a_lhs);
496 typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(
a_rhs);
499 * RhsBlasTraits::extractScalarFactor(
a_rhs);
508 lhs.rows(), rhs.cols(),
509 &lhs.coeffRef(0,0), lhs.outerStride(),
510 &rhs.coeffRef(0,0), rhs.outerStride(),
511 &
dst.coeffRef(0,0),
dst.outerStride(),
Expression of the product of two arbitrary matrices or vectors.
Definition Product.h:111
Pseudo expression representing a solving operation.
Definition Solve.h:63
Definition BlasUtil.h:243
@ SelfAdjoint
Used in BandMatrix and SelfAdjointView to indicate that the matrix is self-adjoint.
Definition Constants.h:220
@ Lower
View matrix as a lower triangular matrix.
Definition Constants.h:204
@ Upper
View matrix as an upper triangular matrix.
Definition Constants.h:206
@ ColMajor
Storage order is column major (see TopicStorageOrders).
Definition Constants.h:320
@ RowMajor
Storage order is row major (see TopicStorageOrders).
Definition Constants.h:322
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:61
Holds information about the various numeric (i.e.
Definition NumTraits.h:108
Definition BlasUtil.h:257
Definition GeneralBlockPanelKernel.h:949
Definition GenericPacketMath.h:90
Definition SelfadjointMatrixMatrix.h:281
Definition ProductEvaluators.h:691
Definition SelfadjointMatrixMatrix.h:20
Definition SelfadjointMatrixMatrix.h:85
Definition ForwardDeclarations.h:17