11 #ifndef EIGEN_SPARSE_TRIANGULARVIEW_H 12 #define EIGEN_SPARSE_TRIANGULARVIEW_H 18 template<
typename MatrixType,
int Mode>
20 :
public traits<MatrixType>
30 SkipLast = !SkipFirst,
32 HasUnitDiag = (Mode&
UnitDiag) ? 1 : 0
42 inline Index rows()
const {
return m_matrix.rows(); }
43 inline Index cols()
const {
return m_matrix.cols(); }
45 typedef typename MatrixType::Nested MatrixTypeNested;
52 inline const MatrixTypeNestedCleaned& nestedExpression()
const {
return m_matrix; }
54 template<
typename OtherDerived>
62 MatrixTypeNested m_matrix;
65 template<
typename MatrixType,
int Mode>
68 typedef typename MatrixTypeNestedCleaned::InnerIterator
Base;
69 typedef typename SparseTriangularView::Index Index;
73 : Base(view.nestedExpression(), outer), m_returnOne(
false)
77 while((*
this) && ((HasUnitDiag||SkipDiag) ? this->index()<=outer : this->index()<outer))
82 else if(HasUnitDiag && ((!Base::operator
bool()) || Base::index()>=Base::outer()))
84 if((!SkipFirst) && Base::operator
bool())
90 EIGEN_STRONG_INLINE InnerIterator& operator++()
92 if(HasUnitDiag && m_returnOne)
97 if(HasUnitDiag && (!SkipFirst) && ((!Base::operator
bool()) || Base::index()>=Base::outer()))
99 if((!SkipFirst) && Base::operator
bool())
107 inline Index row()
const {
return (MatrixType::Flags&
RowMajorBit ? Base::outer() : this->index()); }
108 inline Index col()
const {
return (MatrixType::Flags&
RowMajorBit ? this->index() : Base::outer()); }
109 inline Index index()
const 111 if(HasUnitDiag && m_returnOne)
return Base::outer();
112 else return Base::index();
114 inline Scalar value()
const 116 if(HasUnitDiag && m_returnOne)
return Scalar(1);
117 else return Base::value();
120 EIGEN_STRONG_INLINE
operator bool()
const 122 if(HasUnitDiag && m_returnOne)
124 if(SkipFirst)
return Base::operator bool();
127 if (SkipDiag)
return (Base::operator
bool() && this->index() < this->outer());
128 else return (Base::operator
bool() && this->index() <= this->outer());
135 template<
typename MatrixType,
int Mode>
138 typedef typename MatrixTypeNestedCleaned::ReverseInnerIterator
Base;
139 typedef typename SparseTriangularView::Index Index;
143 : Base(view.nestedExpression(), outer)
145 eigen_assert((!HasUnitDiag) &&
"ReverseInnerIterator does not support yet triangular views with a unit diagonal");
147 while((*
this) && (SkipDiag ? this->index()>=outer : this->index()>outer))
152 EIGEN_STRONG_INLINE ReverseInnerIterator& operator--()
153 { Base::operator--();
return *
this; }
155 inline Index row()
const {
return Base::row(); }
156 inline Index col()
const {
return Base::col(); }
158 EIGEN_STRONG_INLINE
operator bool()
const 160 if (SkipLast)
return Base::operator bool() ;
163 if(SkipDiag)
return (Base::operator
bool() && this->index() > this->outer());
164 else return (Base::operator
bool() && this->index() >= this->outer());
169 template<
typename Derived>
179 #endif // EIGEN_SPARSE_TRIANGULARVIEW_H Definition: gtest_unittest.cc:5031
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Matrix has ones on the diagonal; to be used in combination with Lower or Upper.
Definition: Constants.h:171
Matrix has zeros on the diagonal; to be used in combination with Lower or Upper.
Definition: Constants.h:173
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:53
Definition: SparseTriangularView.h:25
View matrix as an upper triangular matrix.
Definition: Constants.h:169
Base class of any sparse matrices or sparse expressions.
Definition: ForwardDeclarations.h:239
Definition: SparseTriangularView.h:66
Definition: SparseTriangularView.h:136
Definition: BandTriangularSolver.h:13
View matrix as a lower triangular matrix.
Definition: Constants.h:167
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: ForwardDeclarations.h:17
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48