From 9bc44094c5aaac5dc4bd494a19eafe7b32645f1a Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 28 Jan 2009 16:44:03 +0000 Subject: [PATCH] add EIGEN_NO_AUTOMATIC_RESIZING if defined, already initialized matrices won't be automatically resized in assignments uninitialized matrices may still be initialized --- Eigen/src/Core/Matrix.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 482afe890..f62037709 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -463,6 +463,12 @@ class Matrix template EIGEN_STRONG_INLINE void _resize_to_match(const MatrixBase& other) { + #ifdef EIGEN_NO_AUTOMATIC_RESIZING + ei_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size()) + : (rows() == other.rows() && cols() == other.cols()))) + && "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined"); + #endif + if(RowsAtCompileTime == 1) { ei_assert(other.isVector());