add resize() methods to Map, doing nothing but assertions.

This is useful in Krita where I call lu().solve() with a Map object
as result. As solve() resizes the result, this was needed.
This commit is contained in:
Benoit Jacob 2008-08-21 04:36:48 +00:00
parent 84a39e04bf
commit 591d497b84

View File

@ -80,6 +80,21 @@ template<typename MatrixType, int PacketAccess> class Map
inline Map(const Scalar* data, int rows, int cols) : Base(data, rows, cols) {}
inline void resize(int rows, int cols)
{
EIGEN_ONLY_USED_FOR_DEBUG(rows);
EIGEN_ONLY_USED_FOR_DEBUG(cols);
ei_assert(rows == this->rows());
ei_assert(rows == this->cols());
}
inline void resize(int size)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(MatrixType);
EIGEN_ONLY_USED_FOR_DEBUG(size);
ei_assert(size == this->size());
}
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Map)
};