10#ifndef EIGEN_BANDMATRIX_H
11#define EIGEN_BANDMATRIX_H
17template<
typename Derived>
35 typedef typename DenseMatrixType::StorageIndex StorageIndex;
44 SizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime,ColsAtCompileTime)
60 inline const CoefficientsType&
coeffs()
const {
return derived().coeffs(); }
70 EIGEN_STATIC_ASSERT((
int(Options) &
int(
RowMajor)) == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
79 len = std::max<Index>(0,
coeffs().rows() - (i + 1 -
rows() +
subs()));
93 ReturnOpposite = (int(Options) & int(
SelfAdjoint)) && (((
Index) > 0 && Supers == 0) || ((
Index) < 0 && Subs == 0)),
96 DiagonalSize = (RowsAtCompileTime==
Dynamic || ColsAtCompileTime==
Dynamic)
99 ? EIGEN_SIZE_MIN_PREFER_DYNAMIC(ColsAtCompileTime, RowsAtCompileTime + ActualIndex)
100 : EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime, ColsAtCompileTime - ActualIndex))
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
145 DenseMatrixType toDenseMatrix()
const
177template<
typename _Scalar,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
180 typedef _Scalar Scalar;
185 RowsAtCompileTime =
_Rows,
186 ColsAtCompileTime =
_Cols,
187 MaxRowsAtCompileTime =
_Rows,
188 MaxColsAtCompileTime =
_Cols,
198template<
typename _Scalar,
int Rows,
int Cols,
int Supers,
int Subs,
int Options>
214 inline EIGEN_CONSTEXPR
Index rows()
const {
return m_rows.value(); }
217 inline EIGEN_CONSTEXPR
Index cols()
const {
return m_coeffs.cols(); }
220 inline EIGEN_CONSTEXPR
Index supers()
const {
return m_supers.value(); }
223 inline EIGEN_CONSTEXPR
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;
231 internal::variable_if_dynamic<Index, Rows> m_rows;
232 internal::variable_if_dynamic<Index, Supers> m_supers;
233 internal::variable_if_dynamic<Index, Subs> m_subs;
236template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
237class BandMatrixWrapper;
239template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
242 typedef typename _CoefficientsType::Scalar Scalar;
243 typedef typename _CoefficientsType::StorageKind StorageKind;
244 typedef typename _CoefficientsType::StorageIndex StorageIndex;
247 RowsAtCompileTime =
_Rows,
248 ColsAtCompileTime =
_Cols,
249 MaxRowsAtCompileTime =
_Rows,
250 MaxColsAtCompileTime =
_Cols,
260template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
273 EIGEN_UNUSED_VARIABLE(
cols);
278 inline EIGEN_CONSTEXPR
Index rows()
const {
return m_rows.value(); }
281 inline EIGEN_CONSTEXPR
Index cols()
const {
return m_coeffs.cols(); }
284 inline EIGEN_CONSTEXPR
Index supers()
const {
return m_supers.value(); }
287 inline EIGEN_CONSTEXPR
Index subs()
const {
return m_subs.value(); }
289 inline const CoefficientsType& coeffs()
const {
return m_coeffs; }
293 const CoefficientsType& m_coeffs;
311template<
typename Scalar,
int Size,
int Options>
315 typedef typename Base::StorageIndex StorageIndex;
324 {
return Base::template
diagonal<-1>(); }
326 {
return Base::template
diagonal<-1>(); }
333template<
typename _Scalar,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
340template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
342 :
public evaluator_traits_base<BandMatrixWrapper<_CoefficientsType,_Rows,_Cols,_Supers,_Subs,_Options> >
Definition ForwardDeclarations.h:87
EIGEN_DEVICE_FUNC void resize(Index newSize)
Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods...
Definition DenseBase.h:246
EIGEN_DEVICE_FUNC Derived & setZero()
Sets all coefficients in this expression to zero.
Definition CwiseNullaryOp.h:546
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
Definition Diagonal.h:187
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
Definition BandMatrix.h:19
Index subs() const
Definition BandMatrix.h:57
Block< CoefficientsType, Dynamic, 1 > col(Index i)
Definition BandMatrix.h:68
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition EigenBase.h:63
Index supers() const
Definition BandMatrix.h:54
const Block< const CoefficientsType, 1, Dynamic > diagonal(Index i) const
Definition BandMatrix.h:128
const DiagonalIntReturnType< N >::Type diagonal() const
Definition BandMatrix.h:115
const CoefficientsType & coeffs() const
Definition BandMatrix.h:60
CoefficientsType & coeffs()
Definition BandMatrix.h:63
DiagonalIntReturnType< N >::Type diagonal()
Definition BandMatrix.h:109
EIGEN_DEVICE_FUNC Derived & derived()
Definition EigenBase.h:46
Block< CoefficientsType, 1, SizeAtCompileTime > diagonal()
Definition BandMatrix.h:84
Block< CoefficientsType, 1, Dynamic > diagonal(Index i)
Definition BandMatrix.h:121
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition EigenBase.h:60
const Block< const CoefficientsType, 1, SizeAtCompileTime > diagonal() const
Definition BandMatrix.h:88
Definition BandMatrix.h:262
EIGEN_CONSTEXPR Index supers() const
Definition BandMatrix.h:284
EIGEN_CONSTEXPR Index rows() const
Definition BandMatrix.h:278
EIGEN_CONSTEXPR Index cols() const
Definition BandMatrix.h:281
EIGEN_CONSTEXPR Index subs() const
Definition BandMatrix.h:287
Represents a rectangular matrix with a banded storage.
Definition BandMatrix.h:200
EIGEN_CONSTEXPR Index supers() const
Definition BandMatrix.h:220
EIGEN_CONSTEXPR Index rows() const
Definition BandMatrix.h:214
EIGEN_CONSTEXPR Index subs() const
Definition BandMatrix.h:223
EIGEN_CONSTEXPR Index cols() const
Definition BandMatrix.h:217
Represents a tridiagonal matrix with a compact banded storage.
Definition BandMatrix.h:313
Definition XprHelper.h:130
@ SelfAdjoint
Used in BandMatrix and SelfAdjointView to indicate that the matrix is self-adjoint.
Definition Constants.h:225
@ ColMajor
Storage order is column major (see TopicStorageOrders).
Definition Constants.h:319
@ RowMajor
Storage order is row major (see TopicStorageOrders).
Definition Constants.h:321
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition Constants.h:144
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
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition Constants.h:22
Definition Constants.h:528
The type used to identify a dense storage.
Definition Constants.h:507
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition EigenBase.h:30
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition EigenBase.h:63
Eigen::Index Index
The interface type of indices.
Definition EigenBase.h:39
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition EigenBase.h:67
EIGEN_DEVICE_FUNC Derived & derived()
Definition EigenBase.h:46
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition EigenBase.h:60
Holds information about the various numeric (i.e.
Definition NumTraits.h:236
Definition AssignEvaluator.h:817
Definition BandMatrix.h:91
Definition BandMatrix.h:331
Definition AssignEvaluator.h:815
Definition CoreEvaluators.h:71
Definition CoreEvaluators.h:80
Definition ForwardDeclarations.h:17