fully implement scalar_fuzzy_impl<bool> as, e.g., the missing isMuchSmallerThan is convenient to filter out false values.

This commit is contained in:
Gael Guennebaud 2010-11-25 18:00:30 +01:00
parent 010ed9510b
commit 156a31b0e9

View File

@ -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