mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 03:39:01 +08:00
fully implement scalar_fuzzy_impl<bool> as, e.g., the missing isMuchSmallerThan is convenient to filter out false values.
This commit is contained in:
parent
010ed9510b
commit
156a31b0e9
@ -862,10 +862,24 @@ template<> struct random_impl<bool>
|
|||||||
|
|
||||||
template<> struct scalar_fuzzy_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)
|
static inline bool isApprox(bool x, bool y, bool)
|
||||||
{
|
{
|
||||||
return x == y;
|
return x == y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool isApproxOrLessThan(const bool& x, const bool& y, const bool&)
|
||||||
|
{
|
||||||
|
return (!x) || y;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user