11#ifndef EIGEN_SPARSE_TRIANGULARVIEW_H
12#define EIGEN_SPARSE_TRIANGULARVIEW_H
30 SkipLast = !SkipFirst,
32 HasUnitDiag = (Mode&
UnitDiag) ? 1 : 0
46 typedef typename MatrixType::Nested MatrixTypeNested;
48 typedef typename internal::remove_all<MatrixTypeNested>::type MatrixTypeNestedCleaned;
50 template<
typename RhsType,
typename DstType>
55 this->solveInPlace(
dst);
68template<
typename ArgType,
unsigned int Mode>
70 : evaluator_base<TriangularView<ArgType,Mode> >
76 typedef typename XprType::Scalar Scalar;
77 typedef typename XprType::StorageIndex StorageIndex;
78 typedef typename evaluator<ArgType>::InnerIterator EvalIterator;
82 SkipLast = !SkipFirst,
84 HasUnitDiag = (Mode&
UnitDiag) ? 1 : 0
90 CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
91 Flags = XprType::Flags
94 explicit unary_evaluator(
const XprType &xpr) : m_argImpl(xpr.nestedExpression()), m_arg(xpr.nestedExpression()) {}
96 inline Index nonZerosEstimate()
const {
97 return m_argImpl.nonZerosEstimate();
110 while((*
this) && ((HasUnitDiag||SkipDiag) ? this->index()<=outer : this->index()<outer))
113 m_returnOne = m_containsDiag;
115 else if(HasUnitDiag && ((!Base::operator
bool()) || Base::index()>=Base::outer()))
117 if((!SkipFirst) && Base::operator
bool())
119 m_returnOne = m_containsDiag;
125 if(HasUnitDiag && m_returnOne)
130 if(HasUnitDiag && (!SkipFirst) && ((!Base::operator
bool()) || Base::index()>=Base::outer()))
132 if((!SkipFirst) && Base::operator
bool())
134 m_returnOne = m_containsDiag;
140 EIGEN_STRONG_INLINE
operator bool()
const
142 if(HasUnitDiag && m_returnOne)
144 if(SkipFirst)
return Base::operator bool();
147 if (SkipDiag)
return (Base::operator
bool() && this->index() < this->outer());
148 else return (Base::operator
bool() && this->index() <= this->outer());
154 inline StorageIndex index()
const
156 if(HasUnitDiag && m_returnOne)
return internal::convert_index<StorageIndex>(Base::outer());
157 else return Base::index();
159 inline Scalar value()
const
161 if(HasUnitDiag && m_returnOne)
return Scalar(1);
162 else return Base::value();
174 const ArgType& m_arg;
179template<
typename Derived>
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const
Definition DenseBase.h:235
An InnerIterator allows to loop over the element of any matrix expression.
Definition CoreIterators.h:34
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Base class of any sparse matrices or sparse expressions.
Definition SparseMatrixBase.h:28
void solveInPlace(MatrixBase< OtherDerived > &other) const
Applies the inverse of *this to the dense vector or matrix other, "in-place".
void solveInPlace(SparseMatrixBase< OtherDerived > &other) const
Applies the inverse of *this to the sparse vector or matrix other, "in-place".
Definition TriangularMatrix.h:183
Expression of a triangular part in a matrix.
Definition TriangularMatrix.h:187
@ UnitDiag
Matrix has ones on the diagonal; to be used in combination with #Lower or #Upper.
Definition Constants.h:213
@ ZeroDiag
Matrix has zeros on the diagonal; to be used in combination with #Lower or #Upper.
Definition Constants.h:215
@ Lower
View matrix as a lower triangular matrix.
Definition Constants.h:209
@ Upper
View matrix as an upper triangular matrix.
Definition Constants.h:211
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:66
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
The type used to identify a general sparse storage.
Definition Constants.h:510
Definition CoreEvaluators.h:65