mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-08 17:59:00 +08:00
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:
parent
1b194193ef
commit
9bc44094c5
@ -463,6 +463,12 @@ class Matrix
|
|||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
EIGEN_STRONG_INLINE void _resize_to_match(const MatrixBase<OtherDerived>& other)
|
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)
|
if(RowsAtCompileTime == 1)
|
||||||
{
|
{
|
||||||
ei_assert(other.isVector());
|
ei_assert(other.isVector());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user