diff options
author | 2008-09-01 17:31:21 +0000 | |
---|---|---|
committer | 2008-09-01 17:31:21 +0000 | |
commit | 46fe7a3d9ec14ea56a879c48ba7f15e78342c8cb (patch) | |
tree | c708710574525c93c9732d23e7e935863434b9ac /test/svd.cpp | |
parent | 49ff9b204c8ddd448fe214fdaf8622c4fe97c795 (diff) |
if EIGEN_NICE_RANDOM is defined, the random functions will return numbers with
few bits left of the comma and for floating-point types will never return zero.
This replaces the custom functions in test/main.h, so one does not anymore need
to think about that when writing tests.
Diffstat (limited to 'test/svd.cpp')
-rw-r--r-- | test/svd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/svd.cpp b/test/svd.cpp index 605c7f7aa..4776ef7e7 100644 --- a/test/svd.cpp +++ b/test/svd.cpp @@ -35,9 +35,9 @@ template<typename MatrixType> void svd(const MatrixType& m) typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits<Scalar>::Real RealScalar; - MatrixType a = test_random_matrix<MatrixType>(rows,cols); + MatrixType a = MatrixType::Random(rows,cols); Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> b = - test_random_matrix<Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> >(rows,1); + Matrix<Scalar, MatrixType::RowsAtCompileTime, 1>::Random(rows,1); Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> x(cols,1), x2(cols,1); RealScalar largerEps = test_precision<RealScalar>(); @@ -56,7 +56,7 @@ template<typename MatrixType> void svd(const MatrixType& m) { if (ei_is_same_type<RealScalar,float>::ret) { - MatrixType a1 = test_random_matrix<MatrixType>(rows,cols); + MatrixType a1 = MatrixType::Random(rows,cols); a += a * a.adjoint() + a1 * a1.adjoint(); } SVD<MatrixType> svd(a); |