Commit 3171ab14 authored by Emmanuel Christophe's avatar Emmanuel Christophe

BUG: add vcl_fabs to FlexibleDistanceWithMissingValue test

parent 26c80fcd
...@@ -49,7 +49,7 @@ FlexibleDistanceWithMissingValue< TVector > ...@@ -49,7 +49,7 @@ FlexibleDistanceWithMissingValue< TVector >
{ {
if ( !IsMissingValue( x1[i] ) && !IsMissingValue( x2[i] ) ) if ( !IsMissingValue( x1[i] ) && !IsMissingValue( x2[i] ) )
{ {
temp = vcl_pow( vcl_abs( vcl_pow(x1[i],this->Alpha) - vcl_pow(x2[i],this->Alpha) ), this->Beta ); temp = vcl_pow( vcl_fabs( vcl_pow(x1[i],this->Alpha) - vcl_pow(x2[i],this->Alpha) ), this->Beta );
distance += temp ; distance += temp ;
} }
} }
...@@ -82,7 +82,7 @@ FlexibleDistanceWithMissingValue< TVector > ...@@ -82,7 +82,7 @@ FlexibleDistanceWithMissingValue< TVector >
{ {
if ( !IsMissingValue( this->GetOrigin()[i] ) && !IsMissingValue( x[i] ) ) if ( !IsMissingValue( this->GetOrigin()[i] ) && !IsMissingValue( x[i] ) )
{ {
temp = vcl_pow( vcl_abs( vcl_pow(this->GetOrigin()[i],this->Alpha) - vcl_pow(x[i],this->Alpha) ), this->Beta) ; temp = vcl_pow( vcl_fabs( vcl_pow(this->GetOrigin()[i],this->Alpha) - vcl_pow(x[i],this->Alpha) ), this->Beta) ;
distance += temp ; distance += temp ;
} }
} }
...@@ -102,7 +102,7 @@ FlexibleDistanceWithMissingValue< TVector > ...@@ -102,7 +102,7 @@ FlexibleDistanceWithMissingValue< TVector >
if ( IsMissingValue( a ) || IsMissingValue( b ) ) if ( IsMissingValue( a ) || IsMissingValue( b ) )
return 0.0; return 0.0;
double temp = vcl_pow(vcl_abs(vcl_pow(a,this->Alpha) - vcl_pow(b,this->Alpha)), this->Beta) ; double temp = vcl_pow(vcl_fabs(vcl_pow(a,this->Alpha) - vcl_pow(b,this->Alpha)), this->Beta) ;
return temp ; return temp ;
} }
......
...@@ -47,7 +47,7 @@ int otbFlexibleDistanceWithMissingValue( int argc, char * argv[] ) ...@@ -47,7 +47,7 @@ int otbFlexibleDistanceWithMissingValue( int argc, char * argv[] )
double distanceValue = dist->Evaluate( x, y ); double distanceValue = dist->Evaluate( x, y );
std::cout << "Distance: " << distanceValue << std::endl; std::cout << "Distance: " << distanceValue << std::endl;
if ( (distanceValue - dim*vcl_pow(3,b)) < epsilon ) if ( vcl_fabs(distanceValue - dim*vcl_pow(3,b)) < epsilon )
return EXIT_SUCCESS; return EXIT_SUCCESS;
else else
return EXIT_FAILURE; return EXIT_FAILURE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment