diff options
Diffstat (limited to 'Eigen/src/Core/MathFunctions.h')
-rw-r--r-- | Eigen/src/Core/MathFunctions.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 2cf28e8a7..c4b021baa 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -144,6 +144,10 @@ inline bool isMuchSmallerThan(const std::complex<float>& a, const std::complex<f { return abs2(a) <= abs2(b) * prec * prec; } +inline bool isMuchSmallerThan(const std::complex<float>& a, float b, float prec = precision<float>()) +{ + return abs2(a) <= abs2(b) * prec * prec; +} inline bool isApprox(const std::complex<float>& a, const std::complex<float>& b, float prec = precision<float>()) { return isApprox(std::real(a), std::real(b), prec) @@ -165,6 +169,10 @@ inline bool isMuchSmallerThan(const std::complex<double>& a, const std::complex< { return abs2(a) <= abs2(b) * prec * prec; } +inline bool isMuchSmallerThan(const std::complex<double>& a, double b, double prec = precision<double>()) +{ + return abs2(a) <= abs2(b) * prec * prec; +} inline bool isApprox(const std::complex<double>& a, const std::complex<double>& b, double prec = precision<double>()) { return isApprox(std::real(a), std::real(b), prec) |