diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-08-21 04:36:48 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-08-21 04:36:48 +0000 |
commit | 591d497b848844dbae9ac3f38ad2d45241a05470 (patch) | |
tree | b4fad1a4dcb93231b41a6747c9ec345d1757260e /Eigen/src/Core/Map.h | |
parent | 84a39e04bfb74c8a0006e9630f5584c7c40069d1 (diff) |
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.
Diffstat (limited to 'Eigen/src/Core/Map.h')
-rw-r--r-- | Eigen/src/Core/Map.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 85fbcc0f0..73f920bb9 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -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) }; |