aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-12-11 10:05:50 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-12-11 10:05:50 +0000
commiteffaee9bc7bf48a8703c75c8279279e2f1055766 (patch)
treeacc07d10648bfbb1cd8319492eae786c16ea3ad6
parentfc924bc7d477cffe80507653591ce71eb20c91ce (diff)
fix bugs in Block/DynBlock
-rw-r--r--src/Core/Block.h2
-rw-r--r--src/Core/DynBlock.h7
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)