diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-11-25 18:00:30 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-11-25 18:00:30 +0100 |
commit | 156a31b0e91c178ddb4d422fc5f27e98d3bbd032 (patch) | |
tree | 9a20dd50e8252dfa45dbc809ec149cdcca00a581 | |
parent | 010ed9510baa90433feae976ce72bcb4d19c42d9 (diff) |
fully implement scalar_fuzzy_impl<bool> as, e.g., the missing isMuchSmallerThan is convenient to filter out false values.
-rw-r--r-- | Eigen/src/Core/MathFunctions.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 990509d48..6651b6535 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -862,10 +862,24 @@ template<> struct random_impl<bool> template<> struct scalar_fuzzy_impl<bool> { + typedef bool RealScalar; + + template<typename OtherScalar> + static inline bool isMuchSmallerThan(const bool& x, const bool&, const bool&) + { + return !x; + } + static inline bool isApprox(bool x, bool y, bool) { return x == y; } + + static inline bool isApproxOrLessThan(const bool& x, const bool& y, const bool&) + { + return (!x) || y; + } + }; } // end namespace internal |