aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-01-27 11:42:04 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-01-27 11:42:04 -0500
commit828d058b4b340a467da7f7bea6bb29522a6565f9 (patch)
treed1ba7df441ddc1f7365bbfad637fa0616abc8710 /test
parentdcbf104bccec39e955ab84c76bf1d96beaa31aa1 (diff)
EIGEN_ENUM_MIN ---> EIGEN_SIZE_MIN
Diffstat (limited to 'test')
-rw-r--r--test/lu.cpp10
-rw-r--r--test/submatrices.cpp11
2 files changed, 12 insertions, 9 deletions
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))) );
}