10 #ifndef EIGEN_BANDMATRIX_H 11 #define EIGEN_BANDMATRIX_H 17 template<
typename Derived>
35 typedef typename DenseMatrixType::Index Index;
44 SizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime,ColsAtCompileTime)
60 inline const CoefficientsType&
coeffs()
const {
return derived().coeffs(); }
70 EIGEN_STATIC_ASSERT((
Options&
RowMajor)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
72 Index len =
coeffs().rows();
79 len = std::max<Index>(0,
coeffs().rows() - (i + 1 -
rows() +
subs()));
93 ReturnOpposite = (
Options&
SelfAdjoint) && (((Index)>0 && Supers==0) || ((Index)<0 && Subs==0)),
95 ActualIndex = ReturnOpposite ? -Index : Index,
96 DiagonalSize = (RowsAtCompileTime==
Dynamic || ColsAtCompileTime==
Dynamic)
99 ? EIGEN_SIZE_MIN_PREFER_DYNAMIC(ColsAtCompileTime, RowsAtCompileTime + ActualIndex)
100 : EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime, ColsAtCompileTime - ActualIndex))
105 BuildType>::type
Type;
109 template<
int N>
inline typename DiagonalIntReturnType<N>::Type
diagonal()
111 return typename DiagonalIntReturnType<N>::BuildType(
coeffs(),
supers()-N, (std::max)(0,N), 1, diagonalLength(N));
115 template<
int N>
inline const typename DiagonalIntReturnType<N>::Type
diagonal()
const 117 return typename DiagonalIntReturnType<N>::BuildType(
coeffs(),
supers()-N, (std::max)(0,N), 1, diagonalLength(N));
123 eigen_assert((i<0 && -i<=
subs()) || (i>=0 && i<=
supers()));
130 eigen_assert((i<0 && -i<=
subs()) || (i>=0 && i<=
supers()));
134 template<
typename Dest>
inline void evalTo(Dest& dst)
const 139 for (Index i=1; i<=
supers();++i)
141 for (Index i=1; i<=
subs();++i)
145 DenseMatrixType toDenseMatrix()
const 154 inline Index diagonalLength(Index i)
const 177 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
180 typedef _Scalar Scalar;
182 typedef DenseIndex Index;
185 RowsAtCompileTime = _Rows,
186 ColsAtCompileTime = _Cols,
187 MaxRowsAtCompileTime = _Rows,
188 MaxColsAtCompileTime = _Cols,
198 template<
typename _Scalar,
int Rows,
int Cols,
int Supers,
int Subs,
int Options>
214 inline Index
rows()
const {
return m_rows.value(); }
217 inline Index
cols()
const {
return m_coeffs.cols(); }
220 inline Index
supers()
const {
return m_supers.value(); }
223 inline Index
subs()
const {
return m_subs.value(); }
225 inline const CoefficientsType&
coeffs()
const {
return m_coeffs; }
226 inline CoefficientsType&
coeffs() {
return m_coeffs; }
230 CoefficientsType m_coeffs;
236 template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
239 template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
243 typedef typename _CoefficientsType::StorageKind StorageKind;
244 typedef typename _CoefficientsType::Index Index;
247 RowsAtCompileTime = _Rows,
248 ColsAtCompileTime = _Cols,
249 MaxRowsAtCompileTime = _Rows,
250 MaxColsAtCompileTime = _Cols,
257 typedef _CoefficientsType CoefficientsType;
260 template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
273 EIGEN_UNUSED_VARIABLE(
cols);
278 inline Index
rows()
const {
return m_rows.value(); }
281 inline Index
cols()
const {
return m_coeffs.cols(); }
284 inline Index
supers()
const {
return m_supers.value(); }
287 inline Index
subs()
const {
return m_subs.value(); }
289 inline const CoefficientsType&
coeffs()
const {
return m_coeffs; }
293 const CoefficientsType& m_coeffs;
311 template<
typename Scalar,
int Size,
int Options>
315 typedef typename Base::Index Index;
320 {
return Base::template diagonal<1>(); }
322 {
return Base::template diagonal<1>(); }
324 {
return Base::template
diagonal<-1>(); }
326 {
return Base::template
diagonal<-1>(); }
334 #endif // EIGEN_BANDMATRIX_H Index subs() const
Definition: BandMatrix.h:223
Index supers() const
Definition: BandMatrix.h:54
Index subs() const
Definition: BandMatrix.h:287
Index subs() const
Definition: BandMatrix.h:57
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition: Constants.h:131
Represents a rectangular matrix with a banded storage.
Definition: BandMatrix.h:199
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Holds information about the various numeric (i.e.
Definition: NumTraits.h:88
Derived & derived()
Definition: EigenBase.h:34
Block< CoefficientsType, 1, SizeAtCompileTime > diagonal()
Definition: BandMatrix.h:84
Definition: BandMatrix.h:237
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:26
Index rows() const
Definition: BandMatrix.h:278
const Block< const CoefficientsType, 1, Dynamic > diagonal(Index i) const
Definition: BandMatrix.h:128
Used in BandMatrix and SelfAdjointView to indicate that the matrix is self-adjoint.
Definition: Constants.h:183
DiagonalIntReturnType< N >::Type diagonal()
Definition: BandMatrix.h:109
Index size() const
Definition: EigenBase.h:49
Represents a tridiagonal matrix with a compact banded storage.
Definition: BandMatrix.h:312
Index rows() const
Definition: EigenBase.h:44
Definition: ForwardDeclarations.h:85
Index cols() const
Definition: BandMatrix.h:217
const CoefficientsType & coeffs() const
Definition: BandMatrix.h:60
const Block< const CoefficientsType, 1, SizeAtCompileTime > diagonal() const
Definition: BandMatrix.h:88
Index supers() const
Definition: BandMatrix.h:284
Definition: BandTriangularSolver.h:13
Storage order is row major (see TopicStorageOrders).
Definition: Constants.h:266
CoefficientsType & coeffs()
Definition: BandMatrix.h:63
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
Index cols() const
Definition: BandMatrix.h:281
Block< CoefficientsType, Dynamic, 1 > col(Index i)
Definition: BandMatrix.h:68
Index rows() const
Definition: BandMatrix.h:214
The type used to identify a dense storage.
Definition: Constants.h:428
Index supers() const
Definition: BandMatrix.h:220
Block< CoefficientsType, 1, Dynamic > diagonal(Index i)
Definition: BandMatrix.h:121
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
Definition: BandMatrix.h:18
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:59
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
Index cols() const
Definition: EigenBase.h:46
Definition: BandMatrix.h:91
Definition: ForwardDeclarations.h:17
const DiagonalIntReturnType< N >::Type diagonal() const
Definition: BandMatrix.h:115
Definition: osvr_print_tree.cpp:52
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48