aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/array.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-09-01 17:31:21 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-09-01 17:31:21 +0000
commit46fe7a3d9ec14ea56a879c48ba7f15e78342c8cb (patch)
treec708710574525c93c9732d23e7e935863434b9ac /test/array.cpp
parent49ff9b204c8ddd448fe214fdaf8622c4fe97c795 (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/array.cpp')
-rw-r--r--test/array.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/array.cpp b/test/array.cpp
index 25387d0cd..f0b09051f 100644
--- a/test/array.cpp
+++ b/test/array.cpp
@@ -38,12 +38,12 @@ template<typename MatrixType> void scalarAdd(const MatrixType& m)
int rows = m.rows();
int cols = m.cols();
- MatrixType m1 = test_random_matrix<MatrixType>(rows, cols),
- m2 = test_random_matrix<MatrixType>(rows, cols),
+ MatrixType m1 = MatrixType::Random(rows, cols),
+ m2 = MatrixType::Random(rows, cols),
m3(rows, cols);
- Scalar s1 = test_random<Scalar>(),
- s2 = test_random<Scalar>();
+ Scalar s1 = ei_random<Scalar>(),
+ s2 = ei_random<Scalar>();
VERIFY_IS_APPROX(m1.cwise() + s1, s1 + m1.cwise());
VERIFY_IS_APPROX(m1.cwise() + s1, MatrixType::Constant(rows,cols,s1) + m1);