From b21bd2d6bf5327b32f69b1f3dedab99f4a060272 Mon Sep 17 00:00:00 2001 From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org> Date: Thu, 27 Aug 2009 15:04:42 +0800 Subject: [PATCH] STYLE: using vcl_abs instead of vcl_fabs --- .../otbFlexibleDistanceWithMissingValue.txx | 6 +++--- .../otbRegionImageToRectangularPathListFilter.txx | 12 ++++++------ Code/Radiometry/otbAeronetFileReader.cxx | 2 +- .../otbFlexibleDistanceWithMissingValue.cxx | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.txx b/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.txx index 3ed9e6bc15..73ca172d7d 100644 --- a/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.txx +++ b/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.txx @@ -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 ; } diff --git a/Code/FeatureExtraction/otbRegionImageToRectangularPathListFilter.txx b/Code/FeatureExtraction/otbRegionImageToRectangularPathListFilter.txx index b45e404f6e..511fbb8f41 100644 --- a/Code/FeatureExtraction/otbRegionImageToRectangularPathListFilter.txx +++ b/Code/FeatureExtraction/otbRegionImageToRectangularPathListFilter.txx @@ -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 ++; } diff --git a/Code/Radiometry/otbAeronetFileReader.cxx b/Code/Radiometry/otbAeronetFileReader.cxx index 1003c36fb0..849abf7388 100755 --- a/Code/Radiometry/otbAeronetFileReader.cxx +++ b/Code/Radiometry/otbAeronetFileReader.cxx @@ -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()); diff --git a/Testing/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.cxx b/Testing/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.cxx index a4c91a276b..512c4ebe0b 100644 --- a/Testing/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.cxx +++ b/Testing/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.cxx @@ -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; -- GitLab