From 591d497b848844dbae9ac3f38ad2d45241a05470 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 21 Aug 2008 04:36:48 +0000 Subject: [PATCH] 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. --- Eigen/src/Core/Map.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 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) };