diff options
Diffstat (limited to 'test/main.h')
-rw-r--r-- | test/main.h | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/test/main.h b/test/main.h index b1410386f..4e9621543 100644 --- a/test/main.h +++ b/test/main.h @@ -135,6 +135,7 @@ namespace Eigen #define EIGEN_INTERNAL_DEBUGGING +#define EIGEN_NICE_RANDOM #include <Eigen/Core> namespace Eigen { @@ -221,26 +222,6 @@ inline bool test_ei_isMuchSmallerThan(const MatrixBase<Derived>& m, return m.isMuchSmallerThan(s, test_precision<typename ei_traits<Derived>::Scalar>()); } -template<typename T> T test_random(); - -template<> int test_random() { return ei_random<int>(-100,100); } -template<> float test_random() { return float(ei_random<int>(-1000,1000)) / 256.f; } -template<> double test_random() { return double(ei_random<int>(-1000,1000)) / 256.; } -template<> std::complex<float> test_random() -{ return std::complex<float>(test_random<float>(),test_random<float>()); } -template<> std::complex<double> test_random() -{ return std::complex<double>(test_random<double>(),test_random<double>()); } - -template<typename MatrixType> -MatrixType test_random_matrix(int rows = MatrixType::RowsAtCompileTime, int cols = MatrixType::ColsAtCompileTime) -{ - MatrixType res(rows, cols); - for (int j=0; j<cols; ++j) - for (int i=0; i<rows; ++i) - res.coeffRef(i,j) = test_random<typename MatrixType::Scalar>(); - return res; -} - } // end namespace Eigen |