mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +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
|
} // end namespace internal
|
||||||
|
|
||||||
/** \fn DenseBase<Derived>::minCoeff(IndexType* rowId, IndexType* colId) const
|
/** \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>
|
template <typename Derived>
|
||||||
EIGEN_DEVICE_FUNC inline bool DenseBase<Derived>::allFinite() const {
|
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
|
} // end namespace Eigen
|
||||||
|
Loading…
x
Reference in New Issue
Block a user