diff options
-rw-r--r-- | src/Core/Block.h | 2 | ||||
-rw-r--r-- | src/Core/DynBlock.h | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Core/Block.h b/src/Core/Block.h index 72f291034..c5ab18884 100644 --- a/src/Core/Block.h +++ b/src/Core/Block.h @@ -42,7 +42,7 @@ template<typename MatrixType, int BlockRows, int BlockCols> class Block : m_matrix(matrix), m_startRow(startRow), m_startCol(startCol) { assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows() - && startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.rows()); + && startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols()); } Block(const Block& other) diff --git a/src/Core/DynBlock.h b/src/Core/DynBlock.h index 8a52b4c58..efe16abc4 100644 --- a/src/Core/DynBlock.h +++ b/src/Core/DynBlock.h @@ -34,8 +34,9 @@ template<typename MatrixType> class DynBlock typedef typename MatrixType::Ref MatRef; friend class MatrixBase<Scalar, DynBlock<MatrixType> >; - static const int RowsAtCompileTime = Dynamic, - ColsAtCompileTime = Dynamic; + static const int + RowsAtCompileTime = MatrixType::RowsAtCompileTime == 1 ? 1 : Dynamic, + ColsAtCompileTime = MatrixType::ColsAtCompileTime == 1 ? 1 : Dynamic; DynBlock(const MatRef& matrix, int startRow, int startCol, @@ -44,7 +45,7 @@ template<typename MatrixType> class DynBlock m_blockRows(blockRows), m_blockCols(blockCols) { assert(startRow >= 0 && blockRows >= 1 && startRow + blockRows <= matrix.rows() - && startCol >= 0 && blockCols >= 1 && startCol + blockCols <= matrix.rows()); + && startCol >= 0 && blockCols >= 1 && startCol + blockCols <= matrix.cols()); } DynBlock(const DynBlock& other) |