Fix stable_norm unit test for complexes

This commit is contained in:
Gael Guennebaud 2014-02-13 15:49:54 +01:00
parent 3291580630
commit 0715d49908

View File

@ -57,12 +57,12 @@ template<typename MatrixType> void stable_norm(const MatrixType& m)
// get a non-zero random factor
Scalar factor = internal::random<Scalar>();
while(factor<RealScalar(1e-3))
while(numext::abs2(factor)<RealScalar(1e-4))
factor = internal::random<Scalar>();
Scalar big = factor * ((std::numeric_limits<RealScalar>::max)() * RealScalar(1e-4));
factor = internal::random<Scalar>();
while(factor<RealScalar(1e-3))
while(numext::abs2(factor)<RealScalar(1e-4))
factor = internal::random<Scalar>();
Scalar small = factor * ((std::numeric_limits<RealScalar>::min)() * RealScalar(1e4));