aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/src/Core/BandMatrix.h3
-rw-r--r--Eigen/src/Geometry/Umeyama.h6
-rw-r--r--Eigen/src/LU/FullPivLU.h4
-rw-r--r--Eigen/src/LU/PartialPivLU.h2
-rw-r--r--Eigen/src/QR/ColPivHouseholderQR.h2
-rw-r--r--Eigen/src/QR/FullPivHouseholderQR.h2
-rw-r--r--Eigen/src/SVD/SVD.h2
-rw-r--r--test/lu.cpp10
-rw-r--r--test/submatrices.cpp11
9 files changed, 23 insertions, 19 deletions
diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h
index 67684eca3..538e6dd76 100644
--- a/Eigen/src/Core/BandMatrix.h
+++ b/Eigen/src/Core/BandMatrix.h
@@ -77,7 +77,7 @@ class BandMatrix : public AnyMatrixBase<BandMatrix<_Scalar,Rows,Cols,Supers,Subs
DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic))
? 1 + Supers + Subs
: Dynamic,
- SizeAtCompileTime = EIGEN_ENUM_MIN(Rows,Cols)
+ SizeAtCompileTime = EIGEN_SIZE_MIN(Rows,Cols)
};
typedef Matrix<Scalar,DataRowsAtCompileTime,ColsAtCompileTime,Options&RowMajor?RowMajor:ColMajor> DataType;
@@ -136,6 +136,7 @@ class BandMatrix : public AnyMatrixBase<BandMatrix<_Scalar,Rows,Cols,Supers,Subs
DiagonalSize = (RowsAtCompileTime==Dynamic || ColsAtCompileTime==Dynamic)
? Dynamic
: (ActualIndex<0
+ // we handled Dynamic already, so can use EIGEN_ENUM_MIN safely here.
? EIGEN_ENUM_MIN(ColsAtCompileTime, RowsAtCompileTime + ActualIndex)
: EIGEN_ENUM_MIN(RowsAtCompileTime, ColsAtCompileTime - ActualIndex))
};
diff --git a/Eigen/src/Geometry/Umeyama.h b/Eigen/src/Geometry/Umeyama.h
index 5be098d77..c5d99d533 100644
--- a/Eigen/src/Geometry/Umeyama.h
+++ b/Eigen/src/Geometry/Umeyama.h
@@ -45,10 +45,10 @@ namespace
struct ei_umeyama_transform_matrix_type
{
enum {
- MinRowsAtCompileTime = EIGEN_ENUM_MIN(MatrixType::RowsAtCompileTime, OtherMatrixType::RowsAtCompileTime),
+ MinRowsAtCompileTime = EIGEN_SIZE_MIN(MatrixType::RowsAtCompileTime, OtherMatrixType::RowsAtCompileTime),
// When possible we want to choose some small fixed size value since the result
- // is likely to fit on the stack.
+ // is likely to fit on the stack. Here EIGEN_ENUM_MIN is really what we want.
HomogeneousDimension = EIGEN_ENUM_MIN(MinRowsAtCompileTime+1, Dynamic)
};
@@ -114,7 +114,7 @@ umeyama(const MatrixBase<Derived>& src, const MatrixBase<OtherDerived>& dst, boo
EIGEN_STATIC_ASSERT((ei_is_same_type<Scalar, typename ei_traits<OtherDerived>::Scalar>::ret),
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
- enum { Dimension = EIGEN_ENUM_MIN(Derived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime) };
+ enum { Dimension = EIGEN_SIZE_MIN(Derived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime) };
typedef Matrix<Scalar, Dimension, 1> VectorType;
typedef Matrix<Scalar, Dimension, Dimension> MatrixType;
diff --git a/Eigen/src/LU/FullPivLU.h b/Eigen/src/LU/FullPivLU.h
index 148ddcd23..fe14a9080 100644
--- a/Eigen/src/LU/FullPivLU.h
+++ b/Eigen/src/LU/FullPivLU.h
@@ -487,7 +487,7 @@ struct ei_kernel_retval<FullPivLU<_MatrixType> >
{
EIGEN_MAKE_KERNEL_HELPERS(FullPivLU<_MatrixType>)
- enum { MaxSmallDimAtCompileTime = EIGEN_ENUM_MIN(
+ enum { MaxSmallDimAtCompileTime = EIGEN_SIZE_MIN(
MatrixType::MaxColsAtCompileTime,
MatrixType::MaxRowsAtCompileTime)
};
@@ -572,7 +572,7 @@ struct ei_image_retval<FullPivLU<_MatrixType> >
{
EIGEN_MAKE_IMAGE_HELPERS(FullPivLU<_MatrixType>)
- enum { MaxSmallDimAtCompileTime = EIGEN_ENUM_MIN(
+ enum { MaxSmallDimAtCompileTime = EIGEN_SIZE_MIN(
MatrixType::MaxColsAtCompileTime,
MatrixType::MaxRowsAtCompileTime)
};
diff --git a/Eigen/src/LU/PartialPivLU.h b/Eigen/src/LU/PartialPivLU.h
index f50aa4535..809e4aad6 100644
--- a/Eigen/src/LU/PartialPivLU.h
+++ b/Eigen/src/LU/PartialPivLU.h
@@ -67,7 +67,7 @@ template<typename _MatrixType> class PartialPivLU
typedef Matrix<int, MatrixType::RowsAtCompileTime, 1> PermutationVectorType;
typedef PermutationMatrix<MatrixType::RowsAtCompileTime> PermutationType;
- enum { MaxSmallDimAtCompileTime = EIGEN_ENUM_MIN(
+ enum { MaxSmallDimAtCompileTime = EIGEN_SIZE_MIN(
MatrixType::MaxColsAtCompileTime,
MatrixType::MaxRowsAtCompileTime)
};
diff --git a/Eigen/src/QR/ColPivHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h
index a119d0c2f..63d069081 100644
--- a/Eigen/src/QR/ColPivHouseholderQR.h
+++ b/Eigen/src/QR/ColPivHouseholderQR.h
@@ -51,7 +51,7 @@ template<typename _MatrixType> class ColPivHouseholderQR
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
Options = MatrixType::Options,
- DiagSizeAtCompileTime = EIGEN_ENUM_MIN(ColsAtCompileTime,RowsAtCompileTime)
+ DiagSizeAtCompileTime = EIGEN_SIZE_MIN(ColsAtCompileTime,RowsAtCompileTime)
};
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h
index 717ff19f8..8e8dbbbf8 100644
--- a/Eigen/src/QR/FullPivHouseholderQR.h
+++ b/Eigen/src/QR/FullPivHouseholderQR.h
@@ -51,7 +51,7 @@ template<typename _MatrixType> class FullPivHouseholderQR
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
Options = MatrixType::Options,
- DiagSizeAtCompileTime = EIGEN_ENUM_MIN(ColsAtCompileTime,RowsAtCompileTime)
+ DiagSizeAtCompileTime = EIGEN_SIZE_MIN(ColsAtCompileTime,RowsAtCompileTime)
};
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
diff --git a/Eigen/src/SVD/SVD.h b/Eigen/src/SVD/SVD.h
index cd8c11b8d..1d4bbe417 100644
--- a/Eigen/src/SVD/SVD.h
+++ b/Eigen/src/SVD/SVD.h
@@ -52,7 +52,7 @@ template<typename _MatrixType> class SVD
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
PacketSize = ei_packet_traits<Scalar>::size,
AlignmentMask = int(PacketSize)-1,
- MinSize = EIGEN_ENUM_MIN(RowsAtCompileTime, ColsAtCompileTime)
+ MinSize = EIGEN_SIZE_MIN(RowsAtCompileTime, ColsAtCompileTime)
};
typedef Matrix<Scalar, RowsAtCompileTime, 1> ColVector;
diff --git a/test/lu.cpp b/test/lu.cpp
index c2237febf..45308ff82 100644
--- a/test/lu.cpp
+++ b/test/lu.cpp
@@ -35,7 +35,7 @@ template<typename MatrixType> void lu_non_invertible()
int rows, cols, cols2;
if(MatrixType::RowsAtCompileTime==Dynamic)
{
- rows = ei_random<int>(20,200);
+ rows = ei_random<int>(2,200);
}
else
{
@@ -43,8 +43,8 @@ template<typename MatrixType> void lu_non_invertible()
}
if(MatrixType::ColsAtCompileTime==Dynamic)
{
- cols = ei_random<int>(20,200);
- cols2 = ei_random<int>(20,200);
+ cols = ei_random<int>(2,200);
+ cols2 = ei_random<int>(2,200);
}
else
{
@@ -108,7 +108,7 @@ template<typename MatrixType> void lu_invertible()
LU.h
*/
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
- int size = ei_random<int>(10,200);
+ int size = ei_random<int>(1,200);
MatrixType m1(size, size), m2(size, size), m3(size, size);
m1 = MatrixType::Random(size,size);
@@ -185,5 +185,7 @@ void test_lu()
CALL_SUBTEST_6( lu_non_invertible<MatrixXcd>() );
CALL_SUBTEST_6( lu_invertible<MatrixXcd>() );
CALL_SUBTEST_6( lu_verify_assert<MatrixXcd>() );
+
+ CALL_SUBTEST_7(( lu_non_invertible<Matrix<float,Dynamic,16> >() ));
}
}
diff --git a/test/submatrices.cpp b/test/submatrices.cpp
index 9cd6f3fab..d53fd4b6f 100644
--- a/test/submatrices.cpp
+++ b/test/submatrices.cpp
@@ -60,6 +60,7 @@ template<typename MatrixType> void submatrices(const MatrixType& m)
typedef typename MatrixType::RealScalar RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
+ typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
int rows = m.rows();
int cols = m.cols();
@@ -67,11 +68,9 @@ template<typename MatrixType> void submatrices(const MatrixType& m)
m2 = MatrixType::Random(rows, cols),
m3(rows, cols),
mzero = MatrixType::Zero(rows, cols),
- ones = MatrixType::Ones(rows, cols),
- identity = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::Identity(rows, rows),
- square = Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime>
- ::Random(rows, rows);
+ ones = MatrixType::Ones(rows, cols);
+ SquareMatrixType identity = SquareMatrixType::Identity(rows, rows),
+ square = SquareMatrixType::Random(rows, rows);
VectorType v1 = VectorType::Random(rows),
v2 = VectorType::Random(rows),
v3 = VectorType::Random(rows),
@@ -222,6 +221,8 @@ void test_submatrices()
CALL_SUBTEST_5( submatrices(MatrixXcd(20, 20)) );
CALL_SUBTEST_6( submatrices(MatrixXf(20, 20)) );
+ CALL_SUBTEST_8( submatrices(Matrix<float,Dynamic,4>(3, 4)) );
+
CALL_SUBTEST_6( data_and_stride(MatrixXf(ei_random(5,50), ei_random(5,50))) );
CALL_SUBTEST_7( data_and_stride(Matrix<int,Dynamic,Dynamic,RowMajor>(ei_random(5,50), ei_random(5,50))) );
}