aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MathFunctions.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-11-25 18:00:30 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-11-25 18:00:30 +0100
commit156a31b0e91c178ddb4d422fc5f27e98d3bbd032 (patch)
tree9a20dd50e8252dfa45dbc809ec149cdcca00a581 /Eigen/src/Core/MathFunctions.h
parent010ed9510baa90433feae976ce72bcb4d19c42d9 (diff)
fully implement scalar_fuzzy_impl<bool> as, e.g., the missing isMuchSmallerThan is convenient to filter out false values.
Diffstat (limited to 'Eigen/src/Core/MathFunctions.h')
-rw-r--r--Eigen/src/Core/MathFunctions.h14
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