10#ifndef EIGEN_TRIANGULAR_SOLVER_MATRIX_H
11#define EIGEN_TRIANGULAR_SOLVER_MATRIX_H
18template <
typename Scalar,
typename Index,
int S
ide,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
38template <
typename Scalar,
typename Index,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
41 static EIGEN_DONT_INLINE
void run(
47template <
typename Scalar,
typename Index,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
64 SmallPanelWidth = EIGEN_PLAIN_ENUM_MAX(Traits::mr,Traits::nr),
71 std::size_t
sizeA = kc*mc;
72 std::size_t
sizeB = kc*cols;
74 ei_declare_aligned_stack_constructed_variable(Scalar, blockA,
sizeA,
blocking.blockA());
75 ei_declare_aligned_stack_constructed_variable(Scalar, blockB,
sizeB,
blocking.blockB());
85 manage_caching_sizes(GetAction, &
l1, &
l2, &
l3);
87 subcols = std::max<Index>((
subcols/Traits::nr)*Traits::nr, Traits::nr);
89 for(
Index k2=IsLower ? 0 : size;
91 IsLower ?
k2+=kc :
k2-=kc)
122 : IsLower ? i+1 : i-rs;
130 const Scalar* l = &
tri(i,s);
131 typename OtherMapper::LinearMapper r = other.getLinearMapper(s,j);
135 other(i,j) = (other(i,j) - b)*a;
139 Scalar& otherij = other(i,j);
142 typename OtherMapper::LinearMapper r = other.getLinearMapper(s,j);
143 typename TriMapper::LinearMapper l = tri.getLinearMapper(s,i);
144 for (
Index i3=0;i3<rs;++i3)
145 r(i3) -= b * conj(l(i3));
150 Index lengthTarget = actual_kc-k1-actualPanelWidth;
151 Index startBlock = IsLower ? k2+k1 : k2-k1-actualPanelWidth;
152 Index blockBOffset = IsLower ? k1 : lengthTarget;
155 pack_rhs(blockB+actual_kc*j2, other.getSubMapper(startBlock,j2), actualPanelWidth, actual_cols, actual_kc, blockBOffset);
160 Index startTarget = IsLower ? k2+k1+actualPanelWidth : k2-actual_kc;
162 pack_lhs(blockA, tri.getSubMapper(startTarget,startBlock), actualPanelWidth, lengthTarget);
164 gebp_kernel(other.getSubMapper(startTarget,j2), blockA, blockB+actual_kc*j2, lengthTarget, actualPanelWidth, actual_cols, Scalar(-1),
165 actualPanelWidth, actual_kc, 0, blockBOffset);
172 Index start = IsLower ? k2+kc : 0;
173 Index end = IsLower ? size : k2-kc;
174 for(
Index i2=start; i2<end; i2+=mc)
176 const Index actual_mc = (std::min)(mc,end-i2);
179 pack_lhs(blockA, tri.getSubMapper(i2, IsLower ? k2 : k2-kc), actual_kc, actual_mc);
181 gebp_kernel(other.getSubMapper(i2, 0), blockA, blockB, actual_mc, actual_kc, cols, Scalar(-1), -1, -1, 0, 0);
190template <
typename Scalar,
typename Index,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
193 static EIGEN_DONT_INLINE
void run(
199template <
typename Scalar,
typename Index,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
217 SmallPanelWidth = EIGEN_PLAIN_ENUM_MAX(Traits::mr,Traits::nr),
224 std::size_t
sizeA = kc*mc;
225 std::size_t
sizeB = kc*size;
227 ei_declare_aligned_stack_constructed_variable(Scalar, blockA,
sizeA,
blocking.blockA());
228 ei_declare_aligned_stack_constructed_variable(Scalar, blockB,
sizeB,
blocking.blockB());
236 for(
Index k2=IsLower ? size : 0;
237 IsLower ?
k2>0 :
k2<size;
238 IsLower ?
k2-=kc :
k2+=kc)
267 for(
Index i2=0; i2<rows; i2+=mc)
269 const Index actual_mc = (std::min)(mc,rows-i2);
274 for (
Index j2 = IsLower
275 ? (actual_kc - ((actual_kc%SmallPanelWidth) ?
Index(actual_kc%SmallPanelWidth)
276 :
Index(SmallPanelWidth)))
278 IsLower ? j2>=0 : j2<actual_kc;
279 IsLower ? j2-=SmallPanelWidth : j2+=SmallPanelWidth)
281 Index actualPanelWidth = std::min<Index>(actual_kc-j2, SmallPanelWidth);
282 Index absolute_j2 = actual_k2 + j2;
283 Index panelOffset = IsLower ? j2+actualPanelWidth : 0;
284 Index panelLength = IsLower ? actual_kc - j2 - actualPanelWidth : j2;
289 gebp_kernel(lhs.getSubMapper(i2,absolute_j2),
290 blockA, blockB+j2*actual_kc,
291 actual_mc, panelLength, actualPanelWidth,
293 actual_kc, actual_kc,
294 panelOffset, panelOffset);
298 for (
Index k=0; k<actualPanelWidth; ++k)
300 Index j = IsLower ? absolute_j2+actualPanelWidth-k-1 : absolute_j2+k;
302 typename LhsMapper::LinearMapper r = lhs.getLinearMapper(i2,j);
303 for (
Index k3=0; k3<k; ++k3)
305 Scalar b = conj(rhs(IsLower ? j+1+k3 : absolute_j2+k3,j));
306 typename LhsMapper::LinearMapper a = lhs.getLinearMapper(i2,IsLower ? j+1+k3 : absolute_j2+k3);
307 for (
Index i=0; i<actual_mc; ++i)
312 Scalar inv_rjj = RealScalar(1)/conj(rhs(j,j));
313 for (
Index i=0; i<actual_mc; ++i)
319 pack_lhs_panel(blockA, lhs.getSubMapper(i2,absolute_j2),
320 actualPanelWidth, actual_mc,
326 gebp_kernel(lhs.getSubMapper(i2, startPanel), blockA, geb,
327 actual_mc, actual_kc, rs, Scalar(-1),
Definition ForwardDeclarations.h:87
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
@ UnitDiag
Matrix has ones on the diagonal; to be used in combination with #Lower or #Upper.
Definition Constants.h:213
@ Lower
View matrix as a lower triangular matrix.
Definition Constants.h:209
@ Upper
View matrix as an upper triangular matrix.
Definition Constants.h:211
@ ColMajor
Storage order is column major (see TopicStorageOrders).
Definition Constants.h:319
@ RowMajor
Storage order is row major (see TopicStorageOrders).
Definition Constants.h:321
@ OnTheLeft
Apply transformation on the left.
Definition Constants.h:332
@ OnTheRight
Apply transformation on the right.
Definition Constants.h:334
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Holds information about the various numeric (i.e.
Definition NumTraits.h:236
Definition SolveTriangular.h:23