10 #ifndef EIGEN_TRIANGULAR_SOLVER_MATRIX_H
11 #define EIGEN_TRIANGULAR_SOLVER_MATRIX_H
18 template <
typename Scalar,
typename Index,
int S
ide,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
32 ::
run(
size,
cols,
tri, triStride, _other, otherIncr, otherStride, blocking);
38 template <
typename Scalar,
typename Index,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
47 template <
typename Scalar,
typename Index,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
58 TriMapper
tri(_tri, triStride);
59 OtherMapper
other(_other, otherStride, otherIncr);
87 subcols = std::max<Index>((subcols/Traits::nr)*Traits::nr, Traits::nr);
90 IsLower ? k2<size : k2>0;
91 IsLower ? k2+=kc : k2-=kc)
112 for (
Index k1=0;
k1<actual_kc;
k1+=SmallPanelWidth)
114 Index actualPanelWidth = std::min<Index>(actual_kc-
k1, SmallPanelWidth);
116 for (
Index k=0; k<actualPanelWidth; ++k)
120 Index rs = actualPanelWidth - k - 1;
122 : IsLower ?
i+1 :
i-rs;
125 for (
Index j=j2;
j<j2+actual_cols; ++
j)
131 typename OtherMapper::LinearMapper r =
other.getLinearMapper(
s,
j);
132 for (
Index i3=0; i3<k; ++i3)
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)
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;
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);
190 template <
typename Scalar,
typename Index,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
199 template <
typename Scalar,
typename Index,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherInnerStr
ide>
211 LhsMapper lhs(_other, otherStride, otherIncr);
212 RhsMapper rhs(_tri, triStride);
216 RhsStorageOrder = TriStorageOrder,
237 IsLower ? k2>0 : k2<
size;
238 IsLower ? k2-=kc : k2+=kc)
241 Index actual_k2 = IsLower ? k2-actual_kc : k2 ;
243 Index startPanel = IsLower ? 0 : k2+actual_kc;
244 Index rs = IsLower ? actual_k2 :
size - actual_k2 - actual_kc;
245 Scalar* geb = blockB+actual_kc*actual_kc;
247 if (rs>0) pack_rhs(geb, rhs.getSubMapper(actual_k2,startPanel), actual_kc, rs);
252 for (
Index j2=0; j2<actual_kc; j2+=SmallPanelWidth)
254 Index actualPanelWidth = std::min<Index>(actual_kc-j2, SmallPanelWidth);
255 Index actual_j2 = actual_k2 + j2;
256 Index panelOffset = IsLower ? j2+actualPanelWidth : 0;
257 Index panelLength = IsLower ? actual_kc-j2-actualPanelWidth : j2;
260 pack_rhs_panel(blockB+j2*actual_kc,
261 rhs.getSubMapper(actual_k2+panelOffset, actual_j2),
262 panelLength, actualPanelWidth,
263 actual_kc, panelOffset);
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;
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)
306 typename LhsMapper::LinearMapper
a = lhs.getLinearMapper(i2,IsLower ?
j+1+k3 : absolute_j2+k3);
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),
337 #endif // EIGEN_TRIANGULAR_SOLVER_MATRIX_H