From 89557ac41d50196f17d48ada5137fcf435abe73a Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 3 Sep 2009 02:50:42 -0400 Subject: introduce EIGEN_SIZE_MIN now we should check if some EIGEN_ENUM_MIN usage needs to be replaced by that... potential bug when using mixed-size matrice --- Eigen/src/Core/util/Macros.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Eigen/src/Core/util/Macros.h') diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 4e00df759..ec8337e33 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -260,11 +260,11 @@ using Base::operator +=; \ using Base::operator -=; \ using Base::operator *=; \ using Base::operator /=; \ -EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) \ -{ \ - return Base::operator=(other); \ -} -#endif +EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) \ +{ \ + return Base::operator=(other); \ +} +#endif #define _EIGEN_GENERIC_PUBLIC_INTERFACE(Derived, BaseClass) \ typedef BaseClass Base; \ @@ -287,6 +287,9 @@ enum { RowsAtCompileTime = Eigen::ei_traits::RowsAtCompileTime, \ _EIGEN_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::MatrixBase) #define EIGEN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b) +#define EIGEN_SIZE_MIN(a,b) (((int)a == 1 || (int)b == 1) ? 1 \ + : ((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \ + : ((int)a <= (int)b) ? (int)a : (int)b) #define EIGEN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b) #define EIGEN_LOGICAL_XOR(a,b) (((a) || (b)) && !((a) && (b))) -- cgit v1.2.3