Skip to content
Snippets Groups Projects
Commit 3e7face9 authored by Thomas Feuvrier's avatar Thomas Feuvrier
Browse files

Modif fonction MissingValue avec vnl_numeric_limit::quiet_NaN et vcl_numeric_isnan

parent db1dff55
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@
#ifndef __otbEuclideanDistanceWithMissingValue_h
#define __otbEuclideanDistanceWithMissingValue_h
#include <itkEuclideanDistance.h>
#include "itkEuclideanDistance.h"
namespace otb {
......
......@@ -22,6 +22,7 @@
#define __otbEuclideanDistanceWithMissingValue_txx
#include "itkNumericTraits.h"
#include "vnl/vnl_math.h"
namespace otb {
......@@ -93,50 +94,20 @@ EuclideanDistanceWithMissingValue< TVector >
return ::vcl_sqrt(temp * temp) ;
}
#if defined(_MSC_VER) /* Microsoft Visual C++ */
#include <float.h>
template< class TVector >
/*static */
bool
EuclideanDistanceWithMissingValue< TVector >
::IsMissingValue ( const ValueType & v)
{
return static_cast<bool>( _isnan( static_cast<double>( v ) ) );
}
#elif HAVE_IEEE_COMPARISONS
template< class TVector >
/*static */
bool
EuclideanDistanceWithMissingValue< TVector >
::IsMissingValue ( const ValueType & v)
{
return (v!=v);
return vnl_math_isnan(v);
}
#else
template< class TVector >
/*static */
bool
EuclideanDistanceWithMissingValue< TVector >
::IsMissingValue ( const ValueType & v)
{
return static_cast<bool>( isnan(v) );
}
#endif
template< class TVector >
/* static */
void
EuclideanDistanceWithMissingValue< TVector >
::SetToMissingValue ( ValueType & v )
{
//v = static_cast<ValueType>( 0.0/0.0 );
v = std::numeric_limits<ValueType>::quiet_NaN();
v = vcl_numeric_limits<ValueType>::quiet_NaN();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment