add EIGEN_NO_AUTOMATIC_RESIZING

if defined, already initialized matrices won't be automatically resized in assignments
uninitialized matrices may still be initialized
This commit is contained in:
Benoit Jacob 2009-01-28 16:44:03 +00:00
parent 1b194193ef
commit 9bc44094c5

View File

@ -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());