std::isfinite is non standard

This commit is contained in:
Gael Guennebaud 2012-01-23 21:49:00 +01:00
parent ee9f3e34b0
commit 0d03492e1e
2 changed files with 13 additions and 1 deletions

View File

@ -354,6 +354,7 @@ template<> struct ldlt_inplace<Lower>
template<typename MatrixType, typename WDerived>
static bool updateInPlace(MatrixType& mat, MatrixBase<WDerived>& w, typename MatrixType::RealScalar sigma=1)
{
using internal::isfinite;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
typedef typename MatrixType::Index Index;
@ -367,7 +368,7 @@ template<> struct ldlt_inplace<Lower>
for (Index j = 0; j < size; j++)
{
// Check for termination due to an original decomposition of low-rank
if (!std::isfinite(alpha))
if (!isfinite(alpha))
break;
// Update the diagonal terms

View File

@ -837,6 +837,17 @@ template<> struct scalar_fuzzy_impl<bool>
};
/****************************************************************************
* Special functions *
****************************************************************************/
// std::isfinite is non standard, so let's define our own version,
// even though it is not very efficient.
template<typename T> bool isfinite(const T& x)
{
return x<NumTraits<T>::highest() && x>NumTraits<T>::lowest();
}
} // end namespace internal
#endif // EIGEN_MATHFUNCTIONS_H