diff options
author | 2009-07-21 11:19:52 +0200 | |
---|---|---|
committer | 2009-07-21 11:19:52 +0200 | |
commit | afa8f2ca952e52201b36813b848aa7a68fca70e9 (patch) | |
tree | 9360f6ca7eb9711d469040fa9c34219fe158ccd7 /Eigen/src/Core/Diagonal.h | |
parent | 34490f1493f8111c131e471a3dc7f6fbe5687404 (diff) |
* various fixes related to sub diagonals and band matrix
* allows 0 sized objects in Block/Map
Diffstat (limited to 'Eigen/src/Core/Diagonal.h')
-rw-r--r-- | Eigen/src/Core/Diagonal.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index 7373abe24..f2bc8566e 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -70,7 +70,7 @@ template<typename MatrixType, int Index> class Diagonal EIGEN_STRONG_INLINE int absIndex() const { return m_index.value()>0 ? m_index.value() : -m_index.value(); } EIGEN_STRONG_INLINE int rowOffset() const { return m_index.value()>0 ? 0 : -m_index.value(); } EIGEN_STRONG_INLINE int colOffset() const { return m_index.value()>0 ? m_index.value() : 0; } - + public: EIGEN_GENERIC_PUBLIC_INTERFACE(Diagonal) @@ -79,7 +79,9 @@ template<typename MatrixType, int Index> class Diagonal EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal) - inline int rows() const{ return m_matrix.diagonalSize() - absIndex(); } + inline int rows() const + { return m_index.value()<0 ? std::min(m_matrix.cols(),m_matrix.rows()+m_index.value()) : std::min(m_matrix.rows(),m_matrix.cols()-m_index.value()); } + inline int cols() const { return 1; } inline Scalar& coeffRef(int row, int) |