mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-12 14:25:16 +08:00
Previous isFinite->hasNonFinite change was broken. After discussion let's rename it to allFinite
(transplanted from 4f0bd557a4
)
This commit is contained in:
parent
9df04bcede
commit
e788869cf5
@ -131,7 +131,7 @@ inline typename DenseBase<Derived>::Index DenseBase<Derived>::count() const
|
||||
|
||||
/** \returns true is \c *this contains at least one Not A Number (NaN).
|
||||
*
|
||||
* \sa hasNonFinite()
|
||||
* \sa allFinite()
|
||||
*/
|
||||
template<typename Derived>
|
||||
inline bool DenseBase<Derived>::hasNaN() const
|
||||
@ -144,7 +144,7 @@ inline bool DenseBase<Derived>::hasNaN() const
|
||||
* \sa hasNaN()
|
||||
*/
|
||||
template<typename Derived>
|
||||
inline bool DenseBase<Derived>::hasNonFinite() const
|
||||
inline bool DenseBase<Derived>::allFinite() const
|
||||
{
|
||||
return !((derived()-derived()).hasNaN());
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ template<typename Derived> class DenseBase
|
||||
bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||
|
||||
inline bool hasNaN() const;
|
||||
inline bool hasNonFinite() const;
|
||||
inline bool allFinite() const;
|
||||
|
||||
inline Derived& operator*=(const Scalar& other);
|
||||
inline Derived& operator/=(const Scalar& other);
|
||||
|
@ -33,7 +33,7 @@ template<typename Scalar> void special_numbers()
|
||||
mboth = mnan + minf;
|
||||
|
||||
VERIFY(!m1.hasNaN());
|
||||
VERIFY(m1.hasNonFinite());
|
||||
VERIFY(m1.allFinite());
|
||||
|
||||
VERIFY(mnan.hasNaN());
|
||||
VERIFY((s1*mnan).hasNaN());
|
||||
@ -42,11 +42,11 @@ template<typename Scalar> void special_numbers()
|
||||
VERIFY(mboth.hasNaN());
|
||||
VERIFY(mboth.array().hasNaN());
|
||||
|
||||
VERIFY(!mnan.hasNonFinite());
|
||||
VERIFY(!minf.hasNonFinite());
|
||||
VERIFY(!(minf-mboth).hasNonFinite());
|
||||
VERIFY(!mboth.hasNonFinite());
|
||||
VERIFY(!mboth.array().hasNonFinite());
|
||||
VERIFY(!mnan.allFinite());
|
||||
VERIFY(!minf.allFinite());
|
||||
VERIFY(!(minf-mboth).allFinite());
|
||||
VERIFY(!mboth.allFinite());
|
||||
VERIFY(!mboth.array().allFinite());
|
||||
}
|
||||
|
||||
void test_special_numbers()
|
||||
|
Loading…
Reference in New Issue
Block a user