diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-01-28 16:44:03 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-01-28 16:44:03 +0000 |
commit | 9bc44094c5aaac5dc4bd494a19eafe7b32645f1a (patch) | |
tree | 2b3ca2869d113f8d47950e8c1476a667b75d9c6b | |
parent | 1b194193efeb9eb1930993e53d65404f2fdd54a1 (diff) |
add EIGEN_NO_AUTOMATIC_RESIZING
if defined, already initialized matrices won't be automatically resized in assignments
uninitialized matrices may still be initialized
-rw-r--r-- | Eigen/src/Core/Matrix.h | 6 |
1 files changed, 6 insertions, 0 deletions
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<typename OtherDerived> EIGEN_STRONG_INLINE void _resize_to_match(const MatrixBase<OtherDerived>& 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()); |