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();
170 eigen_assert( derived().cols() == derived().rows() && ((Side==
OnTheLeft && derived().cols() == other.rows()) || (Side==
OnTheRight && derived().cols() == other.cols())) );
173 if (derived().cols() == 0)
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
#define EIGEN_NOEXCEPT
Definition: Macros.h:1418
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
#define eigen_assert(x)
Definition: Macros.h:1037
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
Definition: Memory.h:768
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:180
Definition: ReturnByValue.h:52
Expression of the transpose of a matrix.
Definition: Transpose.h:54
Definition: GeneralMatrixMatrix.h:248
Definition: SolveTriangular.h:28
@ RhsIsVectorAtCompileTime
Definition: SolveTriangular.h:31
@ RhsVectors
Definition: SolveTriangular.h:37
@ Unrolling
Definition: SolveTriangular.h:35
@ UnitDiag
Definition: Constants.h:213
@ ZeroDiag
Definition: Constants.h:215
@ Lower
Definition: Constants.h:209
@ Upper
Definition: Constants.h:211
@ Aligned
Definition: Constants.h:240
@ ColMajor
Definition: Constants.h:319
@ RowMajor
Definition: Constants.h:321
@ OnTheLeft
Definition: Constants.h:332
@ OnTheRight
Definition: Constants.h:334
const unsigned int RowMajorBit
Definition: Constants.h:66
EIGEN_DEVICE_FUNC bool is_same_dense(const T1 &mat1, const T2 &mat2, typename enable_if< possibly_same_dense< T1, T2 >::value >::type *=0)
Definition: XprHelper.h:695
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
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
@ CompleteUnrolling
Definition: Constants.h:304
@ NoUnrolling
Definition: Constants.h:299
const int Dynamic
Definition: Constants.h:22
type
The type the bitset is encoded with.
Definition: bitset.hpp:44
Flags
Special flags for archives.
Definition: cereal.hpp:185
Definition: document.h:416
const T type
Definition: Meta.h:214
Definition: BlasUtil.h:403
const XprType & ExtractType
Definition: BlasUtil.h:405
Matrix< typename traits< T >::Scalar, Rows, Cols,(MaxRows==1 &&MaxCols!=1) ? RowMajor :ColMajor, MaxRows, MaxCols > type
Definition: XprHelper.h:391
T type
Definition: Meta.h:126
internal::plain_matrix_type_column_major< Rhs >::type ReturnType
Definition: SolveTriangular.h:203
Definition: ForwardDeclarations.h:17
Definition: SolveTriangular.h:23
Definition: SolveTriangular.h:208
const TriangularType & m_triangularMatrix
Definition: SolveTriangular.h:227
void evalTo(Dest &dst) const
Definition: SolveTriangular.h:219
remove_all< typename Rhs::Nested >::type RhsNestedCleaned
Definition: SolveTriangular.h:209
triangular_solve_retval(const TriangularType &tri, const Rhs &rhs)
Definition: SolveTriangular.h:212
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: SolveTriangular.h:217
ReturnByValue< triangular_solve_retval > Base
Definition: SolveTriangular.h:210
Rhs::Nested m_rhs
Definition: SolveTriangular.h:228
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: SolveTriangular.h:216
Definition: SolveTriangular.h:20
static EIGEN_DEVICE_FUNC void run(const Lhs &lhs, Rhs &rhs)
Definition: SolveTriangular.h:141
static EIGEN_DEVICE_FUNC void run(const Lhs &lhs, Rhs &rhs)
Definition: SolveTriangular.h:147
static EIGEN_DEVICE_FUNC void run(const Lhs &lhs, Rhs &rhs)
Definition: SolveTriangular.h:57
LhsProductTraits::ExtractType ActualLhsType
Definition: SolveTriangular.h:55
Rhs::Scalar RhsScalar
Definition: SolveTriangular.h:53
Lhs::Scalar LhsScalar
Definition: SolveTriangular.h:52
Map< Matrix< RhsScalar, Dynamic, 1 >, Aligned > MappedRhs
Definition: SolveTriangular.h:56
blas_traits< Lhs > LhsProductTraits
Definition: SolveTriangular.h:54
blas_traits< Lhs > LhsProductTraits
Definition: SolveTriangular.h:85
Rhs::Scalar Scalar
Definition: SolveTriangular.h:84
LhsProductTraits::DirectLinearAccessType ActualLhsType
Definition: SolveTriangular.h:86
static EIGEN_DEVICE_FUNC void run(const Lhs &lhs, Rhs &rhs)
Definition: SolveTriangular.h:88
Definition: SolveTriangular.h:47
static EIGEN_DEVICE_FUNC void run(const Lhs &lhs, Rhs &rhs)
Definition: SolveTriangular.h:121
static EIGEN_DEVICE_FUNC void run(const Lhs &, Rhs &)
Definition: SolveTriangular.h:136
Definition: SolveTriangular.h:112
#define const
Definition: zconf.h:233