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:
@@ -38,7 +38,7 @@ template<typename MatrixType> void inverse(const MatrixType& m)
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> VectorType;
|
||||
|
||||
MatrixType m1 = test_random_matrix<MatrixType>(rows, cols),
|
||||
MatrixType m1 = MatrixType::Random(rows, cols),
|
||||
m2(rows, cols),
|
||||
mzero = MatrixType::Zero(rows, cols),
|
||||
identity = MatrixType::Identity(rows, rows);
|
||||
@@ -46,7 +46,7 @@ template<typename MatrixType> void inverse(const MatrixType& m)
|
||||
if (ei_is_same_type<RealScalar,float>::ret)
|
||||
{
|
||||
// let's build a more stable to inverse matrix
|
||||
MatrixType a = test_random_matrix<MatrixType>(rows,cols);
|
||||
MatrixType a = MatrixType::Random(rows,cols);
|
||||
m1 += m1 * m1.adjoint() + a * a.adjoint();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user