mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-08 09:49:03 +08:00
fix bugs in Block/DynBlock
This commit is contained in:
parent
fc924bc7d4
commit
effaee9bc7
@ -42,7 +42,7 @@ template<typename MatrixType, int BlockRows, int BlockCols> class Block
|
|||||||
: m_matrix(matrix), m_startRow(startRow), m_startCol(startCol)
|
: m_matrix(matrix), m_startRow(startRow), m_startCol(startCol)
|
||||||
{
|
{
|
||||||
assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
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)
|
Block(const Block& other)
|
||||||
|
@ -34,8 +34,9 @@ template<typename MatrixType> class DynBlock
|
|||||||
typedef typename MatrixType::Ref MatRef;
|
typedef typename MatrixType::Ref MatRef;
|
||||||
friend class MatrixBase<Scalar, DynBlock<MatrixType> >;
|
friend class MatrixBase<Scalar, DynBlock<MatrixType> >;
|
||||||
|
|
||||||
static const int RowsAtCompileTime = Dynamic,
|
static const int
|
||||||
ColsAtCompileTime = Dynamic;
|
RowsAtCompileTime = MatrixType::RowsAtCompileTime == 1 ? 1 : Dynamic,
|
||||||
|
ColsAtCompileTime = MatrixType::ColsAtCompileTime == 1 ? 1 : Dynamic;
|
||||||
|
|
||||||
DynBlock(const MatRef& matrix,
|
DynBlock(const MatRef& matrix,
|
||||||
int startRow, int startCol,
|
int startRow, int startCol,
|
||||||
@ -44,7 +45,7 @@ template<typename MatrixType> class DynBlock
|
|||||||
m_blockRows(blockRows), m_blockCols(blockCols)
|
m_blockRows(blockRows), m_blockCols(blockCols)
|
||||||
{
|
{
|
||||||
assert(startRow >= 0 && blockRows >= 1 && startRow + blockRows <= matrix.rows()
|
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)
|
DynBlock(const DynBlock& other)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user