mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-19 16:19:37 +08:00
fix allFinite
This commit is contained in:
parent
3143968195
commit
ac2165c11f
@ -632,6 +632,17 @@ struct functor_traits<count_visitor<Scalar>> {
|
||||
};
|
||||
};
|
||||
|
||||
template <typename Derived, bool AlwaysTrue = NumTraits<typename traits<Derived>::Scalar>::IsInteger>
|
||||
struct all_finite_impl {
|
||||
static EIGEN_DEVICE_FUNC inline bool run(const Derived& /*derived*/) { return true; }
|
||||
};
|
||||
#if !defined(__FINITE_MATH_ONLY__) || !(__FINITE_MATH_ONLY__)
|
||||
template <typename Derived>
|
||||
struct all_finite_impl<Derived, false> {
|
||||
static EIGEN_DEVICE_FUNC inline bool run(const Derived& derived) { return derived.array().isFiniteTyped().all(); }
|
||||
};
|
||||
#endif
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
/** \fn DenseBase<Derived>::minCoeff(IndexType* rowId, IndexType* colId) const
|
||||
@ -781,7 +792,7 @@ EIGEN_DEVICE_FUNC inline bool DenseBase<Derived>::hasNaN() const {
|
||||
*/
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline bool DenseBase<Derived>::allFinite() const {
|
||||
return derived().array().isFiniteTyped().all();
|
||||
return internal::all_finite_impl<Derived>::run(derived());
|
||||
}
|
||||
|
||||
} // end namespace Eigen
|
||||
|
Loading…
x
Reference in New Issue
Block a user