10#ifndef EIGEN_TRIANGULAR_MATRIX_MATRIX_H
11#define EIGEN_TRIANGULAR_MATRIX_MATRIX_H
44template <
typename Scalar,
typename Index,
45 int Mode,
bool LhsIsTriangular,
46 int LhsStorageOrder,
bool ConjugateLhs,
47 int RhsStorageOrder,
bool ConjugateRhs,
48 int ResStorageOrder,
int Version = Specialized>
51template <
typename Scalar,
typename Index,
59 static EIGEN_STRONG_INLINE
void run(
60 Index rows, Index cols, Index depth,
74 ::run(cols, rows, depth, rhs,
rhsStride, lhs,
lhsStride, res,
resStride, alpha,
blocking);
79template <
typename Scalar,
typename Index,
int Mode,
89 SmallPanelWidth = 2 * EIGEN_PLAIN_ENUM_MAX(Traits::mr,Traits::nr),
94 static EIGEN_DONT_INLINE
void run(
102template <
typename Scalar,
typename Index,
int Mode,
128 Index mc = (std::min)(rows,
blocking.mc());
130 std::size_t
sizeA = kc*mc;
131 std::size_t
sizeB = kc*cols;
133 ei_declare_aligned_stack_constructed_variable(Scalar, blockA,
sizeA,
blocking.blockA());
134 ei_declare_aligned_stack_constructed_variable(Scalar, blockB,
sizeB,
blocking.blockB());
147 for(Index
k2=IsLower ? depth : 0;
148 IsLower ?
k2>0 :
k2<depth;
149 IsLower ?
k2-=kc :
k2+=kc)
189 pack_lhs(blockA, LhsMapper(triangularBuffer.data(), triangularBuffer.outerStride()), actualPanelWidth, actualPanelWidth);
191 gebp_kernel(res.getSubMapper(startBlock, 0), blockA, blockB,
192 actualPanelWidth, actualPanelWidth, cols, alpha,
193 actualPanelWidth, actual_kc, 0, blockBOffset);
198 Index startTarget = IsLower ? actual_k2+k1+actualPanelWidth : actual_k2;
200 pack_lhs(blockA, lhs.getSubMapper(startTarget,startBlock), actualPanelWidth, lengthTarget);
202 gebp_kernel(res.getSubMapper(startTarget, 0), blockA, blockB,
203 lengthTarget, actualPanelWidth, cols, alpha,
204 actualPanelWidth, actual_kc, 0, blockBOffset);
210 Index start = IsLower ? k2 : 0;
211 Index end = IsLower ? rows : (std::min)(actual_k2,rows);
212 for(Index i2=start; i2<end; i2+=mc)
214 const Index actual_mc = (std::min)(i2+mc,end)-i2;
215 gemm_pack_lhs<Scalar, Index, LhsMapper, Traits::mr,Traits::LhsProgress, LhsStorageOrder,false>()
216 (blockA, lhs.getSubMapper(i2, actual_k2), actual_kc, actual_mc);
218 gebp_kernel(res.getSubMapper(i2, 0), blockA, blockB, actual_mc,
219 actual_kc, cols, alpha, -1, -1, 0, 0);
226template <
typename Scalar,
typename Index,
int Mode,
227 int LhsStorageOrder,
bool ConjugateLhs,
228 int RhsStorageOrder,
bool ConjugateRhs,
int Version>
235 SmallPanelWidth = EIGEN_PLAIN_ENUM_MAX(Traits::mr,Traits::nr),
240 static EIGEN_DONT_INLINE
void run(
248template <
typename Scalar,
typename Index,
int Mode,
275 Index mc = (std::min)(rows,
blocking.mc());
277 std::size_t
sizeA = kc*mc;
278 std::size_t
sizeB = kc*cols+EIGEN_MAX_ALIGN_BYTES/
sizeof(Scalar);
280 ei_declare_aligned_stack_constructed_variable(Scalar, blockA,
sizeA,
blocking.blockA());
281 ei_declare_aligned_stack_constructed_variable(Scalar, blockB,
sizeB,
blocking.blockB());
295 for(Index
k2=IsLower ? 0 : depth;
297 IsLower ?
k2+=kc :
k2-=kc)
310 Index rs = IsLower ? (std::min)(cols,
actual_k2) : cols -
k2;
343 pack_rhs_panel(blockB+j2*actual_kc,
344 RhsMapper(triangularBuffer.data(), triangularBuffer.outerStride()),
345 actualPanelWidth, actualPanelWidth,
350 for (Index i2=0; i2<rows; i2+=mc)
352 const Index actual_mc = (std::min)(mc,rows-i2);
353 pack_lhs(blockA, lhs.getSubMapper(i2, actual_k2), actual_kc, actual_mc);
358 for (Index j2=0; j2<actual_kc; j2+=SmallPanelWidth)
360 Index actualPanelWidth = std::min<Index>(actual_kc-j2, SmallPanelWidth);
361 Index panelLength = IsLower ? actual_kc-j2 : j2+actualPanelWidth;
362 Index blockOffset = IsLower ? j2 : 0;
364 gebp_kernel(res.getSubMapper(i2, actual_k2 + j2),
365 blockA, blockB+j2*actual_kc,
366 actual_mc, panelLength, actualPanelWidth,
368 actual_kc, actual_kc,
369 blockOffset, blockOffset);
372 gebp_kernel(res.getSubMapper(i2, IsLower ? 0 : k2),
373 blockA, geb, actual_mc, actual_kc, rs,
387template<
int Mode,
bool LhsIsTriangular,
typename Lhs,
typename Rhs>
390 template<
typename Dest>
static void run(
Dest&
dst,
const Lhs &
a_lhs,
const Rhs &
a_rhs,
const typename Dest::Scalar& alpha)
392 typedef typename Dest::Scalar Scalar;
395 typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType;
398 typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType;
405 * RhsBlasTraits::extractScalarFactor(
a_rhs);
408 Lhs::MaxRowsAtCompileTime, Rhs::MaxColsAtCompileTime, Lhs::MaxColsAtCompileTime,4>
BlockingType;
414 : ((IsLower) ? rhs.rows() : (std::min)(rhs.rows(),rhs.cols()));
425 &lhs.coeffRef(0,0), lhs.outerStride(),
426 &rhs.coeffRef(0,0), rhs.outerStride(),
427 &
dst.coeffRef(0,0),
dst.outerStride(),
Pseudo expression representing a solving operation.
Definition Solve.h:63
Definition GeneralMatrixMatrix.h:247
@ UnitDiag
Matrix has ones on the diagonal; to be used in combination with #Lower or #Upper.
Definition Constants.h:208
@ ZeroDiag
Matrix has zeros on the diagonal; to be used in combination with #Lower or #Upper.
Definition Constants.h:210
@ 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
Definition BlasUtil.h:257
Definition GeneralBlockPanelKernel.h:949
Definition GenericPacketMath.h:90
Definition TriangularMatrixMatrix.h:49
Definition ForwardDeclarations.h:17
Definition ProductEvaluators.h:656