Commit b21bd2d6 authored by Emmanuel Christophe's avatar Emmanuel Christophe

STYLE: using vcl_abs instead of vcl_fabs

parent 7e9f0220
......@@ -49,7 +49,7 @@ FlexibleDistanceWithMissingValue< TVector >
{
if ( !IsMissingValue( x1[i] ) && !IsMissingValue( x2[i] ) )
{
temp = vcl_pow( vcl_fabs( vcl_pow(x1[i],this->Alpha) - vcl_pow(x2[i],this->Alpha) ), this->Beta );
temp = vcl_pow( vcl_abs( vcl_pow(x1[i],this->Alpha) - vcl_pow(x2[i],this->Alpha) ), this->Beta );
distance += temp ;
}
}
......@@ -82,7 +82,7 @@ FlexibleDistanceWithMissingValue< TVector >
{
if ( !IsMissingValue( this->GetOrigin()[i] ) && !IsMissingValue( x[i] ) )
{
temp = vcl_pow( vcl_fabs( vcl_pow(this->GetOrigin()[i],this->Alpha) - vcl_pow(x[i],this->Alpha) ), this->Beta) ;
temp = vcl_pow( vcl_abs( vcl_pow(this->GetOrigin()[i],this->Alpha) - vcl_pow(x[i],this->Alpha) ), this->Beta) ;
distance += temp ;
}
}
......@@ -102,7 +102,7 @@ FlexibleDistanceWithMissingValue< TVector >
if ( IsMissingValue( a ) || IsMissingValue( b ) )
return 0.0;
double temp = vcl_pow(vcl_fabs(vcl_pow(a,this->Alpha) - vcl_pow(b,this->Alpha)), this->Beta) ;
double temp = vcl_pow(vcl_abs(vcl_pow(a,this->Alpha) - vcl_pow(b,this->Alpha)), this->Beta) ;
return temp ;
}
......
......@@ -209,8 +209,8 @@ RegionImageToRectangularPathListFilter<TInputImage,TOutputPath>
double ax, ay;
for (regionIterator = regionContainer.begin(); regionIterator != regionContainer.end(); ++regionIterator) {
explorerIndex = *regionIterator;
ax = vcl_fabs(explorerIndex[0] - avgX);
ay = vcl_fabs(explorerIndex[1] - avgY);
ax = vcl_abs(explorerIndex[0] - avgX);
ay = vcl_abs(explorerIndex[1] - avgY);
sumAX += ax;
sumAY += ay;
crossTermAXY += ax * ay;
......@@ -266,10 +266,10 @@ RegionImageToRectangularPathListFilter<TInputImage,TOutputPath>
// Compute equivalent length and width (based on equal area criterion)
double length, width;
if (al2 != 0) {
length = vcl_sqrt(vcl_fabs(al1 / al2) * n);
length = vcl_sqrt(vcl_abs(al1 / al2) * n);
//length = vcl_sqrt(l1 / l2 * n);
if (al1 != 0)
width = vcl_fabs(al2 / al1) * length;
width = vcl_abs(al2 / al1) * length;
else { // l1 == 0 and l2 == 0
length = width = vcl_sqrt(static_cast<double>(n)); // should happen only when n == 1 anyway
}
......@@ -316,8 +316,8 @@ RegionImageToRectangularPathListFilter<TInputImage,TOutputPath>
explorerIndex = *regionIterator;
vx = explorerIndex[0] - avgX;
vy = explorerIndex[1] - avgY;
if (vcl_fabs(vx * x1 + vy * y1) <= halfLength
&& vcl_fabs(vx * x2 + vy * y2) <= halfWidth)
if (vcl_abs(vx * x1 + vy * y1) <= halfLength
&& vcl_abs(vx * x2 + vy * y2) <= halfWidth)
countWithin ++;
}
......
......@@ -150,7 +150,7 @@ AeronetFileReader
ossimLocalTm current_date = ParseDate(line[col_date], line[col_time]);
double dcurrent_date = current_date.getJulian();
// Check hour +/- epsilon
if(vcl_fabs(dcurrent_date-ref_date) < epsilon)
if(vcl_abs(dcurrent_date-ref_date) < epsilon)
{
double dwater = atof(line[col_vapor].c_str());
double dangst = atof(line[col_angst].c_str());
......
......@@ -47,7 +47,7 @@ int otbFlexibleDistanceWithMissingValue( int argc, char * argv[] )
double distanceValue = dist->Evaluate( x, y );
std::cout << "Distance: " << distanceValue << std::endl;
if ( vcl_fabs(distanceValue - dim*vcl_pow(3,b)) < epsilon )
if ( vcl_abs(distanceValue - dim*vcl_pow(3,b)) < epsilon )
return EXIT_SUCCESS;
else
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