mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user