Rework the unit-tests to use lower precision, so as to eliminate

false positives. Also some cleanup in the fuzzy compares.
This commit is contained in:
Benoit Jacob
2007-12-03 10:23:08 +00:00
parent 5abaaf9688
commit 346c00f4c8
6 changed files with 143 additions and 92 deletions

View File

@@ -50,18 +50,18 @@ bool MatrixBase<Scalar, Derived>::isApprox(
template<typename Scalar, typename Derived>
bool MatrixBase<Scalar, Derived>::isMuchSmallerThan(
const Scalar& other,
const typename NumTraits<Scalar>::Real& other,
const typename NumTraits<Scalar>::Real& prec
) const
{
if(IsVector)
{
return(norm2() <= abs2(other) * prec * prec);
return(norm2() <= abs2(other * prec));
}
else
{
for(int i = 0; i < cols(); i++)
if(col(i).norm2() > abs2(other) * prec * prec)
if(col(i).norm2() > abs2(other * prec))
return false;
return true;
}