[eigen] Very small patch to _resize_to_match

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

in case EIGEN_NO_AUTOMATIC_RESIZING is defined resizeLike(other) is
called although due to the assertion *this and other have the same
dimensions. This is not a bug. It's just that some unnecessary code
might be executed. A very small patch is attached.

Jens
# HG changeset patch
# User Jens Mueller <jens.k.mueller@xxxxxx>
# Date 1278403878 -7200
# Node ID 8c74f9ab1a315488c82c44f26b1b10d888b92e9a
# Parent  61c87eb51f3989ff8581ac82ba31ec9e5a41b93b
Avoid calling resizeLike, if EIGEN_NO_AUTOMATIC_RESIZING is defined

diff -r 61c87eb51f39 -r 8c74f9ab1a31 Eigen/src/Core/DenseStorageBase.h
--- a/Eigen/src/Core/DenseStorageBase.h	Wed Jun 30 14:05:37 2010 +0200
+++ b/Eigen/src/Core/DenseStorageBase.h	Tue Jul 06 10:11:18 2010 +0200
@@ -432,8 +432,9 @@
       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");
+      #else
+      resizeLike(other);
       #endif
-      resizeLike(other);
     }
 
     /**


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/