10 #ifndef EIGEN_SOLVETRIANGULAR_H
11 #define EIGEN_SOLVETRIANGULAR_H
19 template<
typename LhsScalar,
typename RhsScalar,
typename Index,
int S
ide,
int Mode,
bool Conjugate,
int StorageOrder>
22 template <
typename Scalar,
typename Index,
int S
ide,
int Mode,
bool Conjugate,
int TriStorageOrder,
int OtherStorageOrder,
int OtherInnerStr
ide>
26 template<
typename Lhs,
typename Rhs,
int S
ide>
41 template<
typename Lhs,
typename Rhs,
49 template<
typename Lhs,
typename Rhs,
int S
ide,
int Mode>
63 bool useRhsDirectly = Rhs::InnerStrideAtCompileTime==1 || rhs.innerStride()==1;
66 (useRhsDirectly ? rhs.data() : 0));
73 ::
run(actualLhs.cols(), actualLhs.data(), actualLhs.outerStride(), actualRhs);
81 template<
typename Lhs,
typename Rhs,
int S
ide,
int Mode>
96 Rhs::MaxRowsAtCompileTime, Rhs::MaxColsAtCompileTime, Lhs::MaxRowsAtCompileTime,4> BlockingType;
98 BlockingType blocking(rhs.rows(), rhs.cols(),
size, 1,
false);
102 ::run(
size, othersize, &actualLhs.coeffRef(0,0), actualLhs.outerStride(), &rhs.coeffRef(0,0), rhs.innerStride(), rhs.outerStride(), blocking);
110 template<
typename Lhs,
typename Rhs,
int Mode,
int LoopIndex,
int Size,
111 bool Stop = LoopIndex==Size>
114 template<
typename Lhs,
typename Rhs,
int Mode,
int LoopIndex,
int Size>
118 DiagIndex = IsLower ? LoopIndex : Size - LoopIndex - 1,
119 StartIndex = IsLower ? 0 : DiagIndex+1
124 rhs.coeffRef(DiagIndex) -= lhs.row(DiagIndex).template segment<LoopIndex>(StartIndex).transpose()
125 .cwiseProduct(rhs.template segment<LoopIndex>(StartIndex)).sum();
128 rhs.coeffRef(DiagIndex) /= lhs.coeff(DiagIndex,DiagIndex);
134 template<
typename Lhs,
typename Rhs,
int Mode,
int LoopIndex,
int Size>
139 template<
typename Lhs,
typename Rhs,
int Mode>
145 template<
typename Lhs,
typename Rhs,
int Mode>
154 0,Rhs::SizeAtCompileTime>::
run(trLhs,trRhs);
164 #ifndef EIGEN_PARSED_BY_DOXYGEN
165 template<
typename MatrixType,
unsigned int Mode>
166 template<
int S
ide,
typename OtherDerived>
167 EIGEN_DEVICE_FUNC void TriangularViewImpl<MatrixType,Mode,Dense>::solveInPlace(
const MatrixBase<OtherDerived>& _other)
const
169 OtherDerived&
other = _other.const_cast_derived();
173 if (derived().
cols() == 0)
176 enum {
copy = (internal::traits<OtherDerived>::Flags &
RowMajorBit) && OtherDerived::IsVectorAtCompileTime && OtherDerived::SizeAtCompileTime!=1};
177 typedef typename internal::conditional<
copy,
179 OtherCopy otherCopy(
other);
182 Side, Mode>
::run(derived().nestedExpression(), otherCopy);
188 template<
typename Derived,
unsigned int Mode>
189 template<
int S
ide,
typename Other>
190 const internal::triangular_solve_retval<Side,TriangularView<Derived,Mode>,Other>
191 TriangularViewImpl<Derived,Mode,Dense>::solve(
const MatrixBase<Other>&
other)
const
193 return internal::triangular_solve_retval<Side,TriangularViewType,Other>(derived(),
other.derived());
200 template<
int S
ide,
typename TriangularType,
typename Rhs>
207 :
public ReturnByValue<triangular_solve_retval<Side, TriangularType, Rhs> >
219 template<
typename Dest>
inline void evalTo(Dest& dst)
const
235 #endif // EIGEN_SOLVETRIANGULAR_H