From 86be59124df620ef86da1261842845bd61e68e52 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 27 May 2009 23:07:29 +0200 Subject: fix the static assert checking the size template parameters. --- Eigen/src/Core/Matrix.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Eigen/src') diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 4d97d61d2..d75d61413 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -530,8 +530,14 @@ class Matrix static EIGEN_STRONG_INLINE void _check_template_params() { - EIGEN_STATIC_ASSERT(((_MaxRows >= _Rows || _Rows==Dynamic) - && (_MaxCols >= _Cols || _Cols==Dynamic) + EIGEN_STATIC_ASSERT(((_Rows >= _MaxRows) + && (_Cols >= _MaxCols) + && (_MaxRows >= 1) + && (_MaxCols >= 1) + && (_Rows <= Dynamic) + && (_Cols <= Dynamic) + && (_MaxRows == _Rows || _Rows==Dynamic) + && (_MaxCols == _Cols || _Cols==Dynamic) && ((_MaxRows==Dynamic?1:_MaxRows)*(_MaxCols==Dynamic?1:_MaxCols)