10 #ifndef EIGEN_BANDMATRIX_H
11 #define EIGEN_BANDMATRIX_H
17 template<
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((Options&
RowMajor)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
79 len = std::max<Index>(0,
coeffs().rows() - (i + 1 -
rows() +
subs()));
96 DiagonalSize = (RowsAtCompileTime==
Dynamic || ColsAtCompileTime==
Dynamic)
99 ? EIGEN_SIZE_MIN_PREFER_DYNAMIC(ColsAtCompileTime, RowsAtCompileTime + ActualIndex)
100 : EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime, ColsAtCompileTime - ActualIndex))
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
145 DenseMatrixType toDenseMatrix()
const
177 template<
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,
198 template<
typename _Scalar,
int Rows,
int Cols,
int Supers,
int Subs,
int Options>
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;
236 template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
237 class BandMatrixWrapper;
239 template<
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,
257 typedef _CoefficientsType CoefficientsType;
260 template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
273 EIGEN_UNUSED_VARIABLE(
cols);
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::StorageIndex StorageIndex;
319 inline typename Base::template DiagonalIntReturnType<1>::Type super()
320 {
return Base::template diagonal<1>(); }
321 inline const typename Base::template DiagonalIntReturnType<1>::Type super()
const
322 {
return Base::template diagonal<1>(); }
323 inline typename Base::template DiagonalIntReturnType<-1>::Type sub()
324 {
return Base::template
diagonal<-1>(); }
325 inline const typename Base::template DiagonalIntReturnType<-1>::Type sub()
const
326 {
return Base::template
diagonal<-1>(); }
333 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
340 template<
typename _CoefficientsType,
int _Rows,
int _Cols,
int _Supers,
int _Subs,
int _Options>
342 :
public evaluator_traits_base<BandMatrixWrapper<_CoefficientsType,_Rows,_Cols,_Supers,_Subs,_Options> >
353 #endif // EIGEN_BANDMATRIX_H