diff --git a/Examples/BasicFilters/HillShadingExample.cxx b/Examples/BasicFilters/HillShadingExample.cxx index a266d955e12295ff3fb84b3e7e755833aa8be43a..bff3f7d22aece97420397c13f32c82e66ac04796 100644 --- a/Examples/BasicFilters/HillShadingExample.cxx +++ b/Examples/BasicFilters/HillShadingExample.cxx @@ -124,9 +124,9 @@ int main(int argc, char * argv[]) double lat1 = origin[1]; double lat2 = origin[1] + size[1] * spacing[1]; double R = 6371; // km - double d = vcl_acos(vcl_sin(lat1) * vcl_sin(lat2) + - vcl_cos(lat1) * vcl_cos(lat2) * vcl_cos(lon2 - lon1)) * R; - res = d / vcl_sqrt(2.0); + double d = std::acos(std::sin(lat1) * std::sin(lat2) + + std::cos(lat1) * std::cos(lat2) * std::cos(lon2 - lon1)) * R; + res = d / std::sqrt(2.0); } // Software Guide : BeginLatex // diff --git a/Examples/FeatureExtraction/SURFExample.cxx b/Examples/FeatureExtraction/SURFExample.cxx index f9432cdad32919ff75f2fa64eaee1bfd294c37e2..283bc6ff4aa65eaf82f436e823f3d998458fa316 100644 --- a/Examples/FeatureExtraction/SURFExample.cxx +++ b/Examples/FeatureExtraction/SURFExample.cxx @@ -264,13 +264,13 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet ImageType::IndexType index; - index[0] = static_cast<unsigned int>(vcl_floor( + index[0] = static_cast<unsigned int>(std::floor( static_cast<double>( (pIt.Value()[0] - origin[0]) / spacing[0] + 0.5 ))); - index[1] = static_cast<unsigned int>(vcl_floor( + index[1] = static_cast<unsigned int>(std::floor( static_cast<double>( (pIt.Value()[1] - origin[1]) / spacing[1] + 0.5 diff --git a/Examples/IO/DEMHandlerExample.cxx b/Examples/IO/DEMHandlerExample.cxx index 985f550ec8082cc60472bba6d75df12fc08b8d4d..cf7a912cd862705d7460104f3a50bfc9616fac22 100644 --- a/Examples/IO/DEMHandlerExample.cxx +++ b/Examples/IO/DEMHandlerExample.cxx @@ -150,7 +150,7 @@ if(argc!=8) fail = true; } - double error = vcl_abs(height-target); + double error = std::abs(height-target); if(error>tolerance) { diff --git a/Examples/Patented/SIFTExample.cxx b/Examples/Patented/SIFTExample.cxx index a7cf97e230de8d4e99326c82233eeac5dea3022d..746b8502fa860a4b23d2c449ada66f8da9e330d7 100644 --- a/Examples/Patented/SIFTExample.cxx +++ b/Examples/Patented/SIFTExample.cxx @@ -244,11 +244,11 @@ int main(int argc, char * argv[]) ImageType::IndexType index; index[0] = (unsigned int) - (vcl_floor + (std::floor ((double) ((pIt.Value()[0] - origin[0]) / spacing[0] + 0.5))); index[1] = (unsigned int) - (vcl_floor + (std::floor ((double) ((pIt.Value()[1] - origin[1]) / spacing[1] + 0.5))); OutputImageType::PixelType keyPixel; diff --git a/Examples/Patented/SIFTFastExample.cxx b/Examples/Patented/SIFTFastExample.cxx index 22b3b43a60c21b33779b0e1024bdaae1c4cddf90..49529ed41c65ddeeacdd94ae049de4dcd24ab3ba 100644 --- a/Examples/Patented/SIFTFastExample.cxx +++ b/Examples/Patented/SIFTFastExample.cxx @@ -265,13 +265,13 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet ImageType::IndexType index; - index[0] = static_cast<unsigned int>(vcl_floor( + index[0] = static_cast<unsigned int>(std::floor( static_cast<double>( (pIt.Value()[0] - origin[0]) / spacing[0] + 0.5 ))); - index[1] = static_cast<unsigned int>(vcl_floor( + index[1] = static_cast<unsigned int>(std::floor( static_cast<double>( (pIt.Value()[1] - origin[1]) / spacing[1] + 0.5 diff --git a/Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx b/Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx index ccc0a28f5e1030d1fcbbe703eb948135aa4558af..3530510d38d43b24cbbdc681977765a413b4a443 100644 --- a/Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx +++ b/Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx @@ -105,7 +105,7 @@ int otbDEMHandlerTest(int argc, char * argv[]) fail = true; } - double error = vcl_abs(height-target); + double error = std::abs(height-target); if(error>tolerance) { diff --git a/Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx b/Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx index 055bc703e8364b49ad88a4de736008466d210833..def5b6b1fb47da5ac6dab9e58a14fb457e6d9e7c 100644 --- a/Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx +++ b/Modules/Applications/AppClassification/app/otbComputeImagesStatistics.cxx @@ -210,7 +210,7 @@ private: stddev.Fill(itk::NumericTraits<MeasurementType::ValueType>::Zero); for (unsigned int i = 0; i < totalVariancePerBand.GetSize(); ++i) { - stddev[i] = vcl_sqrt(totalVariancePerBand[i]); + stddev[i] = std::sqrt(totalVariancePerBand[i]); } if( HasValue( "out" ) ) diff --git a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx index 60a49e14782f8bfb40d6a20bcf2f9adfbaa0b139..1b1c7c98850cd9e45a5321038ffd9ba3fd71684a 100644 --- a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx +++ b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx @@ -317,7 +317,7 @@ private: for (unsigned int i = 0; i < descList.size(); ++i) { double mean = accFirstOrderPS[i] / accNbElemPS; - double stddev = vcl_sqrt(accSecondOrderPS[i] / accNbElemPS - mean * mean); + double stddev = std::sqrt(accSecondOrderPS[i] / accNbElemPS - mean * mean); otbAppLogINFO( << descList[i] << " : " << mean << " +/- " << stddev << " (min: " << minPS[i] << " max: " << maxPS[i] << ")"<< std::endl); } @@ -325,7 +325,7 @@ private: for (unsigned int i = 0; i < descList.size(); ++i) { double mean = accFirstOrderNS[i] / accNbElemNS; - double stddev = vcl_sqrt(accSecondOrderNS[i] / accNbElemNS - mean * mean); + double stddev = std::sqrt(accSecondOrderNS[i] / accNbElemNS - mean * mean); otbAppLogINFO(<< descList[i] << " : " << mean << " +/- " << stddev << " (min: " << minNS[i] << " max: " << maxNS[i] << ")"<< std::endl); } diff --git a/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx b/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx index 38df1e80ef6ca1bef91fca033f8c8903f505a197..9921a1eb4921a12fc6cb7e513cf35adaa97dbd27 100644 --- a/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx +++ b/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx @@ -277,9 +277,9 @@ private: if(GetParameterInt("mfilter")) { pprime1 = rsTransform->TransformPoint(point1); - error = vcl_sqrt((point2[0]-pprime1[0])*(point2[0]-pprime1[0])+(point2[1]-pprime1[1])*(point2[1]-pprime1[1])); + error = std::sqrt((point2[0]-pprime1[0])*(point2[0]-pprime1[0])+(point2[1]-pprime1[1])*(point2[1]-pprime1[1])); - if(error>GetParameterFloat("precision")*vcl_sqrt(vcl_abs(im2->GetSignedSpacing()[0]*im2->GetSignedSpacing()[1]))) + if(error>GetParameterFloat("precision")*std::sqrt(std::abs(im2->GetSignedSpacing()[0]*im2->GetSignedSpacing()[1]))) { filtered = true; } @@ -397,8 +397,8 @@ private: bin_step_y = GetParameterInt("mode.geobins.binstepy"); } - unsigned int nb_bins_x = static_cast<unsigned int>(vcl_ceil(static_cast<float>(size[0]-2*image_border_margin)/(bin_size_x + bin_step_x))); - unsigned int nb_bins_y = static_cast<unsigned int>(vcl_ceil(static_cast<float>(size[1]-2*image_border_margin)/(bin_size_y + bin_step_y))); + unsigned int nb_bins_x = static_cast<unsigned int>(std::ceil(static_cast<float>(size[0]-2*image_border_margin)/(bin_size_x + bin_step_x))); + unsigned int nb_bins_y = static_cast<unsigned int>(std::ceil(static_cast<float>(size[1]-2*image_border_margin)/(bin_size_y + bin_step_y))); for(unsigned int i = 0; i<nb_bins_x; ++i) { @@ -470,11 +470,11 @@ private: FloatImageType::IndexType index2; FloatImageType::SizeType size2; - index2[0] = vcl_floor(i_min[0]); - index2[1] = vcl_floor(i_min[1]); + index2[0] = std::floor(i_min[0]); + index2[1] = std::floor(i_min[1]); - size2[0] = vcl_ceil(i_max[0]-i_min[0]); - size2[1] = vcl_ceil(i_max[1]-i_min[1]); + size2[0] = std::ceil(i_max[0]-i_min[0]); + size2[1] = std::ceil(i_max[1]-i_min[1]); FloatImageType::RegionType region2; region2.SetIndex(index2); diff --git a/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx b/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx index 929633021b58cc5e5cd3b4cb5639554ab5e586a6..f8c93a0d5e8b4e9b104deabd1161a8f6a1fb6056 100644 --- a/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx +++ b/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx @@ -524,8 +524,8 @@ private: const double actualNBSamplesForKMeans = std::min(theoricNBSamplesForKMeans, upperThresholdNBSamplesForKMeans); - const double shrinkFactor = vcl_floor( - vcl_sqrt( + const double shrinkFactor = std::floor( + std::sqrt( supportImage->GetLargestPossibleRegion().GetNumberOfPixels() / actualNBSamplesForKMeans)); imageSampler->SetShrinkFactor(shrinkFactor); @@ -653,7 +653,7 @@ private: // Convert the radiometric value to [0, 255] // using the clamping from histogram cut // Since an UInt8 output value is expected, the rounding instruction is used (floor(x+0.5) as rounding method) - double val = vcl_floor((255 * (meanValue[dispIndex] - minVal[dispIndex]) + double val = std::floor((255 * (meanValue[dispIndex] - minVal[dispIndex]) / (maxVal[dispIndex] - minVal[dispIndex])) + 0.5); val = val < 0.0 ? 0.0 : ( val > 255.0 ? 255.0 : val ); diff --git a/Modules/Applications/AppImageUtils/app/otbConvert.cxx b/Modules/Applications/AppImageUtils/app/otbConvert.cxx index 9b5ad12d6eb5c4cf46d84ac82c9ed8c41b9e7804..41619d099161c66c556202025d93dc2403cf5898 100644 --- a/Modules/Applications/AppImageUtils/app/otbConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbConvert.cxx @@ -49,7 +49,7 @@ public: ~LogFunctor(){}; TScalar operator() (const TScalar& v) const { - return vcl_log(v); + return std::log(v); } }; } // end namespace Functor diff --git a/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx b/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx index 0393e5376b13199c521906ecf294d72c816621b8..f31c1af73406c3eb217f8bced240d43e97dc2dbc 100644 --- a/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx +++ b/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx @@ -98,9 +98,9 @@ private: { std::ostringstream oss; oss << (id.Lat < 0 ? 'S' : 'N'); - oss << std::setfill('0') << std::setw(2) << vcl_abs(id.Lat); + oss << std::setfill('0') << std::setw(2) << std::abs(id.Lat); oss << (id.Lon < 0 ? 'W' : 'E'); - oss << std::setfill('0') << std::setw(3) << vcl_abs(id.Lon); + oss << std::setfill('0') << std::setw(3) << std::abs(id.Lon); return oss.str(); } diff --git a/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx b/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx index f2ab23506510cabfb960063da0dd8a0b2cf0ba8e..efc2709cdf05410f09263b51da148c6b9ff5bdf2 100644 --- a/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx +++ b/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx @@ -234,13 +234,13 @@ private: meany/=tiepoints.size(); - double stdevx = vcl_sqrt(rmsex - meanx * meanx); - double stdevy = vcl_sqrt(rmsey - meany * meany); + double stdevx = std::sqrt(rmsex - meanx * meanx); + double stdevy = std::sqrt(rmsey - meany * meany); - rmse=vcl_sqrt(rmse); - rmsex=vcl_sqrt(rmsex); - rmsey=vcl_sqrt(rmsey); + rmse=std::sqrt(rmse); + rmsex=std::sqrt(rmsex); + rmsey=std::sqrt(rmsey); otbAppLogINFO("Estimation of final accuracy: "); diff --git a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx index c227cd117dfea51a42a6f6227384bd21049ceee0..1d42d243f56044b5d9da1bcc356c978282dcfeff 100644 --- a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx +++ b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx @@ -485,10 +485,10 @@ private: spacing[1] = GetParameterFloat("outputs.spacingy"); // Set the processed size relative to this forced spacing - if (vcl_abs(spacing[0]) > 0.0) - SetParameterInt("outputs.sizex",static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lrx")-GetParameterFloat("outputs.ulx"))/spacing[0]))); - if (vcl_abs(spacing[1]) > 0.0) - SetParameterInt("outputs.sizey",static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lry")-GetParameterFloat("outputs.uly"))/spacing[1]))); + if (std::abs(spacing[0]) > 0.0) + SetParameterInt("outputs.sizex",static_cast<int>(std::ceil((GetParameterFloat("outputs.lrx")-GetParameterFloat("outputs.ulx"))/spacing[0]))); + if (std::abs(spacing[1]) > 0.0) + SetParameterInt("outputs.sizey",static_cast<int>(std::ceil((GetParameterFloat("outputs.lry")-GetParameterFloat("outputs.uly"))/spacing[1]))); } break; case Mode_OrthoFit: @@ -586,7 +586,7 @@ private: << ygridspacing << " degrees" ); // Use the smallest spacing (more precise grid) - double optimalSpacing = std::min( vcl_abs(xgridspacing), vcl_abs(ygridspacing) ); + double optimalSpacing = std::min( std::abs(xgridspacing), std::abs(ygridspacing) ); otbAppLogINFO( "Setting grid spacing to " << optimalSpacing ); SetParameterFloat("opt.gridspacing",optimalSpacing); } @@ -699,9 +699,9 @@ private: // Predict size of deformation grid ResampleFilterType::SpacingType deformationGridSize; - deformationGridSize[0] = static_cast<ResampleFilterType::SpacingType::ValueType >(vcl_abs( + deformationGridSize[0] = static_cast<ResampleFilterType::SpacingType::ValueType >(std::abs( GetParameterInt("outputs.sizex") * GetParameterFloat("outputs.spacingx") / GetParameterFloat("opt.gridspacing") )); - deformationGridSize[1] = static_cast<ResampleFilterType::SpacingType::ValueType>(vcl_abs( + deformationGridSize[1] = static_cast<ResampleFilterType::SpacingType::ValueType>(std::abs( GetParameterInt("outputs.sizey") * GetParameterFloat("outputs.spacingy") / GetParameterFloat("opt.gridspacing") )); otbAppLogINFO("Using a deformation grid of size " << deformationGridSize); @@ -712,8 +712,8 @@ private: "opt.gridspacing units are the same as outputs.spacing units"); } - if (vcl_abs(GetParameterFloat("opt.gridspacing")) < vcl_abs(GetParameterFloat("outputs.spacingx")) - || vcl_abs(GetParameterFloat("opt.gridspacing")) < vcl_abs(GetParameterFloat("outputs.spacingy")) ) + if (std::abs(GetParameterFloat("opt.gridspacing")) < std::abs(GetParameterFloat("outputs.spacingx")) + || std::abs(GetParameterFloat("opt.gridspacing")) < std::abs(GetParameterFloat("outputs.spacingy")) ) { otbAppLogWARNING("Spacing of deformation grid should be at least equal to " "spacing of output image. Otherwise, computation time will be slow, " diff --git a/Modules/Applications/AppProjection/app/otbRefineSensorModel.cxx b/Modules/Applications/AppProjection/app/otbRefineSensorModel.cxx index 3d7c54197f2454365e3a34412901af6db6fcb775..d9d6486169a4f33c8b94660cc47b003995f0ae11 100644 --- a/Modules/Applications/AppProjection/app/otbRefineSensorModel.cxx +++ b/Modules/Applications/AppProjection/app/otbRefineSensorModel.cxx @@ -282,20 +282,20 @@ private: meany_ref/=tiepoints.size(); - double stdevx = vcl_sqrt(rmsex - meanx * meanx); - double stdevy = vcl_sqrt(rmsey - meany * meany); + double stdevx = std::sqrt(rmsex - meanx * meanx); + double stdevy = std::sqrt(rmsey - meany * meany); - double stdevx_ref = vcl_sqrt(rmsex_ref - meanx_ref * meanx_ref); - double stdevy_ref = vcl_sqrt(rmsey_ref - meany_ref * meany_ref); + double stdevx_ref = std::sqrt(rmsex_ref - meanx_ref * meanx_ref); + double stdevy_ref = std::sqrt(rmsey_ref - meany_ref * meany_ref); - rmse=vcl_sqrt(rmse); - rmsex=vcl_sqrt(rmsex); - rmsey=vcl_sqrt(rmsey); + rmse=std::sqrt(rmse); + rmsex=std::sqrt(rmsex); + rmsey=std::sqrt(rmsey); - rmse_ref=vcl_sqrt(rmse_ref); - rmsex_ref=vcl_sqrt(rmsex_ref); - rmsey_ref=vcl_sqrt(rmsey_ref); + rmse_ref=std::sqrt(rmse_ref); + rmsex_ref=std::sqrt(rmsex_ref); + rmsey_ref=std::sqrt(rmsey_ref); otbAppLogINFO("Estimation of input geom file accuracy: "); otbAppLogINFO("Overall Root Mean Square Error: "<<rmse_ref<<" meters"); diff --git a/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx b/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx index 1c1f5f2103c760ba0a7789b64f2525ce6729edba..b96a82f0038201de7105e5f4a251e9cbeba6c558 100644 --- a/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx +++ b/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx @@ -414,8 +414,8 @@ private: //size of output image FloatVectorImageType::PointType size; - size[0]=vcl_abs(maxX-minX); - size[1]=vcl_abs(maxY-minY); + size[0]=std::abs(maxX-minX); + size[1]=std::abs(maxY-minY); // Evaluate spacing FloatVectorImageType::SpacingType OutputSpacing; @@ -430,8 +430,8 @@ private: // Evaluate size ResampleFilterType::SizeType recomputedSize; - recomputedSize[0] = static_cast<unsigned int>(vcl_floor(vcl_abs(size[0]/OutputSpacing[0]))); - recomputedSize[1] = static_cast<unsigned int>(vcl_floor(vcl_abs(size[1]/OutputSpacing[1]))); + recomputedSize[0] = static_cast<unsigned int>(std::floor(std::abs(size[0]/OutputSpacing[0]))); + recomputedSize[1] = static_cast<unsigned int>(std::floor(std::abs(size[1]/OutputSpacing[1]))); m_Resampler->SetOutputSize( recomputedSize ); otbAppLogINFO( << "Output image size : " << recomputedSize ); diff --git a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx index df13e6edae2c9e774f839697a63085ca34905c18..13481a950ce16699ebab60f976673bc9c5d9450d 100644 --- a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx +++ b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx @@ -228,7 +228,7 @@ private: FloatVectorImageType::SpacingType defSpacing; if(IsParameterEnabled("lms")) { - float defScalarSpacing = vcl_abs(GetParameterFloat("lms")); + float defScalarSpacing = std::abs(GetParameterFloat("lms")); otbAppLogDEBUG("Generating coarse deformation field (spacing="<<defScalarSpacing<<")"); defSpacing[0] = defScalarSpacing; diff --git a/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx index 8999170a29c4135b2e7c31cc85031cad664fdb99..d6942c00673df53872de0bf6d4eb63aaccd6cf89 100644 --- a/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx @@ -387,8 +387,8 @@ private: // Compute extraction parameters unsigned long startX = column*sizeTilesX; unsigned long startY = row*sizeTilesY; - unsigned long sizeX = vcl_min(sizeTilesX+1,sizeImageX-startX+1); - unsigned long sizeY = vcl_min(sizeTilesY+1,sizeImageY-startY+1); + unsigned long sizeX = std::min(sizeTilesX+1,sizeImageX-startX+1); + unsigned long sizeY = std::min(sizeTilesY+1,sizeImageY-startY+1); //Tiles extraction of : //- the input image (filtering image) @@ -475,8 +475,8 @@ private: { unsigned long startX = column*sizeTilesX; unsigned long startY = row*sizeTilesY; - unsigned long sizeX = vcl_min(sizeTilesX+1,sizeImageX-startX+1); - unsigned long sizeY = vcl_min(sizeTilesY+1,sizeImageY-startY+1); + unsigned long sizeX = std::min(sizeTilesX+1,sizeImageX-startX+1); + unsigned long sizeY = std::min(sizeTilesY+1,sizeImageY-startY+1); std::string tileIn = CreateFileName(row,column,"SEG"); @@ -589,8 +589,8 @@ private: { unsigned long startX = column*sizeTilesX; unsigned long startY = row*sizeTilesY; - unsigned long sizeX = vcl_min(sizeTilesX,sizeImageX-startX); - unsigned long sizeY = vcl_min(sizeTilesY,sizeImageY-startY); + unsigned long sizeX = std::min(sizeTilesX,sizeImageX-startX); + unsigned long sizeY = std::min(sizeTilesY,sizeImageY-startY); std::string tileIn = CreateFileName(row,column,"SEG"); diff --git a/Modules/Applications/AppSegmentation/app/otbLSMSSmallRegionsMerging.cxx b/Modules/Applications/AppSegmentation/app/otbLSMSSmallRegionsMerging.cxx index afda10be1c517d130f6bce3162fae18681ed3172..b6a95b0dbbeaa7ee43f7169f9710fe7d09f4ea43 100644 --- a/Modules/Applications/AppSegmentation/app/otbLSMSSmallRegionsMerging.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLSMSSmallRegionsMerging.cxx @@ -197,8 +197,8 @@ private: { unsigned long startX = column*sizeTilesX; unsigned long startY = row*sizeTilesY; - unsigned long sizeX = vcl_min(sizeTilesX,sizeImageX-startX); - unsigned long sizeY = vcl_min(sizeTilesY,sizeImageY-startY); + unsigned long sizeX = std::min(sizeTilesX,sizeImageX-startX); + unsigned long sizeY = std::min(sizeTilesY,sizeImageY-startY); //Tiles extraction of the input image MultiChannelExtractROIFilterType::Pointer imageROI = MultiChannelExtractROIFilterType::New(); @@ -263,8 +263,8 @@ private: std::map<int,std::set<int> > adjMap; unsigned long startX = column*sizeTilesX, startY = row*sizeTilesY; - unsigned long sizeX = vcl_min(sizeTilesX+size+1,sizeImageX-startX), - sizeY = vcl_min(sizeTilesY+size+1,sizeImageY-startY); + unsigned long sizeX = std::min(sizeTilesX+size+1,sizeImageX-startX), + sizeY = std::min(sizeTilesY+size+1,sizeImageY-startY); ExtractROIFilterType::Pointer labelImageROI = ExtractROIFilterType::New(); labelImageROI->SetInput(labelIn); diff --git a/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx b/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx index 94c40f02283c5d2eee54c955e884ae82886fb558..98f41942853504b569220ac1f7352641677d7a72 100644 --- a/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx @@ -216,8 +216,8 @@ private: { unsigned long startX = column*sizeTilesX; unsigned long startY = row*sizeTilesY; - unsigned long sizeX = vcl_min(sizeTilesX,sizeImageX-startX); - unsigned long sizeY = vcl_min(sizeTilesY,sizeImageY-startY); + unsigned long sizeX = std::min(sizeTilesX,sizeImageX-startX); + unsigned long sizeY = std::min(sizeTilesY,sizeImageY-startY); //Tiles extraction of the input image MultiChannelExtractROIFilterType::Pointer imageROI = MultiChannelExtractROIFilterType::New(); diff --git a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx index b389719c6666758a604e6d5143650c42273dbbcb..791d5a223eeb9711a849b37569922f311f21a418 100644 --- a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx +++ b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx @@ -744,8 +744,8 @@ private: epipolarGridSource->Update(); FloatImageType::SpacingType epiSpacing; - epiSpacing[0] = 0.5 * (vcl_abs(inleft->GetSignedSpacing()[0]) + vcl_abs(inleft->GetSignedSpacing()[1])); - epiSpacing[1] = 0.5 * (vcl_abs(inleft->GetSignedSpacing()[0]) + vcl_abs(inleft->GetSignedSpacing()[1])); + epiSpacing[0] = 0.5 * (std::abs(inleft->GetSignedSpacing()[0]) + std::abs(inleft->GetSignedSpacing()[1])); + epiSpacing[1] = 0.5 * (std::abs(inleft->GetSignedSpacing()[0]) + std::abs(inleft->GetSignedSpacing()[1])); FloatImageType::SizeType epiSize; epiSize = epipolarGridSource->GetRectifiedImageSize(); @@ -757,8 +757,8 @@ private: double meanBaseline = epipolarGridSource->GetMeanBaselineRatio(); - double minDisp = vcl_floor((-1.0) * overElev * meanBaseline / epiSpacing[0]); - double maxDisp = vcl_ceil((-1.0) * underElev * meanBaseline / epiSpacing[0]); + double minDisp = std::floor((-1.0) * overElev * meanBaseline / epiSpacing[0]); + double maxDisp = std::ceil((-1.0) * underElev * meanBaseline / epiSpacing[0]); otbAppLogINFO(<<"Minimum disparity : "<<minDisp); otbAppLogINFO(<<"Maximum disparity : "<<maxDisp); diff --git a/Modules/Applications/AppVectorUtils/app/otbVectorDataExtractROI.cxx b/Modules/Applications/AppVectorUtils/app/otbVectorDataExtractROI.cxx index de6f6f9db7b816dd86f6f73645915cac9ded4778..a35c76d2776eaf7268c4f023b778ba06f9b9ae62 100644 --- a/Modules/Applications/AppVectorUtils/app/otbVectorDataExtractROI.cxx +++ b/Modules/Applications/AppVectorUtils/app/otbVectorDataExtractROI.cxx @@ -148,8 +148,8 @@ private: RemoteSensingRegionType::SizeType rsSize; rsOrigin[0] = std::min(pul[0], plr[0]); rsOrigin[1] = std::min(pul[1], plr[1]); - rsSize[0] = vcl_abs(pul[0] - plr[0]); - rsSize[1] = vcl_abs(pul[1] - plr[1]); + rsSize[0] = std::abs(pul[0] - plr[0]); + rsSize[1] = std::abs(pul[1] - plr[1]); rsRegion.SetOrigin(rsOrigin); rsRegion.SetSize(rsSize); diff --git a/Modules/Applications/AppVectorUtils/app/otbVectorDataTransform.cxx b/Modules/Applications/AppVectorUtils/app/otbVectorDataTransform.cxx index ba4614d77b0cf1852dac326d721e334d98d878bc..a76bb40fece7080814455efbf8f317a62befb5a5 100644 --- a/Modules/Applications/AppVectorUtils/app/otbVectorDataTransform.cxx +++ b/Modules/Applications/AppVectorUtils/app/otbVectorDataTransform.cxx @@ -159,7 +159,7 @@ private: parameters[2] = GetParameterFloat("transform.centerx"); parameters[3] = GetParameterFloat("transform.centery"); parameters[4] = inImage->GetSignedSpacing()[0] * GetParameterFloat("transform.tx"); - parameters[5] = vcl_abs(inImage->GetSignedSpacing()[1]) * GetParameterFloat("transform.ty"); + parameters[5] = std::abs(inImage->GetSignedSpacing()[1]) * GetParameterFloat("transform.ty"); // Set the parameters to the transform m_Transform->SetParameters(parameters); diff --git a/Modules/Core/Common/include/otbImageRegionNonUniformMultidimensionalSplitter.hxx b/Modules/Core/Common/include/otbImageRegionNonUniformMultidimensionalSplitter.hxx index bc61209bdf90c8ea3cb9359ea494286e4f95efea..b1e398f6537dd8d1014a9f4cb96b7cc7fc042f92 100644 --- a/Modules/Core/Common/include/otbImageRegionNonUniformMultidimensionalSplitter.hxx +++ b/Modules/Core/Common/include/otbImageRegionNonUniformMultidimensionalSplitter.hxx @@ -38,7 +38,7 @@ ImageRegionNonUniformMultidimensionalSplitter<VImageDimension> // requested number of splits per dimension double splitsPerDimension[VImageDimension]; -// ::ceil( vcl_pow((double) requestedNumber, 1.0/(double) VImageDimension)); +// ::ceil( std::pow((double) requestedNumber, 1.0/(double) VImageDimension)); unsigned int numberOfPiecesLeft = requestedNumber; unsigned int j, numPieces; @@ -100,7 +100,7 @@ ImageRegionNonUniformMultidimensionalSplitter<VImageDimension> // requested number of splits per dimension double splitsPerDimension[VImageDimension]; -// ::ceil( vcl_pow((double) numberOfPieces, 1.0/(double) VImageDimension)); +// ::ceil( std::pow((double) numberOfPieces, 1.0/(double) VImageDimension)); unsigned int numberOfPiecesLeft = numberOfPieces; diff --git a/Modules/Core/Common/include/otbImageRegionSquareTileSplitter.hxx b/Modules/Core/Common/include/otbImageRegionSquareTileSplitter.hxx index f09e0d02157dbfd63dd8e0d9c5e31faa6cf40476..ea8e36e30f176ce6eeee1e785f14119f3df7b7bd 100644 --- a/Modules/Core/Common/include/otbImageRegionSquareTileSplitter.hxx +++ b/Modules/Core/Common/include/otbImageRegionSquareTileSplitter.hxx @@ -34,7 +34,7 @@ ImageRegionSquareTileSplitter<VImageDimension> ::GetNumberOfSplits(const RegionType& region, unsigned int requestedNumber) { unsigned int theoricalNbPixelPerTile = region.GetNumberOfPixels() / requestedNumber; - unsigned int theoricalTileDimension = static_cast<unsigned int> (vcl_sqrt(static_cast<double>(theoricalNbPixelPerTile)) ); + unsigned int theoricalTileDimension = static_cast<unsigned int> (std::sqrt(static_cast<double>(theoricalNbPixelPerTile)) ); // Take the next multiple of m_TileSizeAlignment (eventually generate more splits than requested) m_TileDimension = (theoricalTileDimension + m_TileSizeAlignment - 1) / m_TileSizeAlignment * m_TileSizeAlignment; diff --git a/Modules/Core/Common/include/otbImageRegionTileMapSplitter.hxx b/Modules/Core/Common/include/otbImageRegionTileMapSplitter.hxx index 2e4c793eb36f06d03a2801a56609ba15f75260e9..8f4be76a8b3abc51bfc9e898013410d54a42b092 100644 --- a/Modules/Core/Common/include/otbImageRegionTileMapSplitter.hxx +++ b/Modules/Core/Common/include/otbImageRegionTileMapSplitter.hxx @@ -47,19 +47,19 @@ ImageRegionTileMapSplitter<VImageDimension> { // otbMsgDevMacro(<< "*** Dimension: " << j-1); unsigned long int remainingToDo = - static_cast<unsigned long int>(vcl_ceil(static_cast<double>(requestedNumber) / numPieces)); + static_cast<unsigned long int>(std::ceil(static_cast<double>(requestedNumber) / numPieces)); unsigned int maxPieces = (regionIndex[j - 1] + regionSize[j - 1] - 1) / m_AlignStep - regionIndex[j - 1] / m_AlignStep + 1; unsigned int stepPerPiece = 1; if (remainingToDo < maxPieces) { - stepPerPiece = static_cast<unsigned int> (vcl_floor(static_cast<double> (maxPieces) / remainingToDo)); + stepPerPiece = static_cast<unsigned int> (std::floor(static_cast<double> (maxPieces) / remainingToDo)); if ((remainingToDo - 1) * (stepPerPiece + 1) < maxPieces) { stepPerPiece += 1; } } - unsigned int maxPieceUsed = static_cast<unsigned int> (vcl_ceil(static_cast<double> (maxPieces) / stepPerPiece)); + unsigned int maxPieceUsed = static_cast<unsigned int> (std::ceil(static_cast<double> (maxPieces) / stepPerPiece)); m_SplitsPerDimension[j - 1] = maxPieceUsed; // otbMsgDevMacro("*** maxPieces stepPerPiece maxPieceUsed " << maxPieces // << " " << stepPerPiece << " " << maxPieceUsed); @@ -103,7 +103,7 @@ ImageRegionTileMapSplitter<VImageDimension> stackSize *= m_SplitsPerDimension[j]; unsigned int generalSplitSize = - static_cast<unsigned int> (vcl_ceil(static_cast<double> (regionSize[j]) / (m_SplitsPerDimension[j] + static_cast<unsigned int> (std::ceil(static_cast<double> (regionSize[j]) / (m_SplitsPerDimension[j] * m_AlignStep))) * m_AlignStep; if (slicePos == 0) diff --git a/Modules/Core/Common/include/otbRectangle.hxx b/Modules/Core/Common/include/otbRectangle.hxx index 8ada6f1d928791f33e3af2da970a4c0e8cddcda7..0b62dccc86d96c6862d2a1e3d25efb3be35ad8ba 100644 --- a/Modules/Core/Common/include/otbRectangle.hxx +++ b/Modules/Core/Common/include/otbRectangle.hxx @@ -49,7 +49,7 @@ Rectangle<TValue> VertexType p2 = it.Value(); /** Compute Length of the rectangle*/ - double lengthSeg = vcl_sqrt((p1[0] - p2[0]) * (p1[0] - p2[0]) + (p1[1] - p2[1]) * (p1[1] - p2[1])); + double lengthSeg = std::sqrt((p1[0] - p2[0]) * (p1[0] - p2[0]) + (p1[1] - p2[1]) * (p1[1] - p2[1])); /** Orthogonal segment containing the middle of the segment */ VertexType middleP; @@ -57,8 +57,8 @@ Rectangle<TValue> middleP[1] = (p1[1] + p2[1]) / 2.; VertexType corner; - corner[0] = middleP[0] + (m_Width / 2) * vcl_sin(m_Orientation); - corner[1] = middleP[1] - (m_Width / 2) * vcl_cos(m_Orientation); + corner[0] = middleP[0] + (m_Width / 2) * std::sin(m_Orientation); + corner[1] = middleP[1] - (m_Width / 2) * std::cos(m_Orientation); /** Compute the distance to the orthogonal median of the rectangle*/ if (this->ComputeEuclideanDistanceMetricToSegment(p1, p2, point) - (m_Width / 2.) < 1e-10 @@ -81,9 +81,9 @@ Rectangle<TValue> double xp = p[0]; double yp = p[1]; - double SegmentLength = vcl_sqrt((Xq1 - Xq2) * (Xq1 - Xq2) + (Yq1 - Yq2) * (Yq1 - Yq2)); + double SegmentLength = std::sqrt((Xq1 - Xq2) * (Xq1 - Xq2) + (Yq1 - Yq2) * (Yq1 - Yq2)); double CrossProduct = Xq1 * Yq2 - Xq2 * Yq1; - double Num = vcl_abs(xp * (Yq1 - Yq2) + yp * (Xq2 - Xq1) + CrossProduct); + double Num = std::abs(xp * (Yq1 - Yq2) + yp * (Xq2 - Xq1) + CrossProduct); /** distance from Point P to Segment Q1Q2*/ return (Num / SegmentLength); @@ -106,8 +106,8 @@ Rectangle<TValue> VertexType p2 = it.Value(); /** Compute the four corners of the recatangle*/ - double dx = vcl_cos(m_Orientation); - double dy = vcl_sin(m_Orientation); + double dx = std::cos(m_Orientation); + double dy = std::sin(m_Orientation); double halfWidth = m_Width / 2; VertexListPointerType cornersVertex = VertexListType::New(); diff --git a/Modules/Core/Common/include/otbUniformAlphaBlendingFunctor.h b/Modules/Core/Common/include/otbUniformAlphaBlendingFunctor.h index 0d1097e901d52de06c6358b527d92ef2c4806c4d..ffeca4f0cbdc65fe620f85e078609a6e36d2781c 100644 --- a/Modules/Core/Common/include/otbUniformAlphaBlendingFunctor.h +++ b/Modules/Core/Common/include/otbUniformAlphaBlendingFunctor.h @@ -64,11 +64,11 @@ public: { OutputPixelType resp; resp.Fill(itk::NumericTraits<OutputInternalPixelType>::max()); - resp.SetRed(static_cast<OutputInternalPixelType>(vcl_floor(m_Alpha * static_cast<double>(input1.GetRed()) + + resp.SetRed(static_cast<OutputInternalPixelType>(std::floor(m_Alpha * static_cast<double>(input1.GetRed()) + (1 - m_Alpha) * static_cast<double>(input2.GetRed()) + 0.5))); - resp.SetGreen(static_cast<OutputInternalPixelType>(vcl_floor(m_Alpha * static_cast<double>(input1.GetGreen()) + + resp.SetGreen(static_cast<OutputInternalPixelType>(std::floor(m_Alpha * static_cast<double>(input1.GetGreen()) + (1 - m_Alpha) * static_cast<double>(input2.GetGreen()) + 0.5))); - resp.SetBlue(static_cast<OutputInternalPixelType>(vcl_floor(m_Alpha * static_cast<double>(input1.GetBlue()) + + resp.SetBlue(static_cast<OutputInternalPixelType>(std::floor(m_Alpha * static_cast<double>(input1.GetBlue()) + (1 - m_Alpha) * static_cast<double>(input2.GetBlue()) + 0.5))); return resp; } diff --git a/Modules/Core/ImageBase/include/otbConvertPixelBuffer.hxx b/Modules/Core/ImageBase/include/otbConvertPixelBuffer.hxx index 0df8cff4d6e5a56dbd87d9a43d2b21554b47ebf5..e6e6b6433bde63e79a5ce989887f8628b5c08fb3 100644 --- a/Modules/Core/ImageBase/include/otbConvertPixelBuffer.hxx +++ b/Modules/Core/ImageBase/include/otbConvertPixelBuffer.hxx @@ -89,7 +89,7 @@ ComplexCast(const std::complex<InputType>& in, const OutputType& itkNotUsed(dumm RealType inReal( static_cast<ScalarRealType>(in.real()), static_cast<ScalarRealType>(in.imag()) ); - return static_cast < OutputType >( vcl_abs(inReal) ); + return static_cast < OutputType >( std::abs(inReal) ); } template<typename InputType, typename OutputType> diff --git a/Modules/Core/ImageBase/include/otbRemoteSensingRegion.h b/Modules/Core/ImageBase/include/otbRemoteSensingRegion.h index 3c000d43bbbcef8369edb2bbd0b8e947e57eb897..bbd7205c569217bd9e8b8fc05751835b12f02043 100644 --- a/Modules/Core/ImageBase/include/otbRemoteSensingRegion.h +++ b/Modules/Core/ImageBase/include/otbRemoteSensingRegion.h @@ -128,10 +128,10 @@ public: typename ImageRegionType::IndexType irIndex; typename ImageRegionType::SizeType irSize; - irIndex[0] = static_cast<unsigned long>(vcl_floor(m_Index[0])); - irIndex[1] = static_cast<unsigned long>(vcl_floor(m_Index[1])); - irSize[0] = static_cast<unsigned long>(vcl_ceil(m_Size[0])); - irSize[1] = static_cast<unsigned long>(vcl_ceil(m_Size[1])); + irIndex[0] = static_cast<unsigned long>(std::floor(m_Index[0])); + irIndex[1] = static_cast<unsigned long>(std::floor(m_Index[1])); + irSize[0] = static_cast<unsigned long>(std::ceil(m_Size[0])); + irSize[1] = static_cast<unsigned long>(std::ceil(m_Size[1])); imageRegion.SetIndex(irIndex); imageRegion.SetSize(irSize); diff --git a/Modules/Core/ImageBase/test/otbComplexToIntensityFilterTest.cxx b/Modules/Core/ImageBase/test/otbComplexToIntensityFilterTest.cxx index 6c18096d743bfb76a8f3132f7f3c6d0f7abc4cac..d81a87edabf39ff314ebf8b1c6eb3db863de800c 100644 --- a/Modules/Core/ImageBase/test/otbComplexToIntensityFilterTest.cxx +++ b/Modules/Core/ImageBase/test/otbComplexToIntensityFilterTest.cxx @@ -135,7 +135,7 @@ int otbComplexToIntensityFilterTest(int, char* [] ) std::cout << output << " = "; std::cout << intensity << std::endl; - if( vcl_fabs( intensity - output ) > epsilon ) + if( std::fabs( intensity - output ) > epsilon ) { std::cerr << "Error in itkComplexToIntensityImageFilterTest " << std::endl; std::cerr << " intensity( " << input << ") = " << intensity << std::endl; diff --git a/Modules/Core/ImageBase/test/otbFlexibleDistanceWithMissingValue.cxx b/Modules/Core/ImageBase/test/otbFlexibleDistanceWithMissingValue.cxx index 0a74f0c9fb3a94b60c97c403e0ac845431619be7..00068a8f7f65c95aedcfdd38eb474a065dbb4c26 100644 --- a/Modules/Core/ImageBase/test/otbFlexibleDistanceWithMissingValue.cxx +++ b/Modules/Core/ImageBase/test/otbFlexibleDistanceWithMissingValue.cxx @@ -49,11 +49,11 @@ int otbFlexibleDistanceWithMissingValue(int itkNotUsed(argc), char * argv[]) double distanceValue = dist->Evaluate(x, y); std::cout << std::setprecision(20) << std::endl; std::cout << "dim, a, b : " << dim << "," << a << "," << b << std::endl; - std::cout << "dim*vcl_pow(3, b) : " << dim*vcl_pow(3, b) << std::endl; + std::cout << "dim*std::pow(3, b) : " << dim*std::pow(3, b) << std::endl; std::cout << "Distance : " << distanceValue << std::endl; std::cout << "Epsilon : " << epsilon << std::endl; - std::cout << "-> Tests diff : " << vcl_abs(distanceValue - dim * vcl_pow(3, b)) << std::endl; + std::cout << "-> Tests diff : " << std::abs(distanceValue - dim * std::pow(3, b)) << std::endl; - if (vcl_abs(distanceValue - dim * vcl_pow(3, b)) < epsilon) return EXIT_SUCCESS; + if (std::abs(distanceValue - dim * std::pow(3, b)) < epsilon) return EXIT_SUCCESS; else return EXIT_FAILURE; } diff --git a/Modules/Core/ImageBase/test/otbImageFunctionAdaptor.cxx b/Modules/Core/ImageBase/test/otbImageFunctionAdaptor.cxx index ca319814039fb2025cd69e2bf7beed91136ab191..a24f75cc92e6942f240e8a17f72315efb129f2fb 100644 --- a/Modules/Core/ImageBase/test/otbImageFunctionAdaptor.cxx +++ b/Modules/Core/ImageBase/test/otbImageFunctionAdaptor.cxx @@ -158,7 +158,7 @@ int otbImageFunctionAdaptor(int itkNotUsed(argc), char * argv[]) { for (unsigned int j = 0; j <= 5; ++j) { - error += vcl_pow(vcl_abs(resultAdaptedFMD[rsltIdx] - resultFMD.at(i).at(j)), 2); + error += std::pow(std::abs(resultAdaptedFMD[rsltIdx] - resultFMD.at(i).at(j)), 2); std::cout << "resultAdaptedFMD : " << resultAdaptedFMD[rsltIdx] << "\t - resultFMD : " << resultFMD.at(i).at(j) << std::endl; @@ -194,7 +194,7 @@ int otbImageFunctionAdaptor(int itkNotUsed(argc), char * argv[]) { for (unsigned int j = 0; j <= 5; ++j) { - error += vcl_pow(vcl_abs(resultAdaptedRM[rsltIdx] - resultRM.at(i).at(j)), 2); + error += std::pow(std::abs(resultAdaptedRM[rsltIdx] - resultRM.at(i).at(j)), 2); std::cout << "resultAdaptedRM : " << resultAdaptedRM[rsltIdx] << "\t - resultRM : " << resultRM.at(i).at(j) << std::endl; @@ -229,11 +229,11 @@ int otbImageFunctionAdaptor(int itkNotUsed(argc), char * argv[]) { for (unsigned int j = 0; j <= 5; ++j) { - error += vcl_pow(vcl_abs(resultAdaptedCM[rsltIdx] - resultCM.at(i).at(j).real()), 2); + error += std::pow(std::abs(resultAdaptedCM[rsltIdx] - resultCM.at(i).at(j).real()), 2); std::cout << "resultAdaptedCM : (" << resultAdaptedCM[rsltIdx] << "," << resultAdaptedCM[rsltIdx + 1] << ")" << "\t - resultCM : " << resultCM.at(i).at(j) << std::endl; rsltIdx++; - error += vcl_pow(vcl_abs(resultAdaptedCM[rsltIdx] - resultCM.at(i).at(j).imag()), 2); + error += std::pow(std::abs(resultAdaptedCM[rsltIdx] - resultCM.at(i).at(j).imag()), 2); rsltIdx++; } } @@ -259,7 +259,7 @@ int otbImageFunctionAdaptor(int itkNotUsed(argc), char * argv[]) rsltIdx = 0; for (unsigned int i = 0; i < 11; ++i) { - error += vcl_pow(vcl_abs(resultAdaptedFM[rsltIdx] - resultFM[i]), 2); + error += std::pow(std::abs(resultAdaptedFM[rsltIdx] - resultFM[i]), 2); std::cout << "resultAdaptedFM : " << resultAdaptedFM[rsltIdx] << "\t - resultFM : " << resultFM[i] << std::endl; rsltIdx++; @@ -286,7 +286,7 @@ int otbImageFunctionAdaptor(int itkNotUsed(argc), char * argv[]) rsltIdx = 0; for (unsigned int i = 0; i < 7; ++i) { - error += vcl_pow(vcl_abs(resultAdaptedHM[rsltIdx] - resultHM[i]), 2); + error += std::pow(std::abs(resultAdaptedHM[rsltIdx] - resultHM[i]), 2); std::cout << "resultAdaptedHM : " << resultAdaptedHM[rsltIdx] << "\t - resultHM : " << resultHM[i] << std::endl; rsltIdx++; @@ -313,7 +313,7 @@ int otbImageFunctionAdaptor(int itkNotUsed(argc), char * argv[]) rsltIdx = 0; for (unsigned int i = 0; i < 4; ++i) { - error += vcl_pow(vcl_abs(resultAdaptedRaM[rsltIdx] - resultRaM[i]), 2); + error += std::pow(std::abs(resultAdaptedRaM[rsltIdx] - resultRaM[i]), 2); std::cout << "resultAdaptedRaM : " << resultAdaptedRaM[rsltIdx] << "\t - resultRaM : " << resultRaM[i] << std::endl; @@ -347,7 +347,7 @@ int otbImageFunctionAdaptor(int itkNotUsed(argc), char * argv[]) rsltIdx = 0; for (unsigned int i = 0; i < 64; ++i) { - error += vcl_pow(vcl_abs(resultAdaptedLH[rsltIdx] - resultLH->GetFrequency(i)), 2); + error += std::pow(std::abs(resultAdaptedLH[rsltIdx] - resultLH->GetFrequency(i)), 2); std::cout << "resultAdaptedLH : " << resultAdaptedLH[rsltIdx] << "\t - resultLH : " << resultLH->GetFrequency(i) << std::endl; @@ -362,7 +362,7 @@ int otbImageFunctionAdaptor(int itkNotUsed(argc), char * argv[]) return EXIT_FAILURE; } - error = vcl_sqrt(error); + error = std::sqrt(error); std::cout << std::endl << "Error : " << error << std::endl << std::endl; diff --git a/Modules/Core/Interpolation/include/otbBCOInterpolateImageFunction.hxx b/Modules/Core/Interpolation/include/otbBCOInterpolateImageFunction.hxx index f91f9027623c8d60678ef6d93dd10ff0a13d97b5..14b32962c07aad0c164cba1f1b82740b873765e6 100644 --- a/Modules/Core/Interpolation/include/otbBCOInterpolateImageFunction.hxx +++ b/Modules/Core/Interpolation/include/otbBCOInterpolateImageFunction.hxx @@ -96,19 +96,19 @@ BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> { // Compute the BCO coefficients according to alpha. - dist = vcl_abs(position - offset*step); + dist = std::abs(position - offset*step); if( dist <= 2. ) { if (dist <= 1.) { - BCOCoef[i] = (m_Alpha + 2.)*vcl_abs(dist * dist * dist) + BCOCoef[i] = (m_Alpha + 2.)*std::abs(dist * dist * dist) - (m_Alpha + 3.)*dist*dist + 1; } else { - BCOCoef[i] = m_Alpha*vcl_abs(dist * dist * dist) - 5 - *m_Alpha*dist*dist + 8*m_Alpha*vcl_abs(dist) - 4*m_Alpha; + BCOCoef[i] = m_Alpha*std::abs(dist * dist * dist) - 5 + *m_Alpha*dist*dist + 8*m_Alpha*std::abs(dist) - 4*m_Alpha; } } else diff --git a/Modules/Core/Interpolation/include/otbBSplineDecompositionImageFilter.hxx b/Modules/Core/Interpolation/include/otbBSplineDecompositionImageFilter.hxx index 08e85b3eab652c9847cf5fb5a30ea98470519d9c..066b10402406d001df2e271d90fe23829f7da898 100644 --- a/Modules/Core/Interpolation/include/otbBSplineDecompositionImageFilter.hxx +++ b/Modules/Core/Interpolation/include/otbBSplineDecompositionImageFilter.hxx @@ -137,7 +137,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage> { case 3: m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0; + m_SplinePoles[0] = std::sqrt(3.0) - 2.0; break; case 0: m_NumberOfPoles = 0; @@ -147,18 +147,18 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage> break; case 2: m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0; + m_SplinePoles[0] = std::sqrt(8.0) - 3.0; break; case 4: m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0; - m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0; + m_SplinePoles[0] = std::sqrt(664.0 - std::sqrt(438976.0)) + std::sqrt(304.0) - 19.0; + m_SplinePoles[1] = std::sqrt(664.0 + std::sqrt(438976.0)) - std::sqrt(304.0) - 19.0; break; case 5: m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0) + m_SplinePoles[0] = std::sqrt(135.0 / 2.0 - std::sqrt(17745.0 / 4.0)) + std::sqrt(105.0 / 4.0) - 13.0 / 2.0; - m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0) + m_SplinePoles[1] = std::sqrt(135.0 / 2.0 + std::sqrt(17745.0 / 4.0)) - std::sqrt(105.0 / 4.0) - 13.0 / 2.0; break; default: @@ -187,7 +187,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage> zn = z; if (m_Tolerance > 0.0) { - horizon = (long) vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z))); + horizon = (long) std::ceil(log(m_Tolerance) / std::log(fabs(z))); } if (horizon < m_DataLength[m_IteratorDirection]) { @@ -204,7 +204,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage> { /* full loop */ iz = 1.0 / z; - z2n = vcl_pow(z, (double) (m_DataLength[m_IteratorDirection] - 1L)); + z2n = std::pow(z, (double) (m_DataLength[m_IteratorDirection] - 1L)); sum = m_Scratch[0] + z2n * m_Scratch[m_DataLength[m_IteratorDirection] - 1L]; z2n *= z2n * iz; for (unsigned int n = 1; n <= (m_DataLength[m_IteratorDirection] - 2); ++n) diff --git a/Modules/Core/Interpolation/include/otbBSplineInterpolateImageFunction.hxx b/Modules/Core/Interpolation/include/otbBSplineInterpolateImageFunction.hxx index ae50ccf495239d02759a17ba07d683941571dd75..d0d094792f3e446cfeaf75593a48d85015ba6e5b 100644 --- a/Modules/Core/Interpolation/include/otbBSplineInterpolateImageFunction.hxx +++ b/Modules/Core/Interpolation/include/otbBSplineInterpolateImageFunction.hxx @@ -503,7 +503,7 @@ BSplineInterpolateImageFunction<TImageType, TCoordRep, TCoefficientType> { if (splineOrder & 1) // Use this index calculation for odd splineOrder { - indx = (long) vcl_floor((float) x[n]) - splineOrder / 2; + indx = (long) std::floor((float) x[n]) - splineOrder / 2; //std::cout<<"x: "<<x<<std::endl; //std::cout<<"splineOrder: "<<splineOrder<<std::endl; //std::cout<<"indx: "<<indx<<std::endl; @@ -515,7 +515,7 @@ BSplineInterpolateImageFunction<TImageType, TCoordRep, TCoefficientType> else // Use this index calculation for even splineOrder { - indx = (long) vcl_floor((float) (x[n] + 0.5)) - splineOrder / 2; + indx = (long) std::floor((float) (x[n] + 0.5)) - splineOrder / 2; //std::cout<<"x: "<<x<<std::endl; //std::cout<<"splineOrder: "<<splineOrder<<std::endl; //std::cout<<"indx: "<<indx<<std::endl; diff --git a/Modules/Core/Interpolation/include/otbGenericInterpolateImageFunction.hxx b/Modules/Core/Interpolation/include/otbGenericInterpolateImageFunction.hxx index 1f51fb380e48cc151408261c4dcd5c9cb854a21c..58bea480b15650dbd0fbbcda9fdc06387168cbdf 100644 --- a/Modules/Core/Interpolation/include/otbGenericInterpolateImageFunction.hxx +++ b/Modules/Core/Interpolation/include/otbGenericInterpolateImageFunction.hxx @@ -207,7 +207,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo { // The following "if" block is equivalent to the following line without // having to call floor. - // baseIndex[dim] = (long) vcl_floor(index[dim] ); + // baseIndex[dim] = (long) std::floor(index[dim] ); if (index[dim] >= 0.0) { baseIndex[dim] = (long) index[dim]; @@ -262,7 +262,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo { // Increment the offset, taking it through the range // (dist + rad - 1, ..., dist - rad), i.e. all x - // such that vcl_abs(x) <= rad + // such that std::abs(x) <= rad x -= 1.0; // Compute the weight for this m xWeight[dim][i] = m_Function(x); diff --git a/Modules/Core/Interpolation/include/otbProlateInterpolateImageFunction.h b/Modules/Core/Interpolation/include/otbProlateInterpolateImageFunction.h index 2c181389853839803e46621d00cd7943092765a7..d1441eb993e8e6bf1961d8751405c76a458d7893 100644 --- a/Modules/Core/Interpolation/include/otbProlateInterpolateImageFunction.h +++ b/Modules/Core/Interpolation/include/otbProlateInterpolateImageFunction.h @@ -204,11 +204,11 @@ public: { const size_t originalProfileSize = m_OriginalProfile.size(); TOutput val = itk::NumericTraits<TOutput>::Zero; - if (A != itk::NumericTraits<TInput>::Zero && vcl_abs(A) != static_cast<TInput>(m_Radius) && m_Radius != 0) + if (A != itk::NumericTraits<TInput>::Zero && std::abs(A) != static_cast<TInput>(m_Radius) && m_Radius != 0) { - double ival = static_cast<double>(originalProfileSize - 1) * static_cast<double>(vcl_abs(A)) / + double ival = static_cast<double>(originalProfileSize - 1) * static_cast<double>(std::abs(A)) / static_cast<double>(m_Radius); - double ivalFloor = vcl_floor(ival); + double ivalFloor = std::floor(ival); double left = ival - ivalFloor; if (static_cast<unsigned int>(ivalFloor) + 1 < originalProfileSize) @@ -229,7 +229,7 @@ public: } else { - if (vcl_abs(A) == static_cast<TInput>(m_Radius)) + if (std::abs(A) == static_cast<TInput>(m_Radius)) { val = m_OriginalProfile[originalProfileSize - 1]; } diff --git a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageBlackmanFunction.h b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageBlackmanFunction.h index bb29e36da2ad699a9035b8acc299a963191cfcb4..58d68c0353d1af19dcc582e3feaaf2d8cf711982 100644 --- a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageBlackmanFunction.h +++ b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageBlackmanFunction.h @@ -64,8 +64,8 @@ public: { double x = static_cast<double>(A); double px = CONST_PI * x; - double temp = 0.42 + 0.5 * vcl_cos(x * m_Factor1) + 0.08 * vcl_cos(x * m_Factor2); - return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * vcl_sin(px) / px); + double temp = 0.42 + 0.5 * std::cos(x * m_Factor1) + 0.08 * std::cos(x * m_Factor2); + return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px); } private: unsigned int m_Radius; diff --git a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageCosineFunction.h b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageCosineFunction.h index e3d6fa98f1399e6c85bc0b29359d28909a24e358..84aca4f7f330ca2d6f913a6632d02a7931d6de64 100644 --- a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageCosineFunction.h +++ b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageCosineFunction.h @@ -59,8 +59,8 @@ public: { double x = static_cast<double>(A); double px = CONST_PI * x; - double temp = vcl_cos(x * m_Factor); - return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * vcl_sin(px) / px); + double temp = std::cos(x * m_Factor); + return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px); } private: // Equal to \f$ \frac{\pi}{2 m} \f$ diff --git a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageGaussianFunction.h b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageGaussianFunction.h index 411cfc3d10367bf448dc7c67711f783986a9cb8b..fa0ae9ac303c129730aff3af5d1b1efdec8d1ade 100644 --- a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageGaussianFunction.h +++ b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageGaussianFunction.h @@ -59,8 +59,8 @@ public: { double x = static_cast<double>(A); double px = CONST_PI * x; - double temp = vcl_exp(px * px * m_Factor); - return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * vcl_sin(px) / px); + double temp = std::exp(px * px * m_Factor); + return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px); } private: double m_Factor; diff --git a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageHammingFunction.h b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageHammingFunction.h index c95a0679a733fd32106663675edd83da04890386..97d427e04e8c43df3af445e98e4f21eeb6ff0e68 100644 --- a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageHammingFunction.h +++ b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageHammingFunction.h @@ -59,8 +59,8 @@ public: { double x = static_cast<double>(A); double px = CONST_PI * x; - double temp = 0.54 + 0.46 * vcl_cos(x * m_Factor); - return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * vcl_sin(px) / px); + double temp = 0.54 + 0.46 * std::cos(x * m_Factor); + return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px); } private: // Equal to \f$ \frac{\pi}{m} \f$ diff --git a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageLanczosFunction.h b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageLanczosFunction.h index 737fc06f20b2a81242ddc5a3b8c940b3fc349a1f..ea9b14b505e2db45618706c82a50ca540a20f1cc 100644 --- a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageLanczosFunction.h +++ b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageLanczosFunction.h @@ -69,9 +69,9 @@ public: else { double z = m_Factor * x; - temp = vcl_sin(z) / z; + temp = std::sin(z) / z; } - return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * vcl_sin(px) / px); + return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px); } private: // Equal to \f$ \frac{\pi}{m} \f$ diff --git a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageWelchFunction.h b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageWelchFunction.h index 228a8e68b2a441ddf1659022a84d9a01cb20d8f4..c1dff64352db33a0b565be0789d52d54a1a2f255 100644 --- a/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageWelchFunction.h +++ b/Modules/Core/Interpolation/include/otbWindowedSincInterpolateImageWelchFunction.h @@ -60,7 +60,7 @@ public: double x = static_cast<double>(A); double px = CONST_PI * x; double temp = 1.0 - x * m_Factor * x; - return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * vcl_sin(px) / px); + return (x == 0.0) ? static_cast<TOutput>(temp) : static_cast<TOutput>(temp * std::sin(px) / px); } private: // Equal to \f$ \frac{1}{m^2} \f$ diff --git a/Modules/Core/Interpolation/test/otbBCOInterpolateImageFunction.cxx b/Modules/Core/Interpolation/test/otbBCOInterpolateImageFunction.cxx index 895c8e89fedb7c4852e6339d3bfda7c8b9bb920b..a99e8d8931781a236372522124463eddc773bd24 100644 --- a/Modules/Core/Interpolation/test/otbBCOInterpolateImageFunction.cxx +++ b/Modules/Core/Interpolation/test/otbBCOInterpolateImageFunction.cxx @@ -173,7 +173,7 @@ int otbBCOInterpolateImageFunction2(int argc, char * argv[]) for (std::vector<ContinuousIndexType>::iterator it = indicesList.begin(); it != indicesList.end(); ++it) { std::cout << (*it) << " -> " << filter->EvaluateAtContinuousIndex((*it)) << std::endl; - if (vcl_abs(filter->EvaluateAtContinuousIndex((*it))-1.0)>1e-6) + if (std::abs(filter->EvaluateAtContinuousIndex((*it))-1.0)>1e-6) return EXIT_FAILURE; } diff --git a/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.h b/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.h index 1d7b92178eef75c680cb5bb44f3669d999355476..5c179570b0d880a8659350809db01d3989de4d34 100644 --- a/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.h +++ b/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.h @@ -24,7 +24,7 @@ #include <vector> //TODO change this include have to define from what inherate this class -#include "otbPolyLineParametricPathWithValue.h" //for vcl_abs +#include "otbPolyLineParametricPathWithValue.h" //for std::abs #include "itkPoint.h" #include "itkIndex.h" diff --git a/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.hxx b/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.hxx index 56d470b3e5977d41d25bcda0787b5ba42911e57c..8619447234c7ec1e580c4f7495a024444e831301 100644 --- a/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.hxx +++ b/Modules/Core/LabelMap/include/otbLabelObjectToPolygonFunctor.hxx @@ -482,7 +482,7 @@ LabelObjectToPolygonFunctor<TLabelObject, TPolygon> PolygonType * polygon, const StateType state) { - if( vcl_abs(static_cast<long int>(line + m_LineOffset - endPoint[1])) > 1 ) + if( std::abs(static_cast<long int>(line + m_LineOffset - endPoint[1])) > 1 ) { itkExceptionMacro("End point not with +/-1 line from line") } @@ -558,7 +558,7 @@ LabelObjectToPolygonFunctor<TLabelObject, TPolygon> const StateType state) { - if( vcl_abs(static_cast<long int>(line + m_LineOffset - endPoint[1])) > 1 ) + if( std::abs(static_cast<long int>(line + m_LineOffset - endPoint[1])) > 1 ) { itkExceptionMacro("End point not with +/-1 line from line") } diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx index ba322f8fdba8ea429248ba3c14687611e83a005d..9085298ec7e8470e0f5163b9a2e4279dc37019ef 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx @@ -205,13 +205,13 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> double sizePerPixel = 1; for (DimensionType i = 0; i < LabelObjectType::ImageDimension; ++i) { - sizePerPixel *= vcl_abs(m_LabelImage->GetSignedSpacing()[i]); + sizePerPixel *= std::abs(m_LabelImage->GetSignedSpacing()[i]); } typename std::vector<double> sizePerPixelPerDimension; for (DimensionType i = 0; i < LabelObjectType::ImageDimension; ++i) { - sizePerPixelPerDimension.push_back(sizePerPixel / vcl_abs(m_LabelImage->GetSignedSpacing()[i])); + sizePerPixelPerDimension.push_back(sizePerPixel / std::abs(m_LabelImage->GetSignedSpacing()[i])); } // compute the max the index on the border of the image @@ -406,7 +406,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> { centroid[i] /= size; regionSize[i] = maxs[i] - mins[i] + 1; - double s = regionSize[i] * vcl_abs(m_LabelImage->GetSignedSpacing()[i]); + double s = regionSize[i] * std::abs(m_LabelImage->GetSignedSpacing()[i]); minSize = std::min(s, minSize); maxSize = std::max(s, maxSize); for (DimensionType j = 0; j < LabelObjectType::ImageDimension; ++j) @@ -433,7 +433,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> vnl_diag_matrix<double> pm = eigen.D; for (unsigned int i = 0; i < LabelObjectType::ImageDimension; ++i) { -// principalMoments[i] = 4 * vcl_sqrt( pm(i, i) ); +// principalMoments[i] = 4 * std::sqrt( pm(i, i) ); principalMoments[i] = pm(i, i); } itk::Matrix<double, LabelObjectType::ImageDimension, LabelObjectType::ImageDimension> @@ -443,7 +443,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> // by multiplying the last row by the determinant vnl_real_eigensystem eigenrot(principalAxes.GetVnlMatrix()); vnl_diag_matrix<vcl_complex<double> > eigenval = eigenrot.D; - vcl_complex<double> det(1.0, 0.0); + std::complex<double> det(1.0, 0.0); for (DimensionType i = 0; i < LabelObjectType::ImageDimension; ++i) { @@ -459,7 +459,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> if (principalMoments[LabelObjectType::ImageDimension - 2] != 0) { elongation = - vcl_sqrt(principalMoments[LabelObjectType::ImageDimension - + std::sqrt(principalMoments[LabelObjectType::ImageDimension - 1] / principalMoments[LabelObjectType::ImageDimension - 2]); } @@ -474,10 +474,10 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> { edet *= principalMoments[i]; } - edet = vcl_pow(edet, 1.0 / LabelObjectType::ImageDimension); + edet = std::pow(edet, 1.0 / LabelObjectType::ImageDimension); for (DimensionType i = 0; i < LabelObjectType::ImageDimension; ++i) { - ellipsoidSize[i] = 2.0 * equivalentRadius * vcl_sqrt(principalMoments[i] / edet); + ellipsoidSize[i] = 2.0 * equivalentRadius * std::sqrt(principalMoments[i] / edet); } @@ -522,24 +522,24 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> // normalize c11 /= physicalSize * physicalSize; c20 /= physicalSize * physicalSize; - c12 /= vcl_pow(physicalSize, 5.0 / 2); - c21 /= vcl_pow(physicalSize, 5.0 / 2); - c30 /= vcl_pow(physicalSize, 5.0 / 2); - c22 /= vcl_pow(physicalSize, 3); - c31 /= vcl_pow(physicalSize, 3); - c40 /= vcl_pow(physicalSize, 3); + c12 /= std::pow(physicalSize, 5.0 / 2); + c21 /= std::pow(physicalSize, 5.0 / 2); + c30 /= std::pow(physicalSize, 5.0 / 2); + c22 /= std::pow(physicalSize, 3); + c31 /= std::pow(physicalSize, 3); + c40 /= std::pow(physicalSize, 3); lo->SetAttribute("SHAPE::Flusser01", c11.real()); lo->SetAttribute("SHAPE::Flusser02", (c21 * c12).real()); - lo->SetAttribute("SHAPE::Flusser03", (c20 * vcl_pow(c12, 2)).real()); - lo->SetAttribute("SHAPE::Flusser04", (c20 * vcl_pow(c12, 2)).imag()); - lo->SetAttribute("SHAPE::Flusser05", (c30 * vcl_pow(c12, 3)).real()); - lo->SetAttribute("SHAPE::Flusser06", (c30 * vcl_pow(c12, 3)).imag()); + lo->SetAttribute("SHAPE::Flusser03", (c20 * std::pow(c12, 2)).real()); + lo->SetAttribute("SHAPE::Flusser04", (c20 * std::pow(c12, 2)).imag()); + lo->SetAttribute("SHAPE::Flusser05", (c30 * std::pow(c12, 3)).real()); + lo->SetAttribute("SHAPE::Flusser06", (c30 * std::pow(c12, 3)).imag()); lo->SetAttribute("SHAPE::Flusser07", c22.real()); - lo->SetAttribute("SHAPE::Flusser08", (c31 * vcl_pow(c12, 2)).real()); - lo->SetAttribute("SHAPE::Flusser09", (c31 * vcl_pow(c12, 2)).imag()); - lo->SetAttribute("SHAPE::Flusser10", (c40 * vcl_pow(c12, 4)).real()); - lo->SetAttribute("SHAPE::Flusser11", (c40 * vcl_pow(c12, 4)).imag()); + lo->SetAttribute("SHAPE::Flusser08", (c31 * std::pow(c12, 2)).real()); + lo->SetAttribute("SHAPE::Flusser09", (c31 * std::pow(c12, 2)).imag()); + lo->SetAttribute("SHAPE::Flusser10", (c40 * std::pow(c12, 4)).real()); + lo->SetAttribute("SHAPE::Flusser11", (c40 * std::pow(c12, 4)).imag()); } } @@ -622,7 +622,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> double length = 0; for (DimensionType i = 0; i < LabelObjectType::ImageDimension; ++i) { - length += vcl_pow((iIt1->operator[] (i) - iIt2->operator[] (i)) * m_LabelImage->GetSignedSpacing()[i], 2); + length += std::pow((iIt1->operator[] (i) - iIt2->operator[] (i)) * m_LabelImage->GetSignedSpacing()[i], 2); } if (feretDiameter < length) { @@ -631,7 +631,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> } } // final computation - feretDiameter = vcl_sqrt(feretDiameter); + feretDiameter = std::sqrt(feretDiameter); // finally put the values in the label object lo->SetAttribute("SHAPE::FeretDiameter", feretDiameter); @@ -737,7 +737,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> // a data structure to store the number of intercepts on each direction typedef typename std::map<OffsetType, itk::SizeValueType, typename OffsetType::LexicographicCompare> MapInterceptType; MapInterceptType intercepts; - // int nbOfDirections = (int)vcl_pow( 2.0, (int)ImageDimension ) - 1; + // int nbOfDirections = (int)std::pow( 2.0, (int)ImageDimension ) - 1; // intecepts.resize(nbOfDirections + 1); // code begins at position 1 // now iterate over the vectors of lines @@ -922,10 +922,10 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> double dx = spacing[0]; double dy = spacing[1]; double dz = spacing[2]; - double dxy = vcl_sqrt( spacing[0]*spacing[0] + spacing[1]*spacing[1] ); - double dxz = vcl_sqrt( spacing[0]*spacing[0] + spacing[2]*spacing[2] ); - double dyz = vcl_sqrt( spacing[1]*spacing[1] + spacing[2]*spacing[2] ); - double dxyz = vcl_sqrt( spacing[0]*spacing[0] + spacing[1]*spacing[1] + spacing[2]*spacing[2] ); + double dxy = std::sqrt( spacing[0]*spacing[0] + spacing[1]*spacing[1] ); + double dxz = std::sqrt( spacing[0]*spacing[0] + spacing[2]*spacing[2] ); + double dyz = std::sqrt( spacing[1]*spacing[1] + spacing[2]*spacing[2] ); + double dxyz = std::sqrt( spacing[0]*spacing[0] + spacing[1]*spacing[1] + spacing[2]*spacing[2] ); double vol = spacing[0]*spacing[1]*spacing[2]; // 'magical numbers', corresponding to area of voronoi partition on the @@ -1005,7 +1005,7 @@ double ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> } else { - return otb::CONST_SQRTPI * doubleFactorial(n) / vcl_pow(2, (n + 1) / 2.0); + return otb::CONST_SQRTPI * doubleFactorial(n) / std::pow(2, (n + 1) / 2.0); } } @@ -1014,8 +1014,8 @@ template <class TLabelObject, class TLabelImage> double ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> ::hyperSphereVolume(double radius) { - return vcl_pow(otb::CONST_PI, LabelObjectType::ImageDimension / - 2.0) * vcl_pow(radius, LabelObjectType::ImageDimension) / gammaN2p1(LabelObjectType::ImageDimension); + return std::pow(otb::CONST_PI, LabelObjectType::ImageDimension / + 2.0) * std::pow(radius, LabelObjectType::ImageDimension) / gammaN2p1(LabelObjectType::ImageDimension); } /** Convenience internal method */ @@ -1031,8 +1031,8 @@ template <class TLabelObject, class TLabelImage> double ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> ::hyperSphereRadiusFromVolume(double volume) { - return vcl_pow(volume * gammaN2p1(LabelObjectType::ImageDimension) / - vcl_pow(otb::CONST_PI, LabelObjectType::ImageDimension / 2.0), 1.0 / LabelObjectType::ImageDimension); + return std::pow(volume * gammaN2p1(LabelObjectType::ImageDimension) / + std::pow(otb::CONST_PI, LabelObjectType::ImageDimension / 2.0), 1.0 / LabelObjectType::ImageDimension); } } // End namespace Functor diff --git a/Modules/Core/LabelMap/include/otbStatisticsAttributesLabelMapFilter.hxx b/Modules/Core/LabelMap/include/otbStatisticsAttributesLabelMapFilter.hxx index ab497246c877b4eaf7389f6f7af9c5016dcd6ece..b3b75dcc2826defbbd44fc75bb84b44df2f07511 100644 --- a/Modules/Core/LabelMap/include/otbStatisticsAttributesLabelMapFilter.hxx +++ b/Modules/Core/LabelMap/include/otbStatisticsAttributesLabelMapFilter.hxx @@ -159,13 +159,13 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> // final computations const double mean = sum / totalFreq; const double variance = (sum2 - (sum * sum / totalFreq)) / (totalFreq - 1); - const double sigma = vcl_sqrt(variance); + const double sigma = std::sqrt(variance); const double mean2 = mean * mean; double skewness = 0; double kurtosis = 0; const double epsilon = 1E-10; - if (vcl_abs(variance) > epsilon) + if (std::abs(variance) > epsilon) { skewness = ((sum3 - 3.0 * mean * sum2) / totalFreq + 2.0 * mean * mean2) / (variance * sigma); kurtosis = ((sum4 - 4.0 * mean * sum3 + 6.0 * mean2 * sum2) / totalFreq - 3.0 * mean2 * mean2) / (variance @@ -217,7 +217,7 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> vnl_diag_matrix<double> pm = eigen.D; for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { - // principalMoments[i] = 4 * vcl_sqrt( pm(i, i) ); + // principalMoments[i] = 4 * std::sqrt( pm(i, i) ); principalMoments[i] = pm(i, i); } principalAxes = eigen.V.transpose(); @@ -226,7 +226,7 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> // by multiplying the last row by the determinant vnl_real_eigensystem eigenrot(principalAxes.GetVnlMatrix()); vnl_diag_matrix<vcl_complex<double> > eigenval = eigenrot.D; - vcl_complex<double> det(1.0, 0.0); + std::complex<double> det(1.0, 0.0); for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { @@ -241,7 +241,7 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> if (principalMoments[0] != 0) { // elongation = principalMoments[TFeatureImage::ImageDimension-1] / principalMoments[0]; - elongation = vcl_sqrt(principalMoments[TFeatureImage::ImageDimension - 1] / principalMoments[0]); + elongation = std::sqrt(principalMoments[TFeatureImage::ImageDimension - 1] / principalMoments[0]); } } else diff --git a/Modules/Core/Metadata/src/otbFormosatImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbFormosatImageMetadataInterface.cxx index ecbd6bd8995add1062b0bb5d59817bf0a0c2c138..6035025c9feaacdc63b8ac0b042b000cc5f016f3 100644 --- a/Modules/Core/Metadata/src/otbFormosatImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbFormosatImageMetadataInterface.cxx @@ -585,7 +585,7 @@ FormosatImageMetadataInterface::GetSatAzimuth() const valueString = imageKeywordlist.GetMetadataByKey("support_data.scene_orientation"); double sceneOrientation( atof(valueString.c_str()) ); - double alpha = vcl_atan( vcl_tan( viewingAngleAcrossTrack * CONST_PI_180 ) / vcl_tan( viewingAngleAlongTrack * CONST_PI_180 ) ) * CONST_180_PI; + double alpha = std::atan( std::tan( viewingAngleAcrossTrack * CONST_PI_180 ) / std::tan( viewingAngleAlongTrack * CONST_PI_180 ) ) * CONST_180_PI; if( viewingAngleAlongTrack < 0 ) { diff --git a/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx index 4eda669a8db48701c26ab857f28d2ab8ce2a7405..7e5c6e835a6b995eb18b5e644c2679ba89aa866a 100644 --- a/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx @@ -168,7 +168,7 @@ PleiadesImageMetadataInterface::GetSolarIrradiance() const if (outputValues.size() == 1) { // Pan - if (vcl_abs(outputValues[0] - defaultRadianceP) > (tolerance * defaultRadianceP)) + if (std::abs(outputValues[0] - defaultRadianceP) > (tolerance * defaultRadianceP)) { outputValuesVariableLengthVector[0] = defaultRadianceP; } @@ -183,7 +183,7 @@ PleiadesImageMetadataInterface::GetSolarIrradiance() const for (unsigned int i = 0; i < outputValues.size(); ++i) { int wavelenghPos = this->BandIndexToWavelengthPosition(i); - if (vcl_abs(outputValues[wavelenghPos] - defaultRadianceMS[wavelenghPos]) > + if (std::abs(outputValues[wavelenghPos] - defaultRadianceMS[wavelenghPos]) > (tolerance * defaultRadianceMS[wavelenghPos])) { outputValuesVariableLengthVector[i] = defaultRadianceMS[wavelenghPos]; @@ -762,7 +762,7 @@ PleiadesImageMetadataInterface::GetSatAzimuth() const //Compute Satellite azimuthal angle using the azimuthal angle and the along //and across track incidence angle - double satAz = (cap - vcl_atan2(vcl_tan(ortho * CONST_PI_180),vcl_tan(along * CONST_PI_180)) * CONST_180_PI); + double satAz = (cap - std::atan2(std::tan(ortho * CONST_PI_180),std::tan(along * CONST_PI_180)) * CONST_180_PI); satAz = fmod(satAz,360); diff --git a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.hxx b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.hxx index 1557397fd37a8c916d6031bcc1698a3162efe039..16e3e46de47070b6607f8f8303eb76b7a667b555 100644 --- a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.hxx +++ b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.hxx @@ -70,11 +70,11 @@ ObjectListToObjectListFilter<TInputList, TOutputList> unsigned int& startIndex, unsigned int& stopIndex) { - startIndex = static_cast<unsigned int>(vcl_floor( + startIndex = static_cast<unsigned int>(std::floor( requestedElements * static_cast<double>(threadId) / static_cast<double>(threadCount) + 0.5 )); - stopIndex = static_cast<unsigned int>(vcl_floor( + stopIndex = static_cast<unsigned int>(std::floor( requestedElements * static_cast<double>(threadId + 1) / static_cast<double>(threadCount) + 0.5 )); diff --git a/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx b/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx index 3c71a6fb40fcf854679cfa95ad6d346d07cc3e45..9ac44aeef49112dd1c690bb3b8e3aecd1febc9cd 100644 --- a/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx +++ b/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx @@ -336,9 +336,9 @@ ImageToPointSetFilter<TInputImage, TOutputPointSet> // determine the actual number of pieces that will be generated typename TInputImage::SizeType::SizeValueType range = requestedRegionSize[splitAxis]; - int valuesPerThread = (int) ::vcl_ceil(range / (double) num); + int valuesPerThread = (int) ::std::ceil(range / (double) num); int maxThreadIdUsed = - (int) ::vcl_ceil(range / (double) valuesPerThread) - 1; + (int) ::std::ceil(range / (double) valuesPerThread) - 1; // Split the region if (i < maxThreadIdUsed) diff --git a/Modules/Core/PointSet/include/otbSimplePointCountStrategy.h b/Modules/Core/PointSet/include/otbSimplePointCountStrategy.h index f6f810929692facd7aba29c370e81594a45cd73b..f45c78e08a863d76f396bbd536e4a163fb047796 100644 --- a/Modules/Core/PointSet/include/otbSimplePointCountStrategy.h +++ b/Modules/Core/PointSet/include/otbSimplePointCountStrategy.h @@ -61,7 +61,7 @@ public: { float distX2 = (index[0] - it.Value()[0]) * (index[0] - it.Value()[0]); float distY2 = (index[1] - it.Value()[1]) * (index[1] - it.Value()[1]); - float dist = vcl_sqrt(distX2 + distY2); + float dist = std::sqrt(distX2 + distY2); if (dist <= size) accu++; diff --git a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx index f03179f78dd089dd677730ad301cf720ac656da6..b00c3c64de2d82a5d6fe749476029a326dcdff48 100644 --- a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx +++ b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx @@ -300,7 +300,7 @@ DrawLineSpatialObjectListFilter<TInputImage, TOutput> /** Equation of the first Line*/ - if (vcl_abs((*otherIndex)[0] - (*indexToCrop)[0]) < 1e-4) tempOtherIndexX = 0.000001; + if (std::abs((*otherIndex)[0] - (*indexToCrop)[0]) < 1e-4) tempOtherIndexX = 0.000001; else tempOtherIndexX = static_cast<double>((*otherIndex)[0]); if ((*indexToCrop)[0] < (*otherIndex)[0]) lengthSegment = (*otherIndex)[1] - (*indexToCrop)[1]; diff --git a/Modules/Core/Streaming/include/otbNumberOfLinesStrippedStreamingManager.hxx b/Modules/Core/Streaming/include/otbNumberOfLinesStrippedStreamingManager.hxx index c7a78ed14dbc323a7bf2c9f355b4998b2eb6904b..d266a787513799f83213b81512da00dbcba2aed0 100644 --- a/Modules/Core/Streaming/include/otbNumberOfLinesStrippedStreamingManager.hxx +++ b/Modules/Core/Streaming/include/otbNumberOfLinesStrippedStreamingManager.hxx @@ -54,7 +54,7 @@ NumberOfLinesStrippedStreamingManager<TImage>::PrepareStreaming( itk::DataObject if (numberLinesOfRegion > m_NumberOfLinesPerStrip && m_NumberOfLinesPerStrip > 0) { nbSplit = - static_cast<unsigned long>(vcl_ceil(static_cast<double>(numberLinesOfRegion) / + static_cast<unsigned long>(std::ceil(static_cast<double>(numberLinesOfRegion) / static_cast<double>(m_NumberOfLinesPerStrip) ) ); } else diff --git a/Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx b/Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx index 739ae1acc1a9742d35f09c1cda6abfd7855f77e5..5894d1089d669f7e856f3020283ae70dae30e7c7 100644 --- a/Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx +++ b/Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx @@ -33,8 +33,8 @@ namespace otb { -const double PipelineMemoryPrintCalculator::ByteToMegabyte = 1./vcl_pow(2.0, 20); -const double PipelineMemoryPrintCalculator::MegabyteToByte = vcl_pow(2.0, 20); +const double PipelineMemoryPrintCalculator::ByteToMegabyte = 1./std::pow(2.0, 20); +const double PipelineMemoryPrintCalculator::MegabyteToByte = std::pow(2.0, 20); PipelineMemoryPrintCalculator ::PipelineMemoryPrintCalculator() @@ -54,7 +54,7 @@ PipelineMemoryPrintCalculator ::EstimateOptimalNumberOfStreamDivisions(MemoryPrintType memoryPrint, MemoryPrintType availableMemory) { unsigned long divisions; - divisions = vcl_ceil(static_cast<double>(memoryPrint) + divisions = std::ceil(static_cast<double>(memoryPrint) / availableMemory); return divisions; } diff --git a/Modules/Core/Transform/include/otbImageToGenericRSOutputParameters.hxx b/Modules/Core/Transform/include/otbImageToGenericRSOutputParameters.hxx index 3a5293cb2d0faf6baa3cb1c6c6f6a69c494a57ad..eac643c4091f2f9851793f4beded25b8b5849d35 100644 --- a/Modules/Core/Transform/include/otbImageToGenericRSOutputParameters.hxx +++ b/Modules/Core/Transform/include/otbImageToGenericRSOutputParameters.hxx @@ -186,8 +186,8 @@ ImageToGenericRSOutputParameters<TImage> ::EstimateOutputSpacing() { // Compute the output size - double sizeCartoX = vcl_abs(m_OutputExtent.maxX - m_OutputExtent.minX); - double sizeCartoY = vcl_abs(m_OutputExtent.minY - m_OutputExtent.maxY); + double sizeCartoX = std::abs(m_OutputExtent.maxX - m_OutputExtent.minX); + double sizeCartoY = std::abs(m_OutputExtent.minY - m_OutputExtent.maxY); PointType o, oX, oY; o[0] = m_OutputExtent.minX; @@ -213,11 +213,11 @@ ImageToGenericRSOutputParameters<TImage> // Evaluate Ox and Oy length in number of pixels double OxLength, OyLength; - OxLength = vcl_sqrt(vcl_pow((double) ioIndex[0] - (double) ioXIndex[0], 2) - + vcl_pow((double) ioIndex[1] - (double) ioXIndex[1], 2)); + OxLength = std::sqrt(std::pow((double) ioIndex[0] - (double) ioXIndex[0], 2) + + std::pow((double) ioIndex[1] - (double) ioXIndex[1], 2)); - OyLength = vcl_sqrt(vcl_pow((double) ioIndex[0] - (double) ioYIndex[0], 2) - + vcl_pow((double) ioIndex[1] - (double) ioYIndex[1], 2)); + OyLength = std::sqrt(std::pow((double) ioIndex[0] - (double) ioYIndex[0], 2) + + std::pow((double) ioIndex[1] - (double) ioYIndex[1], 2)); // Evaluate spacing SpacingType outputSpacing; @@ -248,13 +248,13 @@ ImageToGenericRSOutputParameters<TImage> ::EstimateOutputSize() { // Compute the output size - double sizeCartoX = vcl_abs(m_OutputExtent.maxX - m_OutputExtent.minX); - double sizeCartoY = vcl_abs(m_OutputExtent.minY - m_OutputExtent.maxY); + double sizeCartoX = std::abs(m_OutputExtent.maxX - m_OutputExtent.minX); + double sizeCartoY = std::abs(m_OutputExtent.minY - m_OutputExtent.maxY); // Evaluate output size SizeType outputSize; - outputSize[0] = static_cast<unsigned int>(vcl_floor(vcl_abs(sizeCartoX / this->GetOutputSpacing()[0]))); - outputSize[1] = static_cast<unsigned int>(vcl_floor(vcl_abs(sizeCartoY / this->GetOutputSpacing()[1]))); + outputSize[0] = static_cast<unsigned int>(std::floor(std::abs(sizeCartoX / this->GetOutputSpacing()[0]))); + outputSize[1] = static_cast<unsigned int>(std::floor(std::abs(sizeCartoY / this->GetOutputSpacing()[1]))); // if ForceSizeTo used don't update the output size with the value // computed : the value is computed to update the spacing knowing diff --git a/Modules/Core/Transform/include/otbInverseLogPolarTransform.hxx b/Modules/Core/Transform/include/otbInverseLogPolarTransform.hxx index 4859dc052642160b7d4add53f7bfb0910fe964e7..5f655c08751c18b2abdd66cf9fc73d05db3ea25f 100644 --- a/Modules/Core/Transform/include/otbInverseLogPolarTransform.hxx +++ b/Modules/Core/Transform/include/otbInverseLogPolarTransform.hxx @@ -95,10 +95,10 @@ InverseLogPolarTransform<TScalarType> ::TransformPoint(const InputPointType& point) const { OutputPointType result; - double rho = vcl_sqrt(vcl_pow(point[0] - m_Center[0], 2) + vcl_pow(point[1] - m_Center[1], 2)); + double rho = std::sqrt(std::pow(point[0] - m_Center[0], 2) + std::pow(point[1] - m_Center[1], 2)); if (rho > 0) { - result[0] = (1. / m_Scale[0]) * vcl_asin((point[1] - m_Center[1]) / rho); + result[0] = (1. / m_Scale[0]) * std::asin((point[1] - m_Center[1]) / rho); // degree conversion result[0] = result[0] * (180. / CONST_PI); // Deplacing the range to [0, 90], [270, 360] @@ -108,8 +108,8 @@ InverseLogPolarTransform<TScalarType> { result[0] = result[0] < 90. ? result[0] + 90. : result[0] - 90.; } - result[1] = (1. / m_Scale[1]) * vcl_log(rho); - // otbMsgDebugMacro(<<vcl_log(vcl_pow(point[0]-m_Center[0], 2)+vcl_pow(point[1]-m_Center[1], 2))); + result[1] = (1. / m_Scale[1]) * std::log(rho); + // otbMsgDebugMacro(<<std::log(std::pow(point[0]-m_Center[0], 2)+std::pow(point[1]-m_Center[1], 2))); } else { @@ -131,10 +131,10 @@ InverseLogPolarTransform<TScalarType> ::TransformVector(const InputVectorType& vector) const { OutputVectorType result; - double rho = vcl_sqrt(vcl_pow(vector[0] - m_Center[0], 2) + vcl_pow(vector[1] - m_Center[1], 2)); + double rho = std::sqrt(std::pow(vector[0] - m_Center[0], 2) + std::pow(vector[1] - m_Center[1], 2)); if (rho > 0) { - result[0] = (1 / m_Scale[0]) * vcl_asin((vector[1] - m_Center[1]) / rho); + result[0] = (1 / m_Scale[0]) * std::asin((vector[1] - m_Center[1]) / rho); // degree conversion result[0] = result[0] * (180 / CONST_PI); // Deplacing the range to [0, 90], [270, 360] @@ -144,8 +144,8 @@ InverseLogPolarTransform<TScalarType> { result[0] = result[0] < 90 ? result[0] + 90 : result[0] - 90; } - result[1] = (1 / m_Scale[1]) * vcl_log(rho); - // otbMsgDebugMacro(<<vcl_log(vcl_pow(vector[0]-m_Center[0], 2)+vcl_pow(vector[1]-m_Center[1], 2))); + result[1] = (1 / m_Scale[1]) * std::log(rho); + // otbMsgDebugMacro(<<std::log(std::pow(vector[0]-m_Center[0], 2)+std::pow(vector[1]-m_Center[1], 2))); } else { @@ -167,21 +167,21 @@ InverseLogPolarTransform<TScalarType> ::TransformVector(const InputVnlVectorType& vector) const { OutputVnlVectorType result; - double rho = vcl_sqrt(vcl_pow(vector[0], 2) + vcl_pow(vector[1], 2)); + double rho = std::sqrt(std::pow(vector[0], 2) + std::pow(vector[1], 2)); if (rho > 0) { - result[0] = (1 / m_Scale[0]) * vcl_asin((vector[1] - m_Center[1]) / rho); + result[0] = (1 / m_Scale[0]) * std::asin((vector[1] - m_Center[1]) / rho); // degree conversion result[0] = result[0] * (180 / CONST_PI); // Deplacing the range to [0, 90], [270, 360] result[0] = result[0] > 0 ? result[0] : result[0] + 360; - // Avoiding vcl_asin indetermination + // Avoiding std::asin indetermination if ((vector[0] - m_Center[0]) >= 0) { result[0] = result[0] < 90 ? result[0] + 90 : result[0] - 90; } - result[1] = (1 / m_Scale[1]) * vcl_log(rho); - // otbMsgDebugMacro(<<log(vcl_pow(vector[0]-m_Center[0], 2)+vcl_pow(vector[1]-m_Center[1], 2))); + result[1] = (1 / m_Scale[1]) * std::log(rho); + // otbMsgDebugMacro(<<log(std::pow(vector[0]-m_Center[0], 2)+std::pow(vector[1]-m_Center[1], 2))); } else { diff --git a/Modules/Core/Transform/include/otbLogPolarTransform.hxx b/Modules/Core/Transform/include/otbLogPolarTransform.hxx index f49f3f13d8c74310c9725a717fda11687ca07a9b..4a2bafc5f12ccd05f285c705f79c09bcaf3e7de7 100644 --- a/Modules/Core/Transform/include/otbLogPolarTransform.hxx +++ b/Modules/Core/Transform/include/otbLogPolarTransform.hxx @@ -98,8 +98,8 @@ LogPolarTransform<TScalarType> double logRho = point[1] * m_Scale[1]; result[0] = m_Center[0]; result[1] = m_Center[1]; - result[0] += vcl_exp(logRho) * vcl_cos(theta); - result[1] += vcl_exp(logRho) * vcl_sin(theta); + result[0] += std::exp(logRho) * std::cos(theta); + result[1] += std::exp(logRho) * std::sin(theta); return result; } /** @@ -118,8 +118,8 @@ LogPolarTransform<TScalarType> double logRho = vector[1] * m_Scale[1]; result[0] = 0.; result[1] = 0.; - result[0] += vcl_exp(logRho) * vcl_cos(theta); - result[1] += vcl_exp(logRho) * vcl_sin(theta); + result[0] += std::exp(logRho) * std::cos(theta); + result[1] += std::exp(logRho) * std::sin(theta); return result; } @@ -139,8 +139,8 @@ LogPolarTransform<TScalarType> double logRho = vector[1] * m_Scale[1]; result[0] = 0.; result[1] = 0.; - result[0] += vcl_exp(logRho) * vcl_cos(theta); - result[1] += vcl_exp(logRho) * vcl_sin(theta); + result[0] += std::exp(logRho) * std::cos(theta); + result[1] += std::exp(logRho) * std::sin(theta); return result; } diff --git a/Modules/Core/Transform/test/otbInverseLogPolarTransform.cxx b/Modules/Core/Transform/test/otbInverseLogPolarTransform.cxx index 75dcd8168da005e80f4db68373a8d329825a1e29..347e652920ab9a3b9cce997e424ae66c7fb69591 100644 --- a/Modules/Core/Transform/test/otbInverseLogPolarTransform.cxx +++ b/Modules/Core/Transform/test/otbInverseLogPolarTransform.cxx @@ -64,11 +64,11 @@ int otbInverseLogPolarTransform(int itkNotUsed(argc), char* argv[]) { PointType p = transform->TransformPoint(*it); PointType pprime; - double rho = vcl_sqrt((*it)[0] * (*it)[0] + (*it)[1] * (*it)[1]); + double rho = std::sqrt((*it)[0] * (*it)[0] + (*it)[1] * (*it)[1]); if (rho > 0) { - pprime[0] = (1. / angularStep) * vcl_asin((*it)[1] / rho); + pprime[0] = (1. / angularStep) * std::asin((*it)[1] / rho); pprime[0] = pprime[0] * (180. / otb::CONST_PI); // Deplacing the range to [0, 90], [270, 360] pprime[0] = pprime[0] > 0. ? pprime[0] : pprime[0] + 360.; @@ -77,7 +77,7 @@ int otbInverseLogPolarTransform(int itkNotUsed(argc), char* argv[]) { pprime[0] = pprime[0] < 90. ? pprime[0] + 90. : pprime[0] - 90.; } - pprime[1] = (1. / radialStep) * vcl_log(rho); + pprime[1] = (1. / radialStep) * std::log(rho); } else { diff --git a/Modules/Core/Transform/test/otbInverseLogPolarTransformResample.cxx b/Modules/Core/Transform/test/otbInverseLogPolarTransformResample.cxx index 387467cacd457a3f0d3e4c04902f113a4091a07f..f686e231905c42d40faaaff9118ccba2a2d83a43 100644 --- a/Modules/Core/Transform/test/otbInverseLogPolarTransformResample.cxx +++ b/Modules/Core/Transform/test/otbInverseLogPolarTransformResample.cxx @@ -59,8 +59,8 @@ int otbInverseLogPolarTransformResample(int itkNotUsed(argc), char* argv[]) params[0] = 0.5 * static_cast<double>(size[0]); params[1] = 0.5 * static_cast<double>(size[1]); params[2] = 360. / reader->GetOutput()->GetLargestPossibleRegion().GetSize()[0]; - params[3] = vcl_log(vcl_sqrt(vcl_pow(static_cast<double>(size[0]), 2.) - + vcl_pow(static_cast<double>(size[1]), + params[3] = std::log(std::sqrt(std::pow(static_cast<double>(size[0]), 2.) + + std::pow(static_cast<double>(size[1]), 2.)) / 2) / reader->GetOutput()->GetLargestPossibleRegion().GetSize()[1]; transform->SetParameters(params); diff --git a/Modules/Core/Transform/test/otbLogPolarTransform.cxx b/Modules/Core/Transform/test/otbLogPolarTransform.cxx index cd94cedb37e9f921807fec9f1c1576808da5d08b..5ac0490e175e6ea64c57e3a507bd281402874065 100644 --- a/Modules/Core/Transform/test/otbLogPolarTransform.cxx +++ b/Modules/Core/Transform/test/otbLogPolarTransform.cxx @@ -71,8 +71,8 @@ int otbLogPolarTransform(int itkNotUsed(argc), char* argv[]) double logRho = (*it)[1] * radialStep; file << "Rho: " << logRho << ", Theta: " << theta << std::endl; - pprime[0] = vcl_exp(logRho) * vcl_cos(theta); - pprime[1] = vcl_exp(logRho) * vcl_sin(theta); + pprime[0] = std::exp(logRho) * std::cos(theta); + pprime[1] = std::exp(logRho) * std::sin(theta); file << "Original Point: " << (*it) << ", Reference point: " << pprime << ", Transformed point: " << p << std::endl << std::endl; diff --git a/Modules/Core/Transform/test/otbLogPolarTransformResample.cxx b/Modules/Core/Transform/test/otbLogPolarTransformResample.cxx index 4c62d60a8059be7b4bc9e34a09aa2b5466de3720..ea515b4c1c78fec52add87eeab1352c4d8dd8e52 100644 --- a/Modules/Core/Transform/test/otbLogPolarTransformResample.cxx +++ b/Modules/Core/Transform/test/otbLogPolarTransformResample.cxx @@ -57,8 +57,8 @@ int otbLogPolarTransformResample(int itkNotUsed(argc), char* argv[]) params[1] = 0.5 * static_cast<double>(reader->GetOutput()->GetLargestPossibleRegion().GetSize()[1]); params[2] = 360. / 1024; params[3] = - vcl_log(vcl_sqrt(vcl_pow(static_cast<double>(reader->GetOutput()->GetLargestPossibleRegion().GetSize()[0]), 2) - + vcl_pow(static_cast<double>(reader->GetOutput()->GetLargestPossibleRegion().GetSize()[ + std::log(std::sqrt(std::pow(static_cast<double>(reader->GetOutput()->GetLargestPossibleRegion().GetSize()[0]), 2) + + std::pow(static_cast<double>(reader->GetOutput()->GetLargestPossibleRegion().GetSize()[ 1]), 2)) / 2) / 512; transform->SetParameters(params); diff --git a/Modules/Core/VectorDataBase/include/otbPolyLineParametricPathWithValue.hxx b/Modules/Core/VectorDataBase/include/otbPolyLineParametricPathWithValue.hxx index d56e726d558eff28993d8a4ad75a85e6194a79e2..4ae777ff5c41d53b9441cd92fccb9d5e4fedbc59 100644 --- a/Modules/Core/VectorDataBase/include/otbPolyLineParametricPathWithValue.hxx +++ b/Modules/Core/VectorDataBase/include/otbPolyLineParametricPathWithValue.hxx @@ -84,7 +84,7 @@ PolyLineParametricPathWithValue<TValue, VDimension> { accum += (pt1[i] - pt2[i]) * (pt1[i] - pt2[i]); } - length += vcl_sqrt(accum); + length += std::sqrt(accum); ++it; } diff --git a/Modules/Core/VectorDataBase/include/otbPolygon.hxx b/Modules/Core/VectorDataBase/include/otbPolygon.hxx index ce58be44fde10cf8bb65d930969b68c73c0e15db..e1a18579dffab056dc03306ba64ffbdb6bd09647 100644 --- a/Modules/Core/VectorDataBase/include/otbPolygon.hxx +++ b/Modules/Core/VectorDataBase/include/otbPolygon.hxx @@ -57,7 +57,7 @@ Polygon<TValue> { double xb = it.Value()[0]; double yb = it.Value()[1]; - if (vcl_abs(xb - xa) < m_Epsilon) + if (std::abs(xb - xa) < m_Epsilon) { if (ya > yb && xa > x && y >= yb && y < ya) { @@ -68,7 +68,7 @@ Polygon<TValue> ++crossingCount; } } - else if (vcl_abs(yb - ya) >= m_Epsilon) + else if (std::abs(yb - ya) >= m_Epsilon) { double xcross = xa + (xb - xa) * (y - ya) / (yb - ya); @@ -87,7 +87,7 @@ Polygon<TValue> } double xb = this->GetVertexList()->Begin().Value()[0]; double yb = this->GetVertexList()->Begin().Value()[1]; - if (vcl_abs(xb - xa) < m_Epsilon) + if (std::abs(xb - xa) < m_Epsilon) { if (ya > yb && xa > x && y >= yb && y < ya) { @@ -98,7 +98,7 @@ Polygon<TValue> ++crossingCount; } } - else if (vcl_abs(yb - ya) >= m_Epsilon) + else if (std::abs(yb - ya) >= m_Epsilon) { double xcross = xa + (xb - xa) * (y - ya) / (yb - ya); @@ -140,13 +140,13 @@ Polygon<TValue> { xb = it.Value()[0]; yb = it.Value()[1]; - if (vcl_abs(xb - xa) >= m_Epsilon) + if (std::abs(xb - xa) >= m_Epsilon) { double cd = (yb - ya) / (xb - xa); double oo = (ya - cd * xa); double xmin = std::min(xa, xb); double xmax = std::max(xa, xb); - if ((vcl_abs(y - cd * x - oo) < m_Epsilon) + if ((std::abs(y - cd * x - oo) < m_Epsilon) && (x <= xmax) && (x >= xmin)) { @@ -158,7 +158,7 @@ Polygon<TValue> { double ymin = std::min(ya, yb); double ymax = std::max(ya, yb); - if ((vcl_abs(x - xa) < m_Epsilon) + if ((std::abs(x - xa) < m_Epsilon) && (y <= ymax) && (y >= ymin)) { @@ -172,14 +172,14 @@ Polygon<TValue> } xb = xbegin; yb = ybegin; - if (vcl_abs(xb - xa) >= m_Epsilon) + if (std::abs(xb - xa) >= m_Epsilon) { double cd = (yb - ya) / (xb - xa); double oo = (ya - cd * xa); double xmin = std::min(xa, xb); double xmax = std::max(xa, xb); - if ((vcl_abs(y - cd * x - oo) < m_Epsilon) + if ((std::abs(y - cd * x - oo) < m_Epsilon) && (x <= xmax) && (x >= xmin)) { @@ -191,7 +191,7 @@ Polygon<TValue> { double ymin = std::min(ya, yb); double ymax = std::max(ya, yb); - if ((vcl_abs(x - xa) <= m_Epsilon) + if ((std::abs(x - xa) <= m_Epsilon) && (y <= ymax) && (y >= ymin)) { @@ -292,11 +292,11 @@ Polygon<TValue> double xamax = std::max(a1[0], a2[0]); double yamin = std::min(a1[1], a2[1]); double yamax = std::max(a1[1], a2[1]); - if (vcl_abs(a1[0] - a2[0]) < m_Epsilon && vcl_abs(b1[0] - b2[0]) < m_Epsilon) + if (std::abs(a1[0] - a2[0]) < m_Epsilon && std::abs(b1[0] - b2[0]) < m_Epsilon) { resp = false; } - else if (vcl_abs(a1[0] - a2[0]) < m_Epsilon) + else if (std::abs(a1[0] - a2[0]) < m_Epsilon) { double cd2 = (b2[1] - b1[1]) / (b2[0] - b1[0]); double oo2 = b1[1] - cd2 * b1[0]; @@ -304,7 +304,7 @@ Polygon<TValue> resp = (xbmin <a1[0] && xbmax> a1[0] && yamin <ycross && yamax> ycross); } - else if (vcl_abs(b1[0] - b2[0]) < m_Epsilon) + else if (std::abs(b1[0] - b2[0]) < m_Epsilon) { double cd1 = (a2[1] - a1[1]) / (a2[0] - a1[0]); double oo1 = a1[1] - cd1 * a1[0]; @@ -349,38 +349,38 @@ Polygon<TValue> double xamax = std::max(a1[0], a2[0]); double yamin = std::min(a1[1], a2[1]); double yamax = std::max(a1[1], a2[1]); - if (vcl_abs(a1[0] - a2[0]) < m_Epsilon && vcl_abs(b1[0] - b2[0]) < m_Epsilon) + if (std::abs(a1[0] - a2[0]) < m_Epsilon && std::abs(b1[0] - b2[0]) < m_Epsilon) { - resp = (vcl_abs(a1[0] - b1[0]) < m_Epsilon) + resp = (std::abs(a1[0] - b1[0]) < m_Epsilon) && ((a1[1] <= ybmax && a1[1] >= ybmin) || (a2[1] <= ybmax && a2[1] >= ybmin) || (b1[1] <= yamax && b1[1] >= yamin) || (b2[1] <= yamax && b2[1] >= yamin)); } - else if (vcl_abs(a1[0] - a2[0]) < m_Epsilon) + else if (std::abs(a1[0] - a2[0]) < m_Epsilon) { double cd2 = (b2[1] - b1[1]) / (b2[0] - b1[0]); double oo2 = b1[1] - cd2 * b1[0]; - if (vcl_abs(a1[1] - cd2 * a1[0] - oo2) < m_Epsilon) + if (std::abs(a1[1] - cd2 * a1[0] - oo2) < m_Epsilon) { resp = (a1[0] >= xbmin && a1[0] <= xbmax); } - else if (vcl_abs(a2[1] - cd2 * a2[0] - oo2) < m_Epsilon) + else if (std::abs(a2[1] - cd2 * a2[0] - oo2) < m_Epsilon) { resp = (a2[0] >= xbmin && a2[0] <= xbmax); } } - else if (vcl_abs(b1[0] - b2[0]) < m_Epsilon) + else if (std::abs(b1[0] - b2[0]) < m_Epsilon) { double cd1 = (a2[1] - a1[1]) / (a2[0] - a1[0]); double oo1 = a1[1] - cd1 * a1[0]; - if (vcl_abs(b1[1] - cd1 * b1[0] - oo1) < m_Epsilon) + if (std::abs(b1[1] - cd1 * b1[0] - oo1) < m_Epsilon) { resp = (b1[0] >= xamin && b1[0] <= xamax); } - else if (vcl_abs(b2[1] - cd1 * b2[0] - oo1) < m_Epsilon) + else if (std::abs(b2[1] - cd1 * b2[0] - oo1) < m_Epsilon) { resp = (b2[0] >= xamin && b2[0] <= xamax); } @@ -391,7 +391,7 @@ Polygon<TValue> double oo1 = a1[1] - cd1 * a1[0]; double cd2 = (b2[1] - b1[1]) / (b2[0] - b1[0]); double oo2 = b1[1] - cd2 * b1[0]; - if (vcl_abs(cd1 - cd2) < m_Epsilon && vcl_abs(oo1 - oo2) < m_Epsilon) + if (std::abs(cd1 - cd2) < m_Epsilon && std::abs(oo1 - oo2) < m_Epsilon) { resp = ((xamin <= xbmax && xamin >= xbmin) || (xamax <= xbmax && xamax >= xbmin) @@ -400,19 +400,19 @@ Polygon<TValue> } else { - if (vcl_abs(a1[1] - cd2 * a1[0] - oo2) < m_Epsilon) + if (std::abs(a1[1] - cd2 * a1[0] - oo2) < m_Epsilon) { resp = (a1[0] >= xbmin && a1[0] <= xbmax); } - else if (vcl_abs(a2[1] - cd2 * a2[0] - oo2) < m_Epsilon) + else if (std::abs(a2[1] - cd2 * a2[0] - oo2) < m_Epsilon) { resp = (a2[0] >= xbmin && a2[0] <= xbmax); } - if (vcl_abs(b1[1] - cd1 * b1[0] - oo1) < m_Epsilon) + if (std::abs(b1[1] - cd1 * b1[0] - oo1) < m_Epsilon) { resp = (b1[0] >= xamin && b1[0] <= xamax); } - else if (vcl_abs(b2[1] - cd1 * b2[0] - oo1) < m_Epsilon) + else if (std::abs(b2[1] - cd1 * b2[0] - oo1) < m_Epsilon) { resp = (b2[0] >= xamin && b2[0] <= xamax); } @@ -506,7 +506,7 @@ double Polygon<TValue> { accum += (pt1[i] - pt2[i]) * (pt1[i] - pt2[i]); } - length += vcl_sqrt(accum); + length += std::sqrt(accum); ++it; } @@ -516,7 +516,7 @@ double Polygon<TValue> { accum += (origin[i] - pt2[i]) * (origin[i] - pt2[i]); } - length += vcl_sqrt(accum); + length += std::sqrt(accum); } else //if there is strictly less than 2 points, length is 0 diff --git a/Modules/Detection/CloudDetection/include/otbCloudEstimatorFunctor.h b/Modules/Detection/CloudDetection/include/otbCloudEstimatorFunctor.h index f47bb8dba235976bcd5d4c0e35cebf67f7bc12af..0134e24b75da3695b2e477bea493cc8c0f23cd8b 100644 --- a/Modules/Detection/CloudDetection/include/otbCloudEstimatorFunctor.h +++ b/Modules/Detection/CloudDetection/include/otbCloudEstimatorFunctor.h @@ -66,8 +66,8 @@ public: { lCurPixNorm += inPix[i] * inPix[i]; } - lCurPixNorm = vcl_sqrt(static_cast<double>(lCurPixNorm)); - lGaussianCoef = vcl_exp(-vcl_pow((lCurPixNorm - m_RefNorm), 2) / m_Denom); + lCurPixNorm = std::sqrt(static_cast<double>(lCurPixNorm)); + lGaussianCoef = std::exp(-std::pow((lCurPixNorm - m_RefNorm), 2) / m_Denom); // Reverse the SpectralAngle values and set them between [0; 1] lRes = lGaussianCoef * ((CONST_PI - m_SpectralAngleFunctor(inPix)) / CONST_PI); @@ -86,7 +86,7 @@ public: { m_RefNorm += ref[i] * ref[i]; } - m_RefNorm = vcl_sqrt(static_cast<double>(m_RefNorm)); + m_RefNorm = std::sqrt(static_cast<double>(m_RefNorm)); SetVariance(m_Variance); } diff --git a/Modules/Detection/RoadExtraction/include/otbBreakAngularPathListFilter.hxx b/Modules/Detection/RoadExtraction/include/otbBreakAngularPathListFilter.hxx index 902592407e9987d7d476c8cc7c4344e3b34527a0..f5edda5736ab992db5e69a32925dc143f2fe04ec 100644 --- a/Modules/Detection/RoadExtraction/include/otbBreakAngularPathListFilter.hxx +++ b/Modules/Detection/RoadExtraction/include/otbBreakAngularPathListFilter.hxx @@ -65,11 +65,11 @@ BreakAngularPathListFilter<TPath> { pixel3 = pathIt.Value(); - alpha1 = vcl_atan2((pixel1[1] - pixel2[1]), (pixel1[0] - pixel2[0])); - alpha2 = vcl_atan2((pixel2[1] - pixel3[1]), (pixel2[0] - pixel3[0])); + alpha1 = std::atan2((pixel1[1] - pixel2[1]), (pixel1[0] - pixel2[0])); + alpha2 = std::atan2((pixel2[1] - pixel3[1]), (pixel2[0] - pixel3[0])); alpha1 = (alpha1 >= 0) ? alpha1 : (alpha1 + CONST_2PI); alpha2 = (alpha2 >= 0) ? alpha2 : (alpha2 + CONST_2PI); - if (vcl_abs(alpha1 - alpha2) > static_cast<double>(maxAngle)) + if (std::abs(alpha1 - alpha2) > static_cast<double>(maxAngle)) { // Add Pixel 2 newPath->AddVertex(pixel2); diff --git a/Modules/Detection/RoadExtraction/include/otbImageToPathListAlignFilter.hxx b/Modules/Detection/RoadExtraction/include/otbImageToPathListAlignFilter.hxx index 632bba0fe8f6f2ba29d7294ae2fd48bd92941e3b..403c50f37f672e86ef34099c94a309d10a6a421b 100644 --- a/Modules/Detection/RoadExtraction/include/otbImageToPathListAlignFilter.hxx +++ b/Modules/Detection/RoadExtraction/include/otbImageToPathListAlignFilter.hxx @@ -306,7 +306,7 @@ ImageToPathListAlignFilter<TInputImage, TOutputPath> norm = gx * gx + gy * gy; if (norm <= threshold) m_AngleImage->SetPixel(adr, static_cast<RealType>(-1000.0)); - else m_AngleImage->SetPixel(adr, static_cast<RealType>(vcl_atan2(gx, -gy))); + else m_AngleImage->SetPixel(adr, static_cast<RealType>(std::atan2(gx, -gy))); } } @@ -346,12 +346,12 @@ ImageToPathListAlignFilter<TInputImage, TOutputPath> Taille = InputImage->GetLargestPossibleRegion().GetSize(); nx = Taille[0]; ny = Taille[1]; - max_nfa = vcl_pow(10.0, -(m_Eps)); + max_nfa = std::pow(10.0, -(m_Eps)); // typename InputImageType::IndexType adr; /*** maximal length for a line */ - n = (int) vcl_ceil(hypot((double) nx, (double) ny)) + 1; + n = (int) std::ceil(hypot((double) nx, (double) ny)) + 1; /*** compute angle map of u ***/ RealImageTypePointer lAngleImagePointer = RealImageType::New(); @@ -402,8 +402,8 @@ ImageToPathListAlignFilter<TInputImage, TOutputPath> printf("."); fflush(stdout); theta = theta0 + (double) (itheta) * dtheta; - dx = (double) vcl_cos((double) theta); - dy = (double) vcl_sin((double) theta); + dx = (double) std::cos((double) theta); + dy = (double) std::sin((double) theta); /*** third loop : start positions ***/ for (pos = 0; pos < posmax; ++pos) diff --git a/Modules/Detection/RoadExtraction/include/otbLinkPathListFilter.hxx b/Modules/Detection/RoadExtraction/include/otbLinkPathListFilter.hxx index 32b9450f7a4fa08f09ad6d0ae2d0a39bc1c1126c..a2b5ea019b3a809b7ff0d0b876a3204e2867e237 100644 --- a/Modules/Detection/RoadExtraction/include/otbLinkPathListFilter.hxx +++ b/Modules/Detection/RoadExtraction/include/otbLinkPathListFilter.hxx @@ -93,7 +93,7 @@ LinkPathListFilter<TPath> VertexType v3 = vTargetIt.Value(); ++vTargetIt; VertexType v4 = vTargetIt.Value(); - double tmpDistance = vcl_sqrt(vcl_pow(v2[0] - v3[0], 2) + vcl_pow(v2[1] - v3[1], 2)); + double tmpDistance = std::sqrt(std::pow(v2[0] - v3[0], 2) + std::pow(v2[1] - v3[1], 2)); if ((tmpDistance < static_cast<double>(m_DistanceThreshold)) && ((!found) || (tmpDistance < distance))) { if (VerifyAngularCondition(v1, v2, v3, v4)) @@ -116,7 +116,7 @@ LinkPathListFilter<TPath> v3 = vTargetIt.Value(); --vTargetIt; v4 = vTargetIt.Value(); - tmpDistance = vcl_sqrt(vcl_pow(v2[0] - v3[0], 2) + vcl_pow(v2[1] - v3[1], 2)); + tmpDistance = std::sqrt(std::pow(v2[0] - v3[0], 2) + std::pow(v2[1] - v3[1], 2)); if ((tmpDistance < static_cast<double>(m_DistanceThreshold)) && ((!found) || (tmpDistance < distance))) { @@ -139,7 +139,7 @@ LinkPathListFilter<TPath> v2 = vSourceIt.Value(); ++vSourceIt; v1 = vSourceIt.Value(); - tmpDistance = vcl_sqrt(vcl_pow(v2[0] - v3[0], 2) + vcl_pow(v2[1] - v3[1], 2)); + tmpDistance = std::sqrt(std::pow(v2[0] - v3[0], 2) + std::pow(v2[1] - v3[1], 2)); if ((tmpDistance < static_cast<double>(m_DistanceThreshold)) && ((!found) || (tmpDistance < distance))) { @@ -162,7 +162,7 @@ LinkPathListFilter<TPath> v3 = vTargetIt.Value(); ++vTargetIt; v4 = vTargetIt.Value(); - tmpDistance = vcl_sqrt(vcl_pow(v2[0] - v3[0], 2) + vcl_pow(v2[1] - v3[1], 2)); + tmpDistance = std::sqrt(std::pow(v2[0] - v3[0], 2) + std::pow(v2[1] - v3[1], 2)); if ((tmpDistance < static_cast<double>(m_DistanceThreshold)) && ((!found) || (tmpDistance < distance))) { if (VerifyAngularCondition(v1, v2, v3, v4)) @@ -229,9 +229,9 @@ bool LinkPathListFilter<TPath> ::VerifyAngularCondition(VertexType v1, VertexType v2, VertexType v3, VertexType v4) { - double alpha1 = vcl_atan2((v2[1] - v1[1]), (v2[0] - v1[0])); - double alpha2 = vcl_atan2((v4[1] - v3[1]), (v4[0] - v3[0])); - double alpha3 = vcl_atan2((v3[1] - v2[1]), (v3[0] - v2[0])); + double alpha1 = std::atan2((v2[1] - v1[1]), (v2[0] - v1[0])); + double alpha2 = std::atan2((v4[1] - v3[1]), (v4[0] - v3[0])); + double alpha3 = std::atan2((v3[1] - v2[1]), (v3[0] - v2[0])); if (m_ModuloPI) { @@ -246,9 +246,9 @@ LinkPathListFilter<TPath> alpha3 = (alpha3 >= 0) ? alpha3 : (alpha3 + CONST_2PI); } - bool resp = (vcl_abs(alpha1 - alpha2) < static_cast<double>(m_AngularThreshold)) - && (vcl_abs(alpha1 - alpha3) < static_cast<double>(m_AngularThreshold)) - && (vcl_abs(alpha2 - alpha3) < static_cast<double>(m_AngularThreshold)); + bool resp = (std::abs(alpha1 - alpha2) < static_cast<double>(m_AngularThreshold)) + && (std::abs(alpha1 - alpha3) < static_cast<double>(m_AngularThreshold)) + && (std::abs(alpha2 - alpha3) < static_cast<double>(m_AngularThreshold)); return resp; } /** diff --git a/Modules/Detection/RoadExtraction/include/otbParallelLinePathListFilter.hxx b/Modules/Detection/RoadExtraction/include/otbParallelLinePathListFilter.hxx index 95aa5a5e5082b4dca6a23d09580a292e92845dc9..eb7c3086379a20b1bad850a578cd8acc29c53955 100644 --- a/Modules/Detection/RoadExtraction/include/otbParallelLinePathListFilter.hxx +++ b/Modules/Detection/RoadExtraction/include/otbParallelLinePathListFilter.hxx @@ -188,15 +188,15 @@ bool ParallelLinePathListFilter<TPath> ::VerifyAngularCondition(VertexType v1, VertexType v2, VertexType v3, VertexType v4) { - double alpha1 = vcl_atan2((v2[1] - v1[1]), (v2[0] - v1[0])); - double alpha2 = vcl_atan2((v4[1] - v3[1]), (v4[0] - v3[0])); + double alpha1 = std::atan2((v2[1] - v1[1]), (v2[0] - v1[0])); + double alpha2 = std::atan2((v4[1] - v3[1]), (v4[0] - v3[0])); alpha1 = (alpha1 >= 0) ? alpha1 : (alpha1 + CONST_PI); alpha2 = (alpha2 >= 0) ? alpha2 : (alpha2 + CONST_PI); // Return true if the angle between the two lines is smaller than // the specified threshold. - bool angle = (vcl_abs(alpha1 - alpha2) < static_cast<double>(m_AngularThreshold)); + bool angle = (std::abs(alpha1 - alpha2) < static_cast<double>(m_AngularThreshold)); return angle; } @@ -226,7 +226,7 @@ ParallelLinePathListFilter<TPath> // Compute the orthogonal distance between the two parallel lines // with equation d = |(v3 - v1)X(v2 - v1)|/|v2 - v1| double distance = 0., denominator = 0., nominator = 0.; - denominator = vcl_abs((v3[0] - v1[0]) * vectorDir12[1] - (v3[1] - v1[1]) * vectorDir12[0]); + denominator = std::abs((v3[0] - v1[0]) * vectorDir12[1] - (v3[1] - v1[1]) * vectorDir12[0]); nominator = sqrt(pow(vectorDir12[0], 2) + pow(vectorDir12[1], 2)); distance = denominator / nominator; //std::cout<< "Distance between two parallel lines: " << distance <<std::endl; @@ -328,7 +328,7 @@ ParallelLinePathListFilter<TPath> { sinealpha = (v1[0] - v2[0]) / length12; } - double alpha1 = vcl_asin(sinealpha); + double alpha1 = std::asin(sinealpha); // Translation temptransv3[0] = v3[0] - v1[0]; @@ -382,7 +382,7 @@ ParallelLinePathListFilter<TPath> sinealpha = (v1[0] - v2[0]) / length12; } - double alpha1 = vcl_asin(sinealpha); + double alpha1 = std::asin(sinealpha); // Translation temptransv3[0] = v3[0] - v2[0]; @@ -420,7 +420,7 @@ ParallelLinePathListFilter<TPath> { if (tempv4[1] >= 0) { - commonDist = vcl_abs(tempv4[1] - tempv3[1]); + commonDist = std::abs(tempv4[1] - tempv3[1]); } else if (tempv4[1] < 0) @@ -444,7 +444,7 @@ ParallelLinePathListFilter<TPath> else if (tempv4[1] >= tempv2[1]) { // No overlapping parts exist. The (negative) distance // between the two closest endpoints is calculated. - commonDist = -vcl_abs(tempv4[1] - tempv2[1]); + commonDist = -std::abs(tempv4[1] - tempv2[1]); } else if (tempv3[1] < 0) { // No overlapping parts exist. The (negative) distance @@ -459,7 +459,7 @@ ParallelLinePathListFilter<TPath> { if (tempv3[1] >= 0) { - commonDist = vcl_abs(tempv3[1] - tempv4[1]); + commonDist = std::abs(tempv3[1] - tempv4[1]); } else if (tempv3[1] < 0) @@ -483,7 +483,7 @@ ParallelLinePathListFilter<TPath> else if (tempv3[1] >= tempv2[1]) { // No overlapping parts exist. The (negative) distance // between the two closest endpoints is calculated. - commonDist = -vcl_abs(tempv3[1] - tempv2[1]); + commonDist = -std::abs(tempv3[1] - tempv2[1]); } else if (tempv4[1] < 0) { // No overlapping parts exist. The (negative) distance diff --git a/Modules/Detection/UrbanArea/include/otbUrbanAreaDetectionImageFilter.h b/Modules/Detection/UrbanArea/include/otbUrbanAreaDetectionImageFilter.h index d4fdf9c0e228b9241318e9749474c885fa604508..a747383b911b32a6b814433e64008b30d78a395d 100644 --- a/Modules/Detection/UrbanArea/include/otbUrbanAreaDetectionImageFilter.h +++ b/Modules/Detection/UrbanArea/include/otbUrbanAreaDetectionImageFilter.h @@ -79,7 +79,7 @@ public: lVIval = static_cast<ValueType>(std::max(0., m_VegetationFunctor(pInPix))); lWIval = static_cast<ValueType>(std::max(0., m_WaterFunctor(pInPix))); - lOutPix = vcl_sqrt(vcl_abs((1 - lVIval) * (1 - lWIval))); + lOutPix = std::sqrt(std::abs((1 - lVIval) * (1 - lWIval))); } else lOutPix = 0; diff --git a/Modules/Feature/Corner/include/otbHarrisImageFilter.hxx b/Modules/Feature/Corner/include/otbHarrisImageFilter.hxx index 7b0795e59ad675476f4dc4b1c26d791915c5c539..79b7a8291d2b4dc14db3d89a7b0bb270625990c9 100644 --- a/Modules/Feature/Corner/include/otbHarrisImageFilter.hxx +++ b/Modules/Feature/Corner/include/otbHarrisImageFilter.hxx @@ -68,7 +68,7 @@ HarrisImageFilter<TInputImage, TOutputImage> m_HessianToScalarFilter->SetAlpha(this->m_Alpha); m_MultiplyScalarFilter->SetInput(m_HessianToScalarFilter->GetOutput()); - m_MultiplyScalarFilter->SetCoef(vcl_pow(m_SigmaD, 4.0)); + m_MultiplyScalarFilter->SetCoef(std::pow(m_SigmaD, 4.0)); m_MultiplyScalarFilter->GraftOutput(this->GetOutput()); m_MultiplyScalarFilter->Update(); diff --git a/Modules/Feature/Corner/include/otbLineSpatialObjectListToRightAnglePointSetFilter.hxx b/Modules/Feature/Corner/include/otbLineSpatialObjectListToRightAnglePointSetFilter.hxx index 704408cd77446bf9269a6b90b049d630c58b9346..1f321de6a56b434aac5128332e6926224652a180 100644 --- a/Modules/Feature/Corner/include/otbLineSpatialObjectListToRightAnglePointSetFilter.hxx +++ b/Modules/Feature/Corner/include/otbLineSpatialObjectListToRightAnglePointSetFilter.hxx @@ -111,7 +111,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage, TLinesList, TPointSet> double Angle = this->ComputeAngleFormedBySegments(*itLinesListTest, *itLinesListCur); /** Check if the angle is a right one */ - if (vcl_abs(Angle - CONST_PI_2) <= m_ThresholdAngle) + if (std::abs(Angle - CONST_PI_2) <= m_ThresholdAngle) { /** Right angle coordinate*/ PointType RightAngleCoordinate; @@ -122,7 +122,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage, TLinesList, TPointSet> double dist2 = this->ComputeDistanceFromPointToSegment(RightAngleCoordinate, *itLinesListCur); /** Use Pythagore to compute the distance between the two segments*/ - double SegmentDistance = vcl_sqrt(dist1 * dist1 + dist2 * dist2); + double SegmentDistance = std::sqrt(dist1 * dist1 + dist2 * dist2); // if(this->ComputeDistanceFromPointToSegment(RightAngleCoordinate, *itLinesListTest) <m_ThresholdDistance && // this->ComputeDistanceFromPointToSegment(RightAngleCoordinate, *itLinesListCur) <m_ThresholdDistance) @@ -159,8 +159,8 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage, TLinesList, TPointSet> double X2 = (*itPointsDst).GetPosition()[0]; //xq2 double Y2 = (*itPointsDst).GetPosition()[1]; //yq2 - double dist1 = vcl_sqrt((X1 - rAngle[0]) * (X1 - rAngle[0]) + (Y1 - rAngle[1]) * (Y1 - rAngle[1])); - double dist2 = vcl_sqrt((X2 - rAngle[0]) * (X2 - rAngle[0]) + (Y2 - rAngle[1]) * (Y2 - rAngle[1])); + double dist1 = std::sqrt((X1 - rAngle[0]) * (X1 - rAngle[0]) + (Y1 - rAngle[1]) * (Y1 - rAngle[1])); + double dist2 = std::sqrt((X2 - rAngle[0]) * (X2 - rAngle[0]) + (Y2 - rAngle[1]) * (Y2 - rAngle[1])); return std::min(dist1, dist2); } @@ -177,7 +177,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage, TLinesList, TPointSet> double oriDst = this->ComputeOrientation(lineDst); double oriSrc = this->ComputeOrientation(lineSrc); - return vcl_abs(oriDst - oriSrc); + return std::abs(oriDst - oriSrc); } /** @@ -200,7 +200,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage, TLinesList, TPointSet> //Compute the orientation double dx = Xp1 - Xp2; double dy = Yp1 - Yp2; - double orientation = vcl_atan2(dy, dx); + double orientation = std::atan2(dy, dx); if (orientation < 0) orientation += CONST_PI; return orientation; @@ -244,7 +244,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage, TLinesList, TPointSet> double LengthSegmentAy = 0., lengthSegmentBy = 0.; /** Equation of the first Line*/ - if (vcl_abs(Xp2 - Xp1) < 1e-10) Xp2 = 0.0001; + if (std::abs(Xp2 - Xp1) < 1e-10) Xp2 = 0.0001; if (Xp1 < Xp2) LengthSegmentAy = Yp2 - Yp1; else LengthSegmentAy = Yp1 - Yp2; @@ -253,7 +253,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage, TLinesList, TPointSet> originA = Yp1 - (slopeA * Xp1); /** Equation of the second Line*/ - if (vcl_abs(Xq2 - Xq1) < 1e-10) Xq2 = 0.0001; + if (std::abs(Xq2 - Xq1) < 1e-10) Xq2 = 0.0001; if (Xq1 < Xq2) lengthSegmentBy = Yq2 - Yq1; else lengthSegmentBy = Yq1 - Yq2; @@ -263,7 +263,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage, TLinesList, TPointSet> /** Avoid the case of parallel lines*/ double denum = 0.; - if (vcl_abs(slopeA - slopeB) < 1e-5) denum = 0.001; + if (std::abs(slopeA - slopeB) < 1e-5) denum = 0.001; else denum = slopeA - slopeB; /** Compute the coordinate of the intersection point Y =AX+B*/ diff --git a/Modules/Feature/Corner/include/otbVectorDataToRightAngleVectorDataFilter.hxx b/Modules/Feature/Corner/include/otbVectorDataToRightAngleVectorDataFilter.hxx index 9b8c19e6ba9839794097ff7ffe2c17ae62332047..991d492196cf1855a1ff5a040128135617771588 100644 --- a/Modules/Feature/Corner/include/otbVectorDataToRightAngleVectorDataFilter.hxx +++ b/Modules/Feature/Corner/include/otbVectorDataToRightAngleVectorDataFilter.hxx @@ -86,7 +86,7 @@ VectorDataToRightAngleVectorDataFilter<TVectorData> itVectorCur.Get()->GetLine()); // Check if the angle is a right one - if (vcl_abs(Angle - CONST_PI_2) <= m_AngleThreshold) + if (std::abs(Angle - CONST_PI_2) <= m_AngleThreshold) { // Right angle coordinate PointType RightAngleCoordinate; @@ -155,7 +155,7 @@ VectorDataToRightAngleVectorDataFilter<TVectorData> double oriDst = this->ComputeOrientation(lineDst); double oriSrc = this->ComputeOrientation(lineSrc); - return vcl_abs(oriDst - oriSrc); + return std::abs(oriDst - oriSrc); } template <class TVectorData> @@ -174,7 +174,7 @@ VectorDataToRightAngleVectorDataFilter<TVectorData> //Compute the orientation double dx = Xp1 - Xp2; double dy = Yp1 - Yp2; - double orientation = vcl_atan2(dy, dx); + double orientation = std::atan2(dy, dx); if (orientation < 0) orientation += CONST_PI; return orientation; diff --git a/Modules/Feature/Density/include/otbPointSetDensityGaussianFunction.hxx b/Modules/Feature/Density/include/otbPointSetDensityGaussianFunction.hxx index 6f5762dfd4bd47bf5f0a02702d4ea6221f1fe638..4a03d25728023999dec9b7f06d578d5898dc6206 100644 --- a/Modules/Feature/Density/include/otbPointSetDensityGaussianFunction.hxx +++ b/Modules/Feature/Density/include/otbPointSetDensityGaussianFunction.hxx @@ -49,11 +49,11 @@ PointSetDensityGaussianFunction<TPointSet, TOutput> float distY = input[1] - it.Value()[1]; float distsq = distX * distX + distY * distY; - accu += vcl_exp(-distsq / radiussq / 2); + accu += std::exp(-distsq / radiussq / 2); ++it; } - accu /= vcl_sqrt(2 * CONST_PI * radiussq); + accu /= std::sqrt(2 * CONST_PI * radiussq); } return accu; diff --git a/Modules/Feature/Descriptors/include/otbForwardFourierMellinTransformImageFilter.hxx b/Modules/Feature/Descriptors/include/otbForwardFourierMellinTransformImageFilter.hxx index 3d52de5b85fb94c8e58c97c13dcb1b61875188b8..8a3a41dd5ee979c55ff0cbb0b0bf5a4d21433c5a 100644 --- a/Modules/Feature/Descriptors/include/otbForwardFourierMellinTransformImageFilter.hxx +++ b/Modules/Feature/Descriptors/include/otbForwardFourierMellinTransformImageFilter.hxx @@ -89,9 +89,9 @@ ForwardFourierMellinTransformImageFilter<TPixel, TInterpol, Dimension> this->GetInput()->TransformContinuousIndexToPhysicalPoint(centre,centrePt); // Compute physical radius in the input image - double radius = vcl_log(vcl_sqrt( - vcl_pow(static_cast<double>(inputSize[0])*inputSpacing[0],2.0) + - vcl_pow(static_cast<double>(inputSize[1])*inputSpacing[1],2.0)) / 2.0); + double radius = std::log(std::sqrt( + std::pow(static_cast<double>(inputSize[0])*inputSpacing[0],2.0) + + std::pow(static_cast<double>(inputSize[1])*inputSpacing[1],2.0)) / 2.0); params[0] = centrePt[0]; params[1] = centrePt[1]; @@ -100,9 +100,9 @@ ForwardFourierMellinTransformImageFilter<TPixel, TInterpol, Dimension> m_Transform->SetParameters(params); // Compute rho scaling parameter in index space - double rhoScaleIndex = vcl_log(vcl_sqrt( - vcl_pow(static_cast<double>(inputSize[0]),2.0) + - vcl_pow(static_cast<double>(inputSize[1]),2.0)) / 2.0) / m_OutputSize[1]; + double rhoScaleIndex = std::log(std::sqrt( + std::pow(static_cast<double>(inputSize[0]),2.0) + + std::pow(static_cast<double>(inputSize[1]),2.0)) / 2.0) / m_OutputSize[1]; // log polar resampling m_ResampleFilter->SetInput(this->GetInput()); @@ -134,7 +134,7 @@ ForwardFourierMellinTransformImageFilter<TPixel, TInterpol, Dimension> double Rho = (0.5 + static_cast<double>(iter.GetIndex()[1])) * rhoScaleIndex; PixelType pixval; double valueTemp = static_cast<double>(iter.Get()); - valueTemp *= vcl_exp(m_Sigma * Rho); + valueTemp *= std::exp(m_Sigma * Rho); valueTemp *= rhoScaleIndex; PixelType value = static_cast<PixelType>(valueTemp); diff --git a/Modules/Feature/Descriptors/include/otbFourierMellinDescriptorsImageFunction.hxx b/Modules/Feature/Descriptors/include/otbFourierMellinDescriptorsImageFunction.hxx index 3285ba91939868c19d879d0915e6a37fd9097bc8..609190082ad5316e7f4b32f8d5e23404fe7c4b2c 100644 --- a/Modules/Feature/Descriptors/include/otbFourierMellinDescriptorsImageFunction.hxx +++ b/Modules/Feature/Descriptors/include/otbFourierMellinDescriptorsImageFunction.hxx @@ -116,9 +116,9 @@ FourierMellinDescriptorsImageFunction<TInputImage, TCoordRep> { ScalarComplexType power(double(p-2.0+m_Sigma)/2.0, -double(q)/2.0); - if(x!=0 || y !=0) // vcl_pow limitation + if(x!=0 || y !=0) // std::pow limitation { - coefs.at(p).at(q) += vcl_pow(xplusiy, -static_cast<double>(p)) * vcl_pow(x2plusy2, power) * value; + coefs.at(p).at(q) += std::pow(xplusiy, -static_cast<double>(p)) * std::pow(x2plusy2, power) * value; } } } @@ -132,7 +132,7 @@ FourierMellinDescriptorsImageFunction<TInputImage, TCoordRep> { coefs.at(p).at(q) /= 2*CONST_PI * coefs.at(0).at(0); - descriptors.at(p).at(q) = vcl_sqrt((coefs.at(p).at(q).real() * coefs.at(p).at(q).real() + descriptors.at(p).at(q) = std::sqrt((coefs.at(p).at(q).real() * coefs.at(p).at(q).real() + coefs.at(p).at(q).imag() * coefs.at(p).at(q).imag())); } } diff --git a/Modules/Feature/Descriptors/include/otbHistogramOfOrientedGradientCovariantImageFunction.hxx b/Modules/Feature/Descriptors/include/otbHistogramOfOrientedGradientCovariantImageFunction.hxx index 5c7f668ebcfa607211e873aceb67a2ef5424b233..919d03b8e85275f7b6cbb2a494c0518956244013 100644 --- a/Modules/Feature/Descriptors/include/otbHistogramOfOrientedGradientCovariantImageFunction.hxx +++ b/Modules/Feature/Descriptors/include/otbHistogramOfOrientedGradientCovariantImageFunction.hxx @@ -105,7 +105,7 @@ HistogramOfOrientedGradientCovariantImageFunction<TInputImage, TOutputPrecision, { // If so, compute the gaussian weighting (this could be // computed once for all for the sake of optimisation) - double gWeight = (1/vcl_sqrt(otb::CONST_2PI*squaredSigma)) * vcl_exp(- currentSquaredRadius/(2*squaredSigma)); + double gWeight = (1/std::sqrt(otb::CONST_2PI*squaredSigma)) * std::exp(- currentSquaredRadius/(2*squaredSigma)); // Compute pixel location offset[0]=i; @@ -115,14 +115,14 @@ HistogramOfOrientedGradientCovariantImageFunction<TInputImage, TOutputPrecision, InputPixelType gradient = it.GetPixel(offset); // Then, compute the gradient orientation - double angle = vcl_atan2(gradient[1], gradient[0]); + double angle = std::atan2(gradient[1], gradient[0]); // Also compute its magnitude - TOutputPrecision magnitude = vcl_sqrt(gradient[0]*gradient[0]+gradient[1]*gradient[1]); + TOutputPrecision magnitude = std::sqrt(gradient[0]*gradient[0]+gradient[1]*gradient[1]); // Determine the bin index (shift of otb::CONST_PI since atan2 values // lies in [-pi, pi] - unsigned int binIndex = vcl_floor((otb::CONST_PI + angle)/orientationBinWidth); + unsigned int binIndex = std::floor((otb::CONST_PI + angle)/orientationBinWidth); // Handle special case where angle = pi, and binIndex is out-of-bound if(binIndex == m_NumberOfOrientationBins) @@ -173,7 +173,7 @@ HistogramOfOrientedGradientCovariantImageFunction<TInputImage, TOutputPrecision, { // If so, compute the gaussian weighting (this could be // computed once for all for the sake of optimisation) - double gWeight = (1/vcl_sqrt(otb::CONST_2PI * squaredSigma)) * vcl_exp(- currentSquaredRadius/(2*squaredSigma)); + double gWeight = (1/std::sqrt(otb::CONST_2PI * squaredSigma)) * std::exp(- currentSquaredRadius/(2*squaredSigma)); // Compute pixel location offset[0]=i; @@ -183,7 +183,7 @@ HistogramOfOrientedGradientCovariantImageFunction<TInputImage, TOutputPrecision, InputPixelType gradient = it.GetPixel(offset); // Then, compute the compensated gradient orientation - double angle = vcl_atan2(gradient[1], gradient[0]) - principalOrientation; + double angle = std::atan2(gradient[1], gradient[0]) - principalOrientation; // Angle is supposed to lie with [-pi, pi], so we ensure that // compenstation did not introduce out-of-range values @@ -197,17 +197,17 @@ HistogramOfOrientedGradientCovariantImageFunction<TInputImage, TOutputPrecision, } // Also compute its magnitude - TOutputPrecision magnitude = vcl_sqrt(gradient[0]*gradient[0]+gradient[1]*gradient[1]); + TOutputPrecision magnitude = std::sqrt(gradient[0]*gradient[0]+gradient[1]*gradient[1]); // Determine the bin index (shift of otb::CONST_PI since atan2 values // lies in [-pi, pi] - unsigned int binIndex = vcl_floor((otb::CONST_PI + angle)/orientationBinWidth); + unsigned int binIndex = std::floor((otb::CONST_PI + angle)/orientationBinWidth); if(binIndex == m_NumberOfOrientationBins) binIndex=m_NumberOfOrientationBins-1; // Compute the angular position - double angularPosition = vcl_atan2((double)j, (double)i) - principalOrientation; + double angularPosition = std::atan2((double)j, (double)i) - principalOrientation; // Angle is supposed to lie within [-pi, pi], so we ensure that // the compensation did not introduce out-of-range values @@ -271,7 +271,7 @@ HistogramOfOrientedGradientCovariantImageFunction<TInputImage, TOutputPrecision, { squaredCumul += (*vIt)*(*vIt); } - double scale = 1/vcl_sqrt(squaredCumul); + double scale = 1/std::sqrt(squaredCumul); // Apply normalisation factor for(typename std::vector<TOutputPrecision>::iterator vIt = oIt->begin(); vIt!=oIt->end(); ++vIt) diff --git a/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.h b/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.h index 24380e2065de6b4458e017cd06c0ef61cc0bc9c2..2255989dba2db0b01ec923964f0d9d619c2b77fb 100644 --- a/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.h +++ b/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.h @@ -56,7 +56,7 @@ public: inline TOutputPixel operator ()(const TInputPixel& input) { - return vcl_sqrt(input[0] * input[0] + input[1] * input[1]); + return std::sqrt(input[0] * input[0] + input[1] * input[1]); } }; @@ -73,7 +73,7 @@ public: inline TOutputPixel operator ()(const TInputPixel& input) { - TOutputPixel resp = vcl_atan2(input[1], input[0]); + TOutputPixel resp = std::atan2(input[1], input[0]); if (resp < 0) { resp += CONST_2PI; diff --git a/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.hxx b/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.hxx index f2eba3fa16277e9cae46120d69d35008ef7f84e9..d5b139cf87c2918d307167b51a554fb911b26d06 100644 --- a/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.hxx +++ b/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.hxx @@ -121,7 +121,7 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> // for each octave, compute the difference of gaussian unsigned int lOctave = 0; - m_Sigmak = vcl_pow(2, static_cast<double>(1 / (double) (m_ScalesNumber + 1))); + m_Sigmak = std::pow(2, static_cast<double>(1 / (double) (m_ScalesNumber + 1))); m_RatioEdgeThreshold = (m_EdgeThreshold + 1) * (m_EdgeThreshold + 1) / m_EdgeThreshold; for (lOctave = 0; lOctave != m_OctavesNumber; lOctave++) @@ -213,8 +213,8 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> // // with multiply by spacing before filtering, length sigma gaussian // is compute in pixel - double xsigman = vcl_abs(input->GetSignedSpacing()[0]) * m_Sigma0; - double ysigman = vcl_abs(input->GetSignedSpacing()[1]) * m_Sigma0; + double xsigman = std::abs(input->GetSignedSpacing()[0]) * m_Sigma0; + double ysigman = std::abs(input->GetSignedSpacing()[1]) * m_Sigma0; for (lScale = 0; lScale != m_ScalesNumber + 2; lScale++) { @@ -604,7 +604,7 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> // check if pixel is inside the circle of radius float dx = lIterMagn.GetIndex()[0] - currentScale.GetIndex()[0]; float dy = lIterMagn.GetIndex()[1] - currentScale.GetIndex()[1]; - float dist = vcl_sqrt(dx * dx + dy * dy); + float dist = std::sqrt(dx * dx + dy * dy); // If we are in the circle if (dist < radius) @@ -614,10 +614,10 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> PixelType lMagnitude = lIterMagn.Get(); // Compute the gaussian weight - double lWeightMagnitude = vcl_exp(-dist * dist / (2 * lSigma * lSigma)); + double lWeightMagnitude = std::exp(-dist * dist / (2 * lSigma * lSigma)); // Compute the histogram bin index - unsigned int lHistoIndex = static_cast<unsigned int>(vcl_floor(nbBins * lOrientation / (CONST_2PI))); + unsigned int lHistoIndex = static_cast<unsigned int>(std::floor(nbBins * lOrientation / (CONST_2PI))); // Update the histogram value lHistogram[lHistoIndex] += lMagnitude * lWeightMagnitude; @@ -793,22 +793,22 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> // check if pixel is inside the circle of radius float dx = lIterMagnitude.GetIndex()[0] - currentScale.GetIndex()[0]; float dy = lIterMagnitude.GetIndex()[1] - currentScale.GetIndex()[1]; - float dist = vcl_sqrt(dx * dx + dy * dy); + float dist = std::sqrt(dx * dx + dy * dy); // If we are in the circle if (dist < radius) { // rotate the pixel location to compensate sift orientation float angle = orientation * CONST_PI_180; - float cosangle = vcl_cos(-angle); - float sinangle = vcl_sin(-angle); + float cosangle = std::cos(-angle); + float sinangle = std::sin(-angle); float rdx = dx * cosangle - dy * sinangle; float rdy = dx * sinangle + dy * cosangle; // decide to which histogram the pixel contributes unsigned int xHistogramIndex = - static_cast<unsigned int>(vcl_floor((rdx + radius) / static_cast<float>(nbPixelsPerHistogram))); + static_cast<unsigned int>(std::floor((rdx + radius) / static_cast<float>(nbPixelsPerHistogram))); unsigned int yHistogramIndex = - static_cast<unsigned int>(vcl_floor((rdy + radius) / static_cast<float>(nbPixelsPerHistogram))); + static_cast<unsigned int>(std::floor((rdy + radius) / static_cast<float>(nbPixelsPerHistogram))); // decide to which bin of the histogram the pixel contributes float compensatedOrientation = lIterOrientation.Get() - angle; @@ -821,10 +821,10 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> compensatedOrientation -= CONST_2PI; } unsigned int histogramBin = - static_cast<unsigned int>(vcl_floor(compensatedOrientation * nbBinsPerHistogram / (CONST_2PI))); + static_cast<unsigned int>(std::floor(compensatedOrientation * nbBinsPerHistogram / (CONST_2PI))); // Compute the wheight of the pixel in the histogram - double lWeightMagnitude = vcl_exp(-(dist * dist) / (2 * lSigma * lSigma)); + double lWeightMagnitude = std::exp(-(dist * dist) / (2 * lSigma * lSigma)); // Compute the global descriptor index unsigned int descriptorIndex = yHistogramIndex * nbBinsPerHistogram * nbHistograms @@ -845,7 +845,7 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> lNorm = lNorm + (*lIterHisto) * (*lIterHisto); ++lIterHisto; } - lNorm = vcl_sqrt(lNorm); + lNorm = std::sqrt(lNorm); lIterHisto = lHistogram.begin(); while (lIterHisto != lHistogram.end()) @@ -876,7 +876,7 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> lNorm = lNorm + (*lIterHisto) * (*lIterHisto); ++lIterHisto; } - lNorm = vcl_sqrt(lNorm); + lNorm = std::sqrt(lNorm); lIterHisto = lHistogram.begin(); while (lIterHisto != lHistogram.end()) diff --git a/Modules/Feature/Descriptors/include/otbImageToSURFKeyPointSetFilter.hxx b/Modules/Feature/Descriptors/include/otbImageToSURFKeyPointSetFilter.hxx index d787e1c9c0d338a94861095ce60d544d4df4854c..be1da38c7c5a59a31db303923f281530521e6845 100644 --- a/Modules/Feature/Descriptors/include/otbImageToSURFKeyPointSetFilter.hxx +++ b/Modules/Feature/Descriptors/include/otbImageToSURFKeyPointSetFilter.hxx @@ -487,7 +487,7 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> ds * solution[2]); // DoG threshold : ignore detected extrema if is not sufficiently noticeable - accepted = vcl_abs(lDoHInterpolated) > vcl_abs(det * m_DoHThreshold); + accepted = std::abs(lDoHInterpolated) > std::abs(det * m_DoHThreshold); if (!accepted) { @@ -503,9 +503,9 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> solution /= det; } /* check that the translation found is inside a cubic pixel */ - if (vcl_abs(static_cast<double>(solution[0])) > 1.0 - || vcl_abs(static_cast<double>(solution[1])) > 1.0 - || vcl_abs(static_cast<double>(solution[2])) > 1.0) + if (std::abs(static_cast<double>(solution[0])) > 1.0 + || std::abs(static_cast<double>(solution[1])) > 1.0 + || std::abs(static_cast<double>(solution[2])) > 1.0) { accepted = false; //solution.Fill(0); @@ -546,7 +546,7 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> { col = i % Largeur - rayon; raw = i / Largeur - rayon; - dist = vcl_sqrt(static_cast<double>(col * col + raw * raw)); + dist = std::sqrt(static_cast<double>(col * col + raw * raw)); col += rayon; raw += rayon; // Backup to the image coordinate axes @@ -556,7 +556,7 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> if ((col > pas && col < Largeur - pas) && (raw > pas && raw < Largeur - pas)) { - w = vcl_exp(-((col - rayon) * (col - rayon) + (raw - rayon) * (raw - rayon)) / (2 * 2.5 * 2.5 * S * S)); + w = std::exp(-((col - rayon) * (col - rayon) + (raw - rayon) * (raw - rayon)) / (2 * 2.5 * 2.5 * S * S)); pt[0] = (neigh[(col + pas) + raw * Largeur] - neigh[(col - pas) + raw * Largeur]) * w; pt[1] = (neigh[col + (raw + pas) * Largeur] - neigh[col + (raw - pas) * Largeur]) * w; @@ -586,7 +586,7 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> // Detecting current point orientation for (int ii = 0; ii < NbBins * 2; ii = ii + 2) { - length = vcl_sqrt(tab[ii] * tab[ii] + tab[ii + 1] * tab[ii + 1]); + length = std::sqrt(tab[ii] * tab[ii] + tab[ii + 1] * tab[ii + 1]); if (length > max) { max = length; @@ -646,7 +646,7 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> { double distanceX = (raw - r); double distanceY = (col - r); - dist = vcl_sqrt(distanceX * distanceX + distanceY * distanceY); + dist = std::sqrt(distanceX * distanceX + distanceY * distanceY); if (dist <= r) { @@ -656,8 +656,8 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> pSrc = eulerTransform->TransformPoint(pDst); /** New Coordinates (rotated) */ - col = static_cast<int>(vcl_floor(pSrc[0])); - raw = static_cast<int>(vcl_floor(pSrc[1])); + col = static_cast<int>(std::floor(pSrc[0])); + raw = static_cast<int>(std::floor(pSrc[1])); if (raw == 0) raw = +1; if (col == 0) col += 1; @@ -671,15 +671,15 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> double distanceXcompensee_2 = (pSrc[0] - r) * (pSrc[0] - r); double distanceYcompensee_2 = (pSrc[1] - r) * (pSrc[1] - r); - w = vcl_exp(-(distanceXcompensee_2 + distanceYcompensee_2) / (2 * 3.3 * 3.3 * S * S)); + w = std::exp(-(distanceXcompensee_2 + distanceYcompensee_2) / (2 * 3.3 * 3.3 * S * S)); dx = 0.5 * (neigh[(col + pas) + raw * Largeur] - neigh[(col - pas) + raw * Largeur]) * w; dy = 0.5 * (neigh[col + (raw + pas) * Largeur] - neigh[col + (raw - pas) * Largeur]) * w; descriptorVector[4 * Nbin] += dx; descriptorVector[4 * Nbin + 1] += dy; - descriptorVector[4 * Nbin + 2] += vcl_abs(dx); - descriptorVector[4 * Nbin + 3] += vcl_abs(dy); + descriptorVector[4 * Nbin + 2] += std::abs(dx); + descriptorVector[4 * Nbin + 3] += std::abs(dy); } } } @@ -691,7 +691,7 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> accu += descriptorVector[ii] * descriptorVector[ii]; for (int jj = 0; jj < 64; ++jj) - descriptorVector[jj] /= vcl_sqrt(accu); + descriptorVector[jj] /= std::sqrt(accu); return descriptorVector; diff --git a/Modules/Feature/Descriptors/test/otbFourierMellinDescriptors.cxx b/Modules/Feature/Descriptors/test/otbFourierMellinDescriptors.cxx index 675f83184903ed54499e0fff55338b1f907867c9..5bfe656e020e182b35e4a71e3411f02599198934 100644 --- a/Modules/Feature/Descriptors/test/otbFourierMellinDescriptors.cxx +++ b/Modules/Feature/Descriptors/test/otbFourierMellinDescriptors.cxx @@ -159,7 +159,7 @@ int otbFourierMellinDescriptorsScaleInvariant(int itkNotUsed(argc), char * argv[ { for (unsigned int l=0; l<=q; ++l) { - error += vcl_pow(vcl_abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); + error += std::pow(std::abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); std::cout << "Original - D" << k << l << " : " << Result1.at(k).at(l) @@ -168,7 +168,7 @@ int otbFourierMellinDescriptorsScaleInvariant(int itkNotUsed(argc), char * argv[ } } - error = vcl_sqrt(error)/(q+p); + error = std::sqrt(error)/(q+p); std::cout << "Error : " << error << std::endl << std::endl; @@ -237,7 +237,7 @@ int otbFourierMellinDescriptorsRotationInvariant(int itkNotUsed(argc), char * ar translation1[1] = -imageCenterY; transform->Translate( translation1 ); - const double degreesToRadians = vcl_atan(1.0) / 45.0; + const double degreesToRadians = std::atan(1.0) / 45.0; const double angle = angleInDegrees * degreesToRadians; transform->Rotate2D( -angle, false ); @@ -273,7 +273,7 @@ int otbFourierMellinDescriptorsRotationInvariant(int itkNotUsed(argc), char * ar { for (unsigned int l=0; l<=q; ++l) { - error += vcl_pow(vcl_abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); + error += std::pow(std::abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); std::cout << "Original - D" << k << l << " : " << Result1.at(k).at(l) @@ -282,7 +282,7 @@ int otbFourierMellinDescriptorsRotationInvariant(int itkNotUsed(argc), char * ar } } - error = vcl_sqrt(error)/(q+p); + error = std::sqrt(error)/(q+p); std::cout << "Error : " << error << std::endl << std::endl; diff --git a/Modules/Feature/Descriptors/test/otbImageToSIFTKeyPointSetFilterOutputImage.cxx b/Modules/Feature/Descriptors/test/otbImageToSIFTKeyPointSetFilterOutputImage.cxx index 355dc8d46a877a1087528445561029e1dd307f1d..2575ff1a5387cf83431eefad8ccb4f7f2df8de75 100644 --- a/Modules/Feature/Descriptors/test/otbImageToSIFTKeyPointSetFilterOutputImage.cxx +++ b/Modules/Feature/Descriptors/test/otbImageToSIFTKeyPointSetFilterOutputImage.cxx @@ -125,11 +125,11 @@ int otbImageToSIFTKeyPointSetFilterOutputImage(int itkNotUsed(argc), char * argv ImageType::IndexType index; index[0] = (unsigned int) - (vcl_floor + (std::floor ((double) ((pIt.Value()[0] - origin[0]) / spacing[0] + 0.5))); index[1] = (unsigned int) - (vcl_floor + (std::floor ((double) ((pIt.Value()[1] - origin[1]) / spacing[1] + 0.5))); OutputImageType::PixelType keyPixel; diff --git a/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.h b/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.h index bd3c95f4c3269b0016d83dddc2fe511fc1548b74..7e08a023516db4afe26c8a31c8dcb739141e243a 100644 --- a/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.h +++ b/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.h @@ -39,7 +39,7 @@ namespace otb * to be extracted. The output is the image of the accumulator. * GetLines() returns a list of LinesSpatialObjects * - * Lines are parameterized in the form: R = x*vcl_cos(Teta)+y*vcl_sin(Teta) + * Lines are parameterized in the form: R = x*std::cos(Teta)+y*std::sin(Teta) * where R is the perpendicular distance from the origin and Teta * the angle with the normal. * diff --git a/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.hxx b/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.hxx index f2256c66014ad2df84f0a90bba7ef832f29a9e3a..d615a318b563895b5adfc9841e71508f71531438 100644 --- a/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.hxx @@ -36,7 +36,7 @@ template<typename TInputPixelType, typename TOutputPixelType> HoughTransform2DLinesImageFilter<TInputPixelType, TOutputPixelType> ::HoughTransform2DLinesImageFilter() { - const double nPI = 4.0 * vcl_atan(1.0); + const double nPI = 4.0 * std::atan(1.0); m_Threshold = 0; // by default @@ -146,12 +146,12 @@ HoughTransform2DLinesImageFilter<TInputPixelType, TOutputPixelType> std::vector<double> cosAngle(nbAngles, 0.); std::vector<double> sinAngle(nbAngles, 0.); - //const double nPI = 4.0 * vcl_atan( 1.0 ); Unused in this method + //const double nPI = 4.0 * std::atan( 1.0 ); Unused in this method for (unsigned int indexAngle = 0; indexAngle < nbAngles; indexAngle++) { double angle = this->GetAngleValue(indexAngle); - cosAngle[indexAngle] = vcl_cos(angle); - sinAngle[indexAngle] = vcl_sin(angle); + cosAngle[indexAngle] = std::cos(angle); + sinAngle[indexAngle] = std::sin(angle); } while (!image_it.IsAtEnd()) @@ -217,7 +217,7 @@ HoughTransform2DLinesImageFilter<TInputPixelType, TOutputPixelType> maxIndex[1] = 0; for (double angle = m_AngleAxisMinimum; angle < m_AngleAxisMaximum; angle += m_AngleAxisIncrement) { - index[0] = (long int) (image_it.GetIndex()[0] * vcl_cos(angle) + image_it.GetIndex()[1] * vcl_sin(angle)); // m_R + index[0] = (long int) (image_it.GetIndex()[0] * std::cos(angle) + image_it.GetIndex()[1] * std::sin(angle)); // m_R index[1] = (long int) (this->GetAngleIndex(angle)); // m_Theta if (outputImage->GetBufferedRegion().IsInside(index)) @@ -297,7 +297,7 @@ HoughTransform2DLinesImageFilter<TInputPixelType, TOutputPixelType> itk::ImageRegionIterator<InternalImageType> it_input(postProcessImage, postProcessImage->GetLargestPossibleRegion()); - const double nPI = 4.0 * vcl_atan(1.0); + const double nPI = 4.0 * std::atan(1.0); itk::Index<2> index; @@ -321,9 +321,9 @@ HoughTransform2DLinesImageFilter<TInputPixelType, TOutputPixelType> double radius = this->GetDistanceValue(it_input.GetIndex()[0]); double teta = this->GetAngleValue(it_input.GetIndex()[1]); - double Vx = radius * vcl_cos(teta); - double Vy = radius * vcl_sin(teta); - double norm = vcl_sqrt(Vx * Vx + Vy * Vy); + double Vx = radius * std::cos(teta); + double Vy = radius * std::sin(teta); + double norm = std::sqrt(Vx * Vx + Vy * Vy); double VxNorm = Vx / norm; double VyNorm = Vy / norm; @@ -363,8 +363,8 @@ HoughTransform2DLinesImageFilter<TInputPixelType, TOutputPixelType> { for (double length = 0; length < m_DiscRadius; length += 1) { - index[0] = (long int) (it_input.GetIndex()[0] + length * vcl_cos(angle)); - index[1] = (long int) (it_input.GetIndex()[1] + length * vcl_sin(angle)); + index[0] = (long int) (it_input.GetIndex()[0] + length * std::cos(angle)); + index[1] = (long int) (it_input.GetIndex()[1] + length * std::sin(angle)); if (postProcessImage->GetBufferedRegion().IsInside(index)) { postProcessImage->SetPixel(index, 0); diff --git a/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx index 6c4da8b6e44188a0e8b89b1d123014daed4bf99a..466ff0d857765a975d202ac1d1393ee02b320555 100644 --- a/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx @@ -95,13 +95,13 @@ LineCorrelationDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirect while (m1It != m1End && m2It != m2End && m3It != m3End) { - sigma1 += vcl_pow((*m1It) - M1, 2); + sigma1 += std::pow((*m1It) - M1, 2); ++m1It; - sigma2 += vcl_pow((*m2It) - M2, 2); + sigma2 += std::pow((*m2It) - M2, 2); ++m2It; - sigma3 += vcl_pow((*m3It) - M3, 2); + sigma3 += std::pow((*m3It) - M3, 2); ++m3It; } @@ -111,9 +111,9 @@ LineCorrelationDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirect sigma3 /= m3->size(); // Actually, we use the variance - /* sigma1 = vcl_sqrt(sigma1); - sigma2 = vcl_sqrt(sigma2); - sigma3 = vcl_sqrt(sigma3); + /* sigma1 = std::sqrt(sigma1); + sigma2 = std::sqrt(sigma2); + sigma3 = std::sqrt(sigma3); */ // Calculation of the cross correlation coefficient @@ -128,10 +128,10 @@ LineCorrelationDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirect // rho12 if (M2 != 0.) { - d1 = sigma1 / vcl_pow(M2, 2) * m1->size(); - d2 = sigma2 / vcl_pow(M2, 2) * m2->size(); + d1 = sigma1 / std::pow(M2, 2) * m1->size(); + d2 = sigma2 / std::pow(M2, 2) * m2->size(); - d3 = vcl_pow(((M1 / M2) - 1.), 2) * (m1->size() * m2->size()); + d3 = std::pow(((M1 / M2) - 1.), 2) * (m1->size() * m2->size()); if ((d3 != 0.)) rho12 = static_cast<double>(1. / (1. + ((m1->size() + m2->size()) * (d1 + d2) / d3))); else rho12 = 0.; @@ -139,18 +139,18 @@ LineCorrelationDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirect } if (M3 != 0.) { - d1 = sigma1 / vcl_pow(M3, 2) * m1->size(); - d2 = sigma3 / vcl_pow(M3, 2) * m2->size(); + d1 = sigma1 / std::pow(M3, 2) * m1->size(); + d2 = sigma3 / std::pow(M3, 2) * m2->size(); - d3 = vcl_pow(((M1 / M3) - 1.), 2) * (m1->size() * m2->size()); + d3 = std::pow(((M1 / M3) - 1.), 2) * (m1->size() * m2->size()); if ((d3 != 0.)) rho13 = static_cast<double>(1. / (1. + ((m1->size() + m2->size()) * (d1 + d2) / d3))); else rho13 = 0.; } - rho12 = vcl_sqrt(rho12); - rho13 = vcl_sqrt(rho13); + rho12 = std::sqrt(rho12); + rho13 = std::sqrt(rho13); // Determination of the minimum intensity of detection between R12 et R13 return static_cast<double>(std::min(rho12, rho13)); diff --git a/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.hxx b/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.hxx index 1f9c512baeee96c026b3c6f14e86925508ebb51c..f7d1865194cef0ca68644d4ddaa8dc69bbca34ca 100644 --- a/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.hxx +++ b/Modules/Feature/Edge/include/otbLineDetectorImageFilterBase.hxx @@ -85,7 +85,7 @@ LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, In // Define the size of the facelist by taking into account the rotation of the region m_FaceList[0] = - static_cast<unsigned int>(vcl_sqrt(static_cast<double>( + static_cast<unsigned int>(std::sqrt(static_cast<double>( (m_Radius[0] * m_Radius[0]) + (m_Radius[1] * m_Radius[1]))) + 1); m_FaceList[1] = m_FaceList[0]; @@ -324,8 +324,8 @@ LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, In { //ROTATION( (X-Xc), (Y-Yc), Theta[dir], xout, yout); - xout = (X - Xc) * vcl_cos(Theta[dir]) - (Y - Yc) * vcl_sin(Theta[dir]); - yout = (X - Xc) * vcl_sin(Theta[dir]) + (Y - Yc) * vcl_cos(Theta[dir]); + xout = (X - Xc) * std::cos(Theta[dir]) - (Y - Yc) * std::sin(Theta[dir]); + yout = (X - Xc) * std::sin(Theta[dir]) + (Y - Yc) * std::cos(Theta[dir]); Index[0] = static_cast<CoordRepType>(xout + Xc); Index[1] = static_cast<CoordRepType>(yout + Yc); diff --git a/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx index 638656418e7a6c40365c19c253e40ee7ba76e983..4d074fc04114f3b17dc74d06904ea07bfcc28521 100644 --- a/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx @@ -89,12 +89,12 @@ LineRatioDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirection, T double R13 = 0.0; double epsilon = 0.0000000001; - if ((vcl_abs(M1) > epsilon) && (vcl_abs(M2) > epsilon)) R12 = static_cast<double>(1 - std::min((M1 / M2), (M2 / M1))); - else if ((vcl_abs(M1) > epsilon) || (vcl_abs(M2) > epsilon)) R12 = 1.0; + if ((std::abs(M1) > epsilon) && (std::abs(M2) > epsilon)) R12 = static_cast<double>(1 - std::min((M1 / M2), (M2 / M1))); + else if ((std::abs(M1) > epsilon) || (std::abs(M2) > epsilon)) R12 = 1.0; else R12 = 0.; - if ((vcl_abs(M1) > epsilon) && (vcl_abs(M3) > epsilon)) R13 = static_cast<double>(1 - std::min((M1 / M3), (M3 / M1))); - else if ((vcl_abs(M1) > epsilon) || (vcl_abs(M3) > epsilon)) R13 = 1.0; + if ((std::abs(M1) > epsilon) && (std::abs(M3) > epsilon)) R13 = static_cast<double>(1 - std::min((M1 / M3), (M3 / M1))); + else if ((std::abs(M1) > epsilon) || (std::abs(M3) > epsilon)) R13 = 1.0; else R13 = 0.; // Determination of the minimum intensity of detection between R12 et R13 diff --git a/Modules/Feature/Edge/include/otbLineSegmentDetector.h b/Modules/Feature/Edge/include/otbLineSegmentDetector.h index 9e335d2e8b0f829a6f29cdb6b814f2341167fbd7..a7b5d8047b09adb8a9d9de01accab23a32bb2245 100644 --- a/Modules/Feature/Edge/include/otbLineSegmentDetector.h +++ b/Modules/Feature/Edge/include/otbLineSegmentDetector.h @@ -46,7 +46,7 @@ public: inline TOutputPixel operator ()(const TInputPixel& input) { - return static_cast<TOutputPixel>(2 * vcl_sqrt(input[0] * input[0] + input[1] * input[1])); + return static_cast<TOutputPixel>(2 * std::sqrt(input[0] * input[0] + input[1] * input[1])); } }; @@ -63,7 +63,7 @@ public: inline TOutputPixel operator ()(const TInputPixel& input) { - return static_cast<TOutputPixel>(vcl_atan2(input[0], -input[1])); + return static_cast<TOutputPixel>(std::atan2(input[0], -input[1])); } }; } // end namespace Functor diff --git a/Modules/Feature/Edge/include/otbLineSegmentDetector.hxx b/Modules/Feature/Edge/include/otbLineSegmentDetector.hxx index 1d81fbfa319fd4d8e746dd4982edbda80d76aa03..38d005daebf9c75dd00e8540c354ec15d36dd4df 100644 --- a/Modules/Feature/Edge/include/otbLineSegmentDetector.hxx +++ b/Modules/Feature/Edge/include/otbLineSegmentDetector.hxx @@ -157,8 +157,8 @@ LineSegmentDetector<TInputImage, TPrecision> RegionType largestRegion = this->GetInput()->GetLargestPossibleRegion(); // Compute the minimum region size - double logNT = 5. * vcl_log10( static_cast<double>(largestRegion.GetNumberOfPixels()) ) / 2.; - double log1_p = vcl_log10(m_DirectionsAllowed); + double logNT = 5. * std::log10( static_cast<double>(largestRegion.GetNumberOfPixels()) ) / 2.; + double log1_p = std::log10(m_DirectionsAllowed); double rapport = logNT / log1_p; m_MinimumRegionSize = static_cast<unsigned int>(-rapport); @@ -272,7 +272,7 @@ LineSegmentDetector<TInputImage, TPrecision> double nfa = ImproveRectangle(rectangle); double density = (double)region.size() / - ( vcl_sqrt((rectangle[2]-rectangle[0])*(rectangle[2]-rectangle[0]) + ( std::sqrt((rectangle[2]-rectangle[0])*(rectangle[2]-rectangle[0]) +(rectangle[3]-rectangle[1])*(rectangle[3]-rectangle[1])) * rectangle[4] ); if (density < 0.7) { @@ -431,10 +431,10 @@ LineSegmentDetector<TInputImage, TPrecision> { if ((r[4] - delta) >= 0.5) { - r[0] += -vcl_sin(r[5]) * delta_2; - r[1] += vcl_cos(r[5]) * delta_2; - r[2] += -vcl_sin(r[5]) * delta_2; - r[3] += vcl_cos(r[5]) * delta_2; + r[0] += -std::sin(r[5]) * delta_2; + r[1] += std::cos(r[5]) * delta_2; + r[2] += -std::sin(r[5]) * delta_2; + r[3] += std::cos(r[5]) * delta_2; r[4] -= delta; nfa_new = this->ComputeRectNFA(r); @@ -452,10 +452,10 @@ LineSegmentDetector<TInputImage, TPrecision> { if ((r[4] - delta) >= 0.5) { - r[0] -= -vcl_sin(r[5]) * delta_2; - r[1] -= vcl_cos(r[5]) * delta_2; - r[2] -= -vcl_sin(r[5]) * delta_2; - r[3] -= vcl_cos(r[5]) * delta_2; + r[0] -= -std::sin(r[5]) * delta_2; + r[1] -= std::cos(r[5]) * delta_2; + r[2] -= -std::sin(r[5]) * delta_2; + r[3] -= std::cos(r[5]) * delta_2; r[4] -= delta; nfa_new = this->ComputeRectNFA(r); @@ -670,9 +670,9 @@ LineSegmentDetector<TInputImage, TPrecision> { itNeigh.SetLocation(region[cpt]); itNeighDir.SetLocation(region[cpt]); - sumX += vcl_cos(*(itNeighDir.GetCenterValue())); - sumY += vcl_sin(*(itNeighDir.GetCenterValue())); - regionAngle = vcl_atan2(sumY, sumX); + sumX += std::cos(*(itNeighDir.GetCenterValue())); + sumY += std::sin(*(itNeighDir.GetCenterValue())); + regionAngle = std::atan2(sumY, sumX); unsigned int s = 0; while (s < neighSize) @@ -781,8 +781,8 @@ LineSegmentDetector<TInputImage, TPrecision> MagnitudeVector sum_l(2*Diagonal, itk::NumericTraits<MagnitudePixelType>::Zero); MagnitudeVector sum_w(2*Diagonal, itk::NumericTraits<MagnitudePixelType>::Zero); - double dx = vcl_cos(theta); - double dy = vcl_sin(theta); + double dx = std::cos(theta); + double dy = std::sin(theta); it = region.begin(); while (it != region.end()) @@ -801,8 +801,8 @@ LineSegmentDetector<TInputImage, TPrecision> if (w > w_max) w_max = w; - sum_l[static_cast < int > (vcl_floor(l) + 0.5) + Diagonal] += static_cast<MagnitudePixelType>(weight); - sum_w[static_cast < int > (vcl_floor(w) + 0.5) + Diagonal] += static_cast<MagnitudePixelType>(weight); + sum_l[static_cast < int > (std::floor(l) + 0.5) + Diagonal] += static_cast<MagnitudePixelType>(weight); + sum_w[static_cast < int > (std::floor(w) + 0.5) + Diagonal] += static_cast<MagnitudePixelType>(weight); ++it; } @@ -844,8 +844,8 @@ LineSegmentDetector<TInputImage, TPrecision> RectangleType rec(8, 0.); // Definition of a // rectangle : 8 components - if (vcl_abs(wl - wr) - - vcl_sqrt( static_cast<double> (largestRegion.GetSize(0) * largestRegion.GetSize(0) + + if (std::abs(wl - wr) + - std::sqrt( static_cast<double> (largestRegion.GetSize(0) * largestRegion.GetSize(0) + largestRegion.GetSize(1) * largestRegion.GetSize(1))) < 1e-10 ) { @@ -917,7 +917,7 @@ LineSegmentDetector<TInputImage, TPrecision> typedef itk::SymmetricEigenAnalysis<MatrixType, MatrixEigenType> EigenAnalysisType; EigenAnalysisType eigenFilter(2); eigenFilter.ComputeEigenValuesAndVectors(Inertie, eigenMatrix, eigenVector); - theta = vcl_atan2(eigenVector[1][1], -eigenVector[1][0]); + theta = std::atan2(eigenVector[1][1], -eigenVector[1][0]); /* the previous procedure don't cares orientations, so it could be wrong by 180 degrees. @@ -1002,7 +1002,7 @@ LineSegmentDetector<TInputImage, TPrecision> /** Compute the NFA from the rectangle computed below*/ RegionType largestRegion = const_cast<Self*>(this)->GetInput()->GetLargestPossibleRegion(); - double logNT = 5. * vcl_log10( static_cast<double>(largestRegion.GetNumberOfPixels()) ) / 2.; + double logNT = 5. * std::log10( static_cast<double>(largestRegion.GetNumberOfPixels()) ) / 2.; nfa_val = NFA(pts, NbAligned, m_DirectionsAllowed, logNT); diff --git a/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx b/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx index 5c11092c8d1abfbe565506d0f28a55928fb243b7..596f4a1f1662fb423f91a17a531e775ddd786246 100644 --- a/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx +++ b/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx @@ -60,7 +60,7 @@ LinePointResearch(LineIterator itLines, InputImageType *image, IndexType origin) v[0] = u[0] - (*itPoints).GetPosition()[0]; v[1] = u[1] - (*itPoints).GetPosition()[1]; - double norm = vcl_sqrt(v[0] * v[0] + v[1] * v[1]); + double norm = std::sqrt(v[0] * v[0] + v[1] * v[1]); v[0] /= norm; v[1] /= norm; @@ -75,7 +75,7 @@ LinePointResearch(LineIterator itLines, InputImageType *image, IndexType origin) // The diagonal is the largest distance between two edges of image itk::Size<2> size = region.GetSize(); - float diag = vcl_sqrt((float) (size[0] * size[0] + size[1] * size[1])); + float diag = std::sqrt((float) (size[0] * size[0] + size[1] * size[1])); // Loop on the largest distance to be sure to cover all the image // whatever the position of the origin u diff --git a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx index c6f0824955ac7344204185bda6a11734685894cb..15053b5a0d4bd442575bf7f6794881bc6944adf2 100644 --- a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx @@ -238,20 +238,20 @@ void PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::Threaded // No calculation on the central pixel if ((x == 0) && (y == 0)) continue; - Thetaxtyt = vcl_atan2(static_cast<double>(y), static_cast<double>(x)); //result is [-PI, PI] + Thetaxtyt = std::atan2(static_cast<double>(y), static_cast<double>(x)); //result is [-PI, PI] while (Thetaxtyt < 0) Thetaxtyt = CONST_PI + Thetaxtyt; // Theta is now [0, PI] as is // the result of detectors while (Thetaxtyt > CONST_PI_2) Thetaxtyt = Thetaxtyt - CONST_PI; // Theta is now [-PI/2, PI/2] - if ((vcl_abs(vcl_cos(Thetaxtyt - ThetaXcYc)) >= vcl_cos(m_AngularBeam)) // this + if ((std::abs(std::cos(Thetaxtyt - ThetaXcYc)) >= std::cos(m_AngularBeam)) // this // pixel // is // in // the // angular beam - && (vcl_abs(vcl_cos(bit.GetPixel(off) - ThetaXcYc)) >= vcl_cos(m_AngularBeam))) //and + && (std::abs(std::cos(bit.GetPixel(off) - ThetaXcYc)) >= std::cos(m_AngularBeam))) //and //its //direction //is diff --git a/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h b/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h index cfe3d0d7098fd7c307307c15bada03f8caa5017d..5bf815ecbf5e385bb6fb325cafcd20c36b04aade 100644 --- a/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h +++ b/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h @@ -58,7 +58,7 @@ public: + ( input.GetPixel(2)[i] - input.GetPixel(8)[i] ) ); output[i] = static_cast<typename TOutput::ValueType>( - vcl_sqrt( vcl_pow( hori, 2. ) + vcl_pow( vert, 2. ) ) ); + std::sqrt( std::pow( hori, 2. ) + std::pow( vert, 2. ) ) ); } return output; } diff --git a/Modules/Feature/Edge/src/otbFillGapsFilter.cxx b/Modules/Feature/Edge/src/otbFillGapsFilter.cxx index 07c455f08ee06aec998b9d1a7f996d3319f1cec5..79065f1c9d62f600fe298534c3d81605b7218e42 100644 --- a/Modules/Feature/Edge/src/otbFillGapsFilter.cxx +++ b/Modules/Feature/Edge/src/otbFillGapsFilter.cxx @@ -93,7 +93,7 @@ FillGapsFilter PointListType::const_iterator itPoints; - CosTheta = vcl_cos(m_AngularBeam); + CosTheta = std::cos(m_AngularBeam); --itLineListAEnd; while (itLineListA != itLineListAEnd) @@ -140,10 +140,10 @@ FillGapsFilter // Calculate the radius for each point of each line - R13 = vcl_sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3)); - R14 = vcl_sqrt((x1 - x4) * (x1 - x4) + (y1 - y4) * (y1 - y4)); - R23 = vcl_sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3)); - R24 = vcl_sqrt((x2 - x4) * (x2 - x4) + (y2 - y4) * (y2 - y4)); + R13 = std::sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3)); + R14 = std::sqrt((x1 - x4) * (x1 - x4) + (y1 - y4) * (y1 - y4)); + R23 = std::sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3)); + R24 = std::sqrt((x2 - x4) * (x2 - x4) + (y2 - y4) * (y2 - y4)); double Rmin = m_Radius; @@ -192,9 +192,9 @@ FillGapsFilter //Estimate the norm each line /* double Norm12, Norm23, Norm34; - Norm12 = vcl_sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ); - Norm23 = vcl_sqrt( (x2-x3)*(x2-x3) + (y2-y3)*(y2-y3) ); - Norm34 = vcl_sqrt( (x3-x4)*(x3-x4) + (y3-y4)*(y3-y4) ); + Norm12 = std::sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ); + Norm23 = std::sqrt( (x2-x3)*(x2-x3) + (y2-y3)*(y2-y3) ); + Norm34 = std::sqrt( (x3-x4)*(x3-x4) + (y3-y4)*(y3-y4) ); */ double Angle12_23, Angle12_34, Angle23_34; //Estimate the angle between lines 12-23 and lines 12-34 @@ -204,9 +204,9 @@ FillGapsFilter Angle12_34 = (x2-x1)*(x4-x3) + (y2-y1)*(y4-y3); Angle12_34 = Angle12_34 / Norm12 / Norm34; */ - Angle12_23 = vcl_cos(vcl_atan2((y2 - y1), (x2 - x1)) - vcl_atan2((y3 - y2), (x3 - x2))); - Angle12_34 = vcl_cos(vcl_atan2((y2 - y1), (x2 - x1)) - vcl_atan2((y4 - y3), (x4 - x3))); - Angle23_34 = vcl_cos(vcl_atan2((y3 - y2), (x3 - x2)) - vcl_atan2((y4 - y3), (x4 - x3))); + Angle12_23 = std::cos(std::atan2((y2 - y1), (x2 - x1)) - std::atan2((y3 - y2), (x3 - x2))); + Angle12_34 = std::cos(std::atan2((y2 - y1), (x2 - x1)) - std::atan2((y4 - y3), (x4 - x3))); + Angle23_34 = std::cos(std::atan2((y3 - y2), (x3 - x2)) - std::atan2((y4 - y3), (x4 - x3))); if ((Angle12_23 > CosTheta) && (Angle12_34 > CosTheta) && (Angle23_34 > CosTheta)) { diff --git a/Modules/Feature/Edge/test/otbHoughTransform2DLinesImageTest.cxx b/Modules/Feature/Edge/test/otbHoughTransform2DLinesImageTest.cxx index 1a98a7264ed020c2ab1dd044d283d9ae2928eade..b391abf923154b2a9557f01ee15297bb06c8aa68 100644 --- a/Modules/Feature/Edge/test/otbHoughTransform2DLinesImageTest.cxx +++ b/Modules/Feature/Edge/test/otbHoughTransform2DLinesImageTest.cxx @@ -92,7 +92,7 @@ int otbHoughTransform2DLinesImageTest(int itkNotUsed(argc), char* argv[]) unsigned int maxval = size[0] * size[1]; - const double nPI = 4.0 * vcl_atan(1.0); + const double nPI = 4.0 * std::atan(1.0); for (unsigned int i = 0; i < maxval; i += 1) { diff --git a/Modules/Feature/Moments/include/otbComplexMomentPathFunction.hxx b/Modules/Feature/Moments/include/otbComplexMomentPathFunction.hxx index 564842094da59cf279e872970b98eabcca9d166f..76d7614b0bb44e83ab63b95ea387e7c1c71f7647 100644 --- a/Modules/Feature/Moments/include/otbComplexMomentPathFunction.hxx +++ b/Modules/Feature/Moments/include/otbComplexMomentPathFunction.hxx @@ -144,7 +144,7 @@ ComplexMomentPathFunction<TInputPath, TOutput, TPrecision> dest[1] -= centroid[1]; // Don't forget the ds part of the integration process - ds = vcl_sqrt(vcl_pow(dest[0] - source[0], 2.) + vcl_pow(dest[1] - source[1], 2.)); + ds = std::sqrt(std::pow(dest[0] - source[0], 2.) + std::pow(dest[1] - source[1], 2.)); norm += ds; value += ds * EvaluateComplexMomentAtIndex(source); source = dest; @@ -154,10 +154,10 @@ ComplexMomentPathFunction<TInputPath, TOutput, TPrecision> dest = vertexList->Begin().Value(); dest[0] -= centroid[0]; dest[1] -= centroid[1]; - ds = vcl_sqrt(vcl_pow(dest[0] - source[0], 2.) + vcl_pow(dest[1] - source[1], 2.)); + ds = std::sqrt(std::pow(dest[0] - source[0], 2.) + std::pow(dest[1] - source[1], 2.)); norm += ds; value += EvaluateComplexMomentAtIndex(source) * ds; - norm = vcl_pow(norm, ((PrecisionType) m_P + (PrecisionType) m_Q) / 2.); + norm = std::pow(norm, ((PrecisionType) m_P + (PrecisionType) m_Q) / 2.); // Normalize with edge perimeter value /= norm; diff --git a/Modules/Feature/Moments/include/otbFlusserPathFunction.hxx b/Modules/Feature/Moments/include/otbFlusserPathFunction.hxx index 0c73d58388c3328a7b64563b074bb290a0a471c9..00f5f775d888b0f52c34e39b0109625264714856 100644 --- a/Modules/Feature/Moments/include/otbFlusserPathFunction.hxx +++ b/Modules/Feature/Moments/include/otbFlusserPathFunction.hxx @@ -87,7 +87,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(2); C12 = function->Evaluate(); - FlusserValue = vcl_abs(C21 * C12); + FlusserValue = std::abs(C21 * C12); } break; case 3: @@ -99,7 +99,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetP(1); function->SetQ(2); C12 = function->Evaluate(); - FlusserValueComplex = C20 * vcl_pow(C12, 2); + FlusserValueComplex = C20 * std::pow(C12, 2); FlusserValue = FlusserValueComplex.real(); } break; @@ -112,7 +112,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetP(1); function->SetQ(2); C12 = function->Evaluate(); - FlusserValueComplex = C20 * vcl_pow(C12, 2); + FlusserValueComplex = C20 * std::pow(C12, 2); FlusserValue = FlusserValueComplex.imag(); } break; @@ -126,7 +126,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(2); C12 = function->Evaluate(); - FlusserValueComplex = C30 * vcl_pow(C12, 3); + FlusserValueComplex = C30 * std::pow(C12, 3); FlusserValue = FlusserValueComplex.real(); } break; @@ -140,7 +140,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(2); C12 = function->Evaluate(); - FlusserValueComplex = C30 * vcl_pow(C12, 3); + FlusserValueComplex = C30 * std::pow(C12, 3); FlusserValue = FlusserValueComplex.imag(); } break; @@ -162,7 +162,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetP(1); function->SetQ(2); C12 = function->Evaluate(); - FlusserValueComplex = C31 * vcl_pow(C12, 2); + FlusserValueComplex = C31 * std::pow(C12, 2); FlusserValue = FlusserValueComplex.real(); } break; @@ -175,7 +175,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetP(1); function->SetQ(2); C12 = function->Evaluate(); - FlusserValueComplex = C31 * vcl_pow(C12, 2); + FlusserValueComplex = C31 * std::pow(C12, 2); FlusserValue = FlusserValueComplex.imag(); } break; @@ -188,7 +188,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetP(1); function->SetQ(2); C12 = function->Evaluate(); - FlusserValueComplex = C40 * vcl_pow(C12, 4); + FlusserValueComplex = C40 * std::pow(C12, 4); FlusserValue = FlusserValueComplex.real(); } break; @@ -201,7 +201,7 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> function->SetP(1); function->SetQ(2); C12 = function->Evaluate(); - FlusserValueComplex = C40 * vcl_pow(C12, 4); + FlusserValueComplex = C40 * std::pow(C12, 4); FlusserValue = FlusserValueComplex.imag(); } break; diff --git a/Modules/Feature/Moments/include/otbHuPathFunction.hxx b/Modules/Feature/Moments/include/otbHuPathFunction.hxx index b217ba49fa0ac0f457c93266a394ed11b4372249..19e972f58946a2109fcbca0934d9fcc167429082 100644 --- a/Modules/Feature/Moments/include/otbHuPathFunction.hxx +++ b/Modules/Feature/Moments/include/otbHuPathFunction.hxx @@ -88,7 +88,7 @@ HuPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(2); C02 = function->Evaluate(); - HuValue = vcl_abs(C20 * C02); + HuValue = std::abs(C20 * C02); } break; @@ -102,7 +102,7 @@ HuPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(3); C03 = function->Evaluate(); - HuValue = vcl_abs(C30 * C03); + HuValue = std::abs(C30 * C03); } break; case 4: @@ -115,7 +115,7 @@ HuPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(2); C12 = function->Evaluate(); - HuValue = vcl_abs(C21 * C12); + HuValue = std::abs(C21 * C12); } break; @@ -129,7 +129,7 @@ HuPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(2); C12 = function->Evaluate(); - HuValueComplex = C30 * vcl_pow(C12, 3); + HuValueComplex = C30 * std::pow(C12, 3); HuValue = HuValueComplex.real(); } break; @@ -144,7 +144,7 @@ HuPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(2); C12 = function->Evaluate(); - HuValueComplex = C20 * vcl_pow(C12, 2); + HuValueComplex = C20 * std::pow(C12, 2); HuValue = HuValueComplex.real(); } break; @@ -159,7 +159,7 @@ HuPathFunction<TInputPath, TOutput, TPrecision> function->SetQ(2); C12 = function->Evaluate(); - HuValueComplex = C30 * vcl_pow(C12, 3); + HuValueComplex = C30 * std::pow(C12, 3); HuValue = HuValueComplex.imag(); } break; diff --git a/Modules/Feature/Moments/include/otbRadiometricMomentsFunctor.h b/Modules/Feature/Moments/include/otbRadiometricMomentsFunctor.h index 6c179711a4a0c0b5628816fd581379749201b798..cfc8a3fee59bfe6cb91d6dcd6223f8be63365ef8 100644 --- a/Modules/Feature/Moments/include/otbRadiometricMomentsFunctor.h +++ b/Modules/Feature/Moments/include/otbRadiometricMomentsFunctor.h @@ -81,11 +81,11 @@ public: // Variance moments[1] = (sum2 - (sum1 * moments[0])) / (size - 1); - ScalarRealType sigma = vcl_sqrt(moments[1]); + ScalarRealType sigma = std::sqrt(moments[1]); ScalarRealType mean2 = moments[0] * moments[0]; const double epsilon = 1E-10; - if (vcl_abs(moments[1]) > epsilon) + if (std::abs(moments[1]) > epsilon) { // Skewness moments[2] = ((sum3 - 3.0 * moments[0] * sum2) / size + 2.0 * moments[0] * mean2) / (moments[1] * sigma); diff --git a/Modules/Feature/Moments/test/otbComplexMomentsImageFunction.cxx b/Modules/Feature/Moments/test/otbComplexMomentsImageFunction.cxx index b78c0a73af7f0a55844b68c43e63f8d48a39d803..32659c339f838c0d2e8027c3002162380f989ddc 100644 --- a/Modules/Feature/Moments/test/otbComplexMomentsImageFunction.cxx +++ b/Modules/Feature/Moments/test/otbComplexMomentsImageFunction.cxx @@ -165,7 +165,7 @@ int otbComplexMomentsImageFunctionScaleInvariant(int itkNotUsed(argc), char * ar { for (unsigned int l=0; l<=q; ++l) { - error += vcl_pow(vcl_abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); + error += std::pow(std::abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); std::cout << "Original - C" << k << l << " : " << Result1.at(k).at(l) @@ -174,7 +174,7 @@ int otbComplexMomentsImageFunctionScaleInvariant(int itkNotUsed(argc), char * ar } } - error = vcl_sqrt(error)/(q+p); + error = std::sqrt(error)/(q+p); std::cout << "Error : " << error << std::endl << std::endl; diff --git a/Modules/Feature/Moments/test/otbFlusserMomentsImageFunction.cxx b/Modules/Feature/Moments/test/otbFlusserMomentsImageFunction.cxx index e2e5c387e1826fd8e37c9b2e0155c3518bbca81a..56648d16649bb9e22102d6e6ecd41634df7221f9 100644 --- a/Modules/Feature/Moments/test/otbFlusserMomentsImageFunction.cxx +++ b/Modules/Feature/Moments/test/otbFlusserMomentsImageFunction.cxx @@ -148,7 +148,7 @@ int otbFlusserMomentsImageFunctionScaleInvariant(int itkNotUsed(argc), char * ar for (unsigned int j = 1; j < 12; ++j) { - error += vcl_pow(vcl_abs( Result1[j-1] - Result2[j-1]), 2); + error += std::pow(std::abs( Result1[j-1] - Result2[j-1]), 2); std::cout << "Original -F" << j << " : " << Result1[j-1] @@ -156,7 +156,7 @@ int otbFlusserMomentsImageFunctionScaleInvariant(int itkNotUsed(argc), char * ar << " : " << Result2[j-1] << std::endl; } - error = vcl_sqrt(error)/11.0; + error = std::sqrt(error)/11.0; std::cout << "Error : " << error << std::endl << std::endl; @@ -224,7 +224,7 @@ int otbFlusserMomentsImageFunctionRotationInvariant(int itkNotUsed(argc), char * translation1[1] = -imageCenterY; transform->Translate( translation1 ); - const double degreesToRadians = vcl_atan(1.0) / 45.0; + const double degreesToRadians = std::atan(1.0) / 45.0; const double angle = angleInDegrees * degreesToRadians; transform->Rotate2D( -angle, false ); @@ -254,7 +254,7 @@ int otbFlusserMomentsImageFunctionRotationInvariant(int itkNotUsed(argc), char * for (unsigned int j = 1; j < 12; ++j) { - error += vcl_pow(vcl_abs( Result1[j-1] - Result2[j-1]), 2); + error += std::pow(std::abs( Result1[j-1] - Result2[j-1]), 2); std::cout << "Original -F" << j << " : " << Result1[j-1] @@ -262,7 +262,7 @@ int otbFlusserMomentsImageFunctionRotationInvariant(int itkNotUsed(argc), char * << " : " << Result2[j-1] << std::endl; } - error = vcl_sqrt(error)/11.0; + error = std::sqrt(error)/11.0; std::cout << "Error : " << error << std::endl << std::endl; diff --git a/Modules/Feature/Moments/test/otbHuMomentsImageFunction.cxx b/Modules/Feature/Moments/test/otbHuMomentsImageFunction.cxx index 3a1da3fc5269011ccc3443bea34734473f82697f..f1a2f53d73a909daf6930958144a9313e4db2787 100644 --- a/Modules/Feature/Moments/test/otbHuMomentsImageFunction.cxx +++ b/Modules/Feature/Moments/test/otbHuMomentsImageFunction.cxx @@ -147,7 +147,7 @@ int otbHuMomentsImageFunctionScaleInvariant(int itkNotUsed(argc), char * argv[]) for (unsigned int j = 1; j < 8; ++j) { - error += vcl_pow(vcl_abs( Result1[j-1] - Result2[j-1]), 2); + error += std::pow(std::abs( Result1[j-1] - Result2[j-1]), 2); std::cout << "Original -H" << j << " : " << Result1[j-1] @@ -155,7 +155,7 @@ int otbHuMomentsImageFunctionScaleInvariant(int itkNotUsed(argc), char * argv[]) << " : " << Result2[j-1] << std::endl; } - error = vcl_sqrt(error)/7.0; + error = std::sqrt(error)/7.0; std::cout << "Error : " << error << std::endl << std::endl; @@ -223,7 +223,7 @@ int otbHuMomentsImageFunctionRotationInvariant(int itkNotUsed(argc), char * argv translation1[1] = -imageCenterY; transform->Translate( translation1 ); - const double degreesToRadians = vcl_atan(1.0) / 45.0; + const double degreesToRadians = std::atan(1.0) / 45.0; const double angle = angleInDegrees * degreesToRadians; transform->Rotate2D( -angle, false ); @@ -253,7 +253,7 @@ int otbHuMomentsImageFunctionRotationInvariant(int itkNotUsed(argc), char * argv for (unsigned int j = 1; j < 8; ++j) { - error += vcl_pow(vcl_abs( Result1[j-1] - Result2[j-1]), 2); + error += std::pow(std::abs( Result1[j-1] - Result2[j-1]), 2); std::cout << "Original -H" << j << " : " << Result1[j-1] @@ -261,7 +261,7 @@ int otbHuMomentsImageFunctionRotationInvariant(int itkNotUsed(argc), char * argv << " : " << Result2[j-1] << std::endl; } - error = vcl_sqrt(error)/7.0; + error = std::sqrt(error)/7.0; std::cout << "Error : " << error << std::endl << std::endl; diff --git a/Modules/Feature/Textures/include/otbHaralickTexturesImageFunction.hxx b/Modules/Feature/Textures/include/otbHaralickTexturesImageFunction.hxx index 896b7939c6a867938907e6ae89de56f20e0ea5d5..adcb1ab5a8978f85e1ba3d77d6ca88d29bd1f01b 100644 --- a/Modules/Feature/Textures/include/otbHaralickTexturesImageFunction.hxx +++ b/Modules/Feature/Textures/include/otbHaralickTexturesImageFunction.hxx @@ -80,7 +80,7 @@ HaralickTexturesImageFunction<TInputImage, TCoordRep> return textures; } - const double log2 = vcl_log(2.0); + const double log2 = std::log(2.0); // Retrieve the input pointer InputImagePointerType inputPtr = const_cast<InputImageType *> (this->GetInputImage()); @@ -107,7 +107,7 @@ HaralickTexturesImageFunction<TInputImage, TCoordRep> unsigned int minRadius = 0; for ( unsigned int i = 0; i < m_Offset.GetOffsetDimension(); i++ ) { - unsigned int distance = vcl_abs(m_Offset[i]); + unsigned int distance = std::abs(m_Offset[i]); if ( distance > minRadius ) { minRadius = distance; @@ -163,7 +163,7 @@ HaralickTexturesImageFunction<TInputImage, TCoordRep> M(1) = x(1), M(k) = M(k-1) + (x(k) - M(k-1) ) / k S(1) = 0, S(k) = S(k-1) + (x(k) - M(k-1)) * (x(k) - M(k)) for 2 <= k <= n, then - sigma = vcl_sqrt(S(n) / n) (or divide by n-1 for sample SD instead of + sigma = std::sqrt(S(n) / n) (or divide by n-1 for sample SD instead of population SD). */ std::vector<double>::const_iterator msIt = marginalSums.begin(); @@ -208,12 +208,12 @@ HaralickTexturesImageFunction<TInputImage, TCoordRep> CooccurrenceIndexType index2 = (*constVectorIt).first; RelativeFrequencyType frequency = (*constVectorIt).second / totalFrequency; textures[0] += frequency * frequency; - textures[1] -= ( frequency > GetPixelValueTolerance() ) ? frequency *vcl_log(frequency) / log2:0; + textures[1] -= ( frequency > GetPixelValueTolerance() ) ? frequency *std::log(frequency) / log2:0; textures[2] += ( ( index2[0] - pixelMean ) * ( index2[1] - pixelMean ) * frequency ) / pixelVarianceSquared; textures[3] += frequency / ( 1.0 + ( index2[0] - index2[1] ) * ( index2[0] - index2[1] ) ); textures[4] += ( index2[0] - index2[1] ) * ( index2[0] - index2[1] ) * frequency; - textures[5] += vcl_pow( ( index2[0] - pixelMean ) + ( index2[1] - pixelMean ), 3 ) * frequency; - textures[6] += vcl_pow( ( index2[0] - pixelMean ) + ( index2[1] - pixelMean ), 4 ) * frequency; + textures[5] += std::pow( ( index2[0] - pixelMean ) + ( index2[1] - pixelMean ), 3 ) * frequency; + textures[6] += std::pow( ( index2[0] - pixelMean ) + ( index2[1] - pixelMean ), 4 ) * frequency; textures[7] += index2[0] * index2[1] * frequency; ++constVectorIt; } diff --git a/Modules/Feature/Textures/include/otbSFSTexturesFunctor.h b/Modules/Feature/Textures/include/otbSFSTexturesFunctor.h index b1b9ee1b7adfa51ce508c885660d980aa154907b..07207b94ed3f5c7651205bf80a167906bd748133 100644 --- a/Modules/Feature/Textures/include/otbSFSTexturesFunctor.h +++ b/Modules/Feature/Textures/include/otbSFSTexturesFunctor.h @@ -133,8 +133,8 @@ public: angle = m_DirectionStep * static_cast<double>(d); // last offset in the direction respecting spatial threshold - off[0] = static_cast<int>(vcl_floor(SpatialThresholdDouble * vcl_cos(angle) + 0.5)); - off[1] = static_cast<int>(vcl_floor(SpatialThresholdDouble * vcl_sin(angle) + 0.5)); + off[0] = static_cast<int>(std::floor(SpatialThresholdDouble * std::cos(angle) + 0.5)); + off[1] = static_cast<int>(std::floor(SpatialThresholdDouble * std::sin(angle) + 0.5)); // last indices in the direction respecting spectral threshold OffsetType offEnd = this->FindLastOffset(it, off); @@ -144,7 +144,7 @@ public: OffsetType offStart = this->FindLastOffset(it, off); // computes distance = dist between the 2 segment point. - dist = vcl_sqrt(vcl_pow(static_cast<double>(offEnd[0]-offStart[0]), 2) + vcl_pow(static_cast<double>(offEnd[1]-offStart[1]), 2)); + dist = std::sqrt(std::pow(static_cast<double>(offEnd[0]-offStart[0]), 2) + std::pow(static_cast<double>(offEnd[1]-offStart[1]), 2)); // for length computation if (m_SelectedTextures[0] == true) if (dist > length) length = dist; @@ -190,7 +190,7 @@ public: di[d] = dist; if (m_SelectedTextures[3] == true) { - lengthLine[d] = static_cast<unsigned int>(dist); //static_cast<unsigned int>( vcl_sqrt(vcl_pow(static_cast<double>(offEnd[0]), 2) + vcl_pow(static_cast<double>(offEnd[1]), 2)) ); + lengthLine[d] = static_cast<unsigned int>(dist); //static_cast<unsigned int>( std::sqrt(std::pow(static_cast<double>(offEnd[0]), 2) + std::pow(static_cast<double>(offEnd[1]), 2)) ); sti[d] = sdiVal; if (sdiVal != 0.) sumWMean += (m_Alpha * (dist - 1) * dist /*lengthLine[n]*di[n]*/) / sdiVal; } @@ -215,7 +215,7 @@ public: sumMin += minSorted[t]; sumMax += maxSorted[t]; } - if (sumMax != 0.) out[4] = static_cast<OutputValueType>(vcl_atan(sumMin / sumMax)); + if (sumMax != 0.) out[4] = static_cast<OutputValueType>(std::atan(sumMin / sumMax)); else if (sumMax == 0. && sumMin == 0.) out[4] = static_cast<OutputValueType>(1.); } // SD @@ -223,8 +223,8 @@ public: { double sumPSI = 0; for (unsigned int n = 0; n < di.size(); ++n) - sumPSI += vcl_pow(di[n] - sumWMean / NumberOfDirectionsDouble, 2); - out[5] = static_cast<OutputValueType>(vcl_sqrt(sumPSI) / (NumberOfDirectionsDouble - 1.)); + sumPSI += std::pow(di[n] - sumWMean / NumberOfDirectionsDouble, 2); + out[5] = static_cast<OutputValueType>(std::sqrt(sumPSI) / (NumberOfDirectionsDouble - 1.)); } return out; @@ -253,7 +253,7 @@ public: { this->ComputePointLine(currentOff, slop, signY, stopOffset[0]); - if (vcl_abs(it.GetPixel(currentOff) - it.GetCenterPixel()) > m_SpectralThreshold) + if (std::abs(it.GetPixel(currentOff) - it.GetCenterPixel()) > m_SpectralThreshold) { res = false; } @@ -291,7 +291,7 @@ public: mean += static_cast<double>(it.GetPixel(currentOff)); nbElt++; - if (vcl_abs(it.GetPixel(currentOff) - it.GetCenterPixel()) >= m_SpectralThreshold) canGo = false; + if (std::abs(it.GetPixel(currentOff) - it.GetCenterPixel()) >= m_SpectralThreshold) canGo = false; else currentOff[0] += signX; isInside = this->CheckIsInside(signX, signY, currentOff, stopOffset); @@ -306,14 +306,14 @@ public: { this->ComputePointLine(currentOff, slop, signY, stopOffset[0]); - SDi += vcl_pow((static_cast<double>(it.GetPixel(currentOff)) - mean), 2); - if (vcl_abs(it.GetPixel(currentOff) - it.GetCenterPixel()) >= m_SpectralThreshold) canGo = false; + SDi += std::pow((static_cast<double>(it.GetPixel(currentOff)) - mean), 2); + if (std::abs(it.GetPixel(currentOff) - it.GetCenterPixel()) >= m_SpectralThreshold) canGo = false; else currentOff[0] += signX; isInside = this->CheckIsInside(signX, signY, currentOff, stopOffset); } - return vcl_sqrt(SDi); + return std::sqrt(SDi); } /** Check if the current offset is inside the stop one. */ @@ -332,7 +332,7 @@ public: */ void ComputePointLine(OffsetType& currentOff, const double& slop, const int& signY, const int& stopOffsetX) { - if (stopOffsetX != 0) currentOff[1] = static_cast<int>(vcl_floor(slop * static_cast<double>(currentOff[0]) + 0.5)); + if (stopOffsetX != 0) currentOff[1] = static_cast<int>(std::floor(slop * static_cast<double>(currentOff[0]) + 0.5)); else currentOff[1] += signY; } diff --git a/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx index 20dad10abfc4e5d2ea300009812e381155989a4e..55ec05c3b6b6e56284076bd75d5c5464f3ceeb51 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx @@ -303,7 +303,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> unsigned int minRadius = 0; for ( unsigned int i = 0; i < m_Offset.GetOffsetDimension(); i++ ) { - unsigned int distance = vcl_abs(m_Offset[i]); + unsigned int distance = std::abs(m_Offset[i]); if ( distance > minRadius ) { minRadius = distance; @@ -354,7 +354,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ic1It.GoToBegin(); ic2It.GoToBegin(); - const double log2 = vcl_log(2.0); + const double log2 = std::log(2.0); const unsigned int histSize = m_NumberOfBinsPerAxis; const long unsigned int twiceHistSize = 2 * m_NumberOfBinsPerAxis; @@ -462,7 +462,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> CooccurrenceIndexType index = (*constVectorIt).first; double frequency = (*constVectorIt).second / totalFrequency; m_Mean += static_cast<double>(index[0]) * frequency; - Entropy -= (frequency > 0.0001) ? frequency * vcl_log(frequency) / log2 : 0.; + Entropy -= (frequency > 0.0001) ? frequency * std::log(frequency) / log2 : 0.; unsigned int i = index[1]; unsigned int j = index[0]; hx[j] += frequency; @@ -491,7 +491,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> double index0 = static_cast<double>(index[0]); m_Variance += ((index0 - m_Mean) * (index0 - m_Mean)) * frequency; double pipj = hx[j] * hy[i]; - hxy1 -= (pipj > 0.0001) ? frequency * vcl_log(pipj) : 0.; + hxy1 -= (pipj > 0.0001) ? frequency * std::log(pipj) : 0.; ++constVectorIt; } @@ -500,7 +500,7 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> for(long unsigned int k = histSize; k < twiceHistSize; k++) { m_SumAverage += k * pdxy[k]; - m_SumEntropy -= (pdxy[k] > 0.0001) ? pdxy[k] * vcl_log(pdxy[k]) / log2 : 0; + m_SumEntropy -= (pdxy[k] > 0.0001) ? pdxy[k] * std::log(pdxy[k]) / log2 : 0; PSSquareCumul += k * k * pdxy[k]; } m_SumVariance = PSSquareCumul - m_SumAverage * m_SumAverage; @@ -514,15 +514,15 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> { double pdTmp = pdxy[i]; PDCumul += i * pdTmp; - m_DifferenceEntropy -= (pdTmp > 0.0001) ? pdTmp * vcl_log(pdTmp) / log2 : 0; + m_DifferenceEntropy -= (pdTmp > 0.0001) ? pdTmp * std::log(pdTmp) / log2 : 0; PDSquareCumul += i * i * pdTmp; //comput hxCumul and hyCumul double marginalfreq = hx[i]; - hxCumul += (marginalfreq > 0.0001) ? vcl_log (marginalfreq) * marginalfreq : 0; + hxCumul += (marginalfreq > 0.0001) ? std::log (marginalfreq) * marginalfreq : 0; marginalfreq = hy[i]; - hyCumul += (marginalfreq > 0.0001) ? vcl_log (marginalfreq) * marginalfreq : 0; + hyCumul += (marginalfreq > 0.0001) ? std::log (marginalfreq) * marginalfreq : 0; } m_DifferenceVariance = PDSquareCumul - PDCumul * PDCumul; @@ -534,16 +534,16 @@ ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> for(unsigned int j = 0; j < histSize; ++j) { double pipj = hx[j] * hy[i]; - hxy2 -= (pipj > 0.0001) ? pipj * vcl_log(pipj) : 0.; + hxy2 -= (pipj > 0.0001) ? pipj * std::log(pipj) : 0.; double frequency = GLCIList->GetFrequency(i,j, glcVector) / totalFrequency; m_Dissimilarity+= ( static_cast<double>(j) - static_cast<double>(i) ) * (frequency * frequency); } } //Information measures of correlation 1 & 2 - m_IC1 = (vcl_abs(std::max (hxCumul, hyCumul)) > 0.0001) ? (Entropy - hxy1) / (std::max (hxCumul, hyCumul)) : 0; - m_IC2 = 1 - vcl_exp (-2. * vcl_abs (hxy2 - Entropy)); - m_IC2 = (m_IC2 >= 0) ? vcl_sqrt (m_IC2) : 0; + m_IC1 = (std::abs(std::max (hxCumul, hyCumul)) > 0.0001) ? (Entropy - hxy1) / (std::max (hxCumul, hyCumul)) : 0; + m_IC2 = 1 - std::exp (-2. * std::abs (hxy2 - Entropy)); + m_IC2 = (m_IC2 >= 0) ? std::sqrt (m_IC2) : 0; // Fill outputs meanIt.Set(m_Mean); diff --git a/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx index a679cce10b097b2f731e165a4408809262a97f73..be3624e56e91835a21f54bfe54358ab36edfa105 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx @@ -172,7 +172,7 @@ ScalarImageToPanTexTextureFilter<TInputImage, TOutputImage> unsigned int minRadius = 0; for ( unsigned int i = 0; i < currentOffset.GetOffsetDimension(); i++ ) { - unsigned int distance = vcl_abs(currentOffset[i]); + unsigned int distance = std::abs(currentOffset[i]); if ( distance > minRadius ) { minRadius = distance; diff --git a/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx index 1057373d7baadc905359c8e1b086d13172a030a2..86c0cd03d7cb4be9c3cc3367cfe1ed392aa6971d 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx @@ -278,7 +278,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> unsigned int minRadius = 0; for ( unsigned int i = 0; i < m_Offset.GetOffsetDimension(); i++ ) { - unsigned int distance = vcl_abs(m_Offset[i]); + unsigned int distance = std::abs(m_Offset[i]); if ( distance > minRadius ) { minRadius = distance; @@ -323,7 +323,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> clusterProminenceIt.GoToBegin(); haralickCorIt.GoToBegin(); - const double log2 = vcl_log(2.0); + const double log2 = std::log(2.0); InputRegionType inputLargest = inputPtr->GetLargestPossibleRegion(); @@ -411,7 +411,7 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> M(1) = x(1), M(k) = M(k-1) + (x(k) - M(k-1) ) / k S(1) = 0, S(k) = S(k-1) + (x(k) - M(k-1)) * (x(k) - M(k)) for 2 <= k <= n, then - sigma = vcl_sqrt(S(n) / n) (or divide by n-1 for sample SD instead of + sigma = std::sqrt(S(n) / n) (or divide by n-1 for sample SD instead of population SD). */ std::vector<double>::const_iterator msIt = marginalSums.begin(); @@ -466,12 +466,12 @@ ScalarImageToTexturesFilter<TInputImage, TOutputImage> CooccurrenceIndexType index = (*constVectorIt).first; RelativeFrequencyType frequency = (*constVectorIt).second / totalFrequency; energy += frequency * frequency; - entropy -= ( frequency > GetPixelValueTolerance() ) ? frequency *vcl_log(frequency) / log2 : 0; + entropy -= ( frequency > GetPixelValueTolerance() ) ? frequency *std::log(frequency) / log2 : 0; correlation += ( ( index[0] - pixelMean ) * ( index[1] - pixelMean ) * frequency ) / pixelVarianceSquared; inverseDifferenceMoment += frequency / ( 1.0 + ( index[0] - index[1] ) * ( index[0] - index[1] ) ); inertia += ( index[0] - index[1] ) * ( index[0] - index[1] ) * frequency; - clusterShade += vcl_pow( ( index[0] - pixelMean ) + ( index[1] - pixelMean ), 3 ) * frequency; - clusterProminence += vcl_pow( ( index[0] - pixelMean ) + ( index[1] - pixelMean ), 4 ) * frequency; + clusterShade += std::pow( ( index[0] - pixelMean ) + ( index[1] - pixelMean ), 3 ) * frequency; + clusterProminence += std::pow( ( index[0] - pixelMean ) + ( index[1] - pixelMean ), 4 ) * frequency; haralickCorrelation += index[0] * index[1] * frequency; ++constVectorIt; } diff --git a/Modules/Feature/Textures/include/otbTextureImageFunction.hxx b/Modules/Feature/Textures/include/otbTextureImageFunction.hxx index 7c886cb65ce6ec47b3245862aa38640f0f606044..608095cad9e614220c95411a8198dbd9b776aa33 100644 --- a/Modules/Feature/Textures/include/otbTextureImageFunction.hxx +++ b/Modules/Feature/Textures/include/otbTextureImageFunction.hxx @@ -70,8 +70,8 @@ TextureImageFunction<TInputImage, TFunctor, TCoordRep> } SizeType radiusOff; - radiusOff[0] = (m_Radius[0]) + vcl_abs(m_Offset[0]); - radiusOff[1] = (m_Radius[1]) + vcl_abs(m_Offset[1]); + radiusOff[0] = (m_Radius[0]) + std::abs(m_Offset[0]); + radiusOff[1] = (m_Radius[1]) + std::abs(m_Offset[1]); IteratorType itOff(radiusOff, this->GetInputImage(), this->GetInputImage()->GetBufferedRegion()); itOff.SetLocation(index); diff --git a/Modules/Feature/Textures/test/otbGreyLevelCooccurrenceIndexedList.cxx b/Modules/Feature/Textures/test/otbGreyLevelCooccurrenceIndexedList.cxx index 0ebe0555621ea87e694acd8cf781064f49946933..325dec3f1a5e510d33feeb28f7d270b7e2dc4d1a 100644 --- a/Modules/Feature/Textures/test/otbGreyLevelCooccurrenceIndexedList.cxx +++ b/Modules/Feature/Textures/test/otbGreyLevelCooccurrenceIndexedList.cxx @@ -125,7 +125,7 @@ int otbGreyLevelCooccurrenceIndexedList(int, char* [] ) unsigned int minRadius = 0; for ( unsigned int i = 0; i < offset.GetOffsetDimension(); i++ ) { - unsigned int distance = vcl_abs(offset[i]); + unsigned int distance = std::abs(offset[i]); if ( distance > minRadius ) { minRadius = distance; diff --git a/Modules/Filtering/ChangeDetection/include/otbCBAMI.h b/Modules/Filtering/ChangeDetection/include/otbCBAMI.h index 4c3fd1b76b39f2fa812c97eb70211930cfc4da1e..9c4fd739226e1aeac46f04fbb430c087048f60a5 100644 --- a/Modules/Filtering/ChangeDetection/include/otbCBAMI.h +++ b/Modules/Filtering/ChangeDetection/include/otbCBAMI.h @@ -60,7 +60,7 @@ public: normalizeInPlace(vecA); normalizeInPlace(vecB); - return static_cast<TOutput>(-vcl_log(static_cast<double>(PhiMI(vecA, vecB) + epsilon))); + return static_cast<TOutput>(-std::log(static_cast<double>(PhiMI(vecA, vecB) + epsilon))); } protected: @@ -83,14 +83,14 @@ protected: for (itx = vx.begin(); itx < vx.end(); ++itx) { - Vx += static_cast<TOutput>(vcl_pow(static_cast<double>((*itx) - Ex), 2)); + Vx += static_cast<TOutput>(std::pow(static_cast<double>((*itx) - Ex), 2)); } Vx /= (vx.size()); for (itx = vx.begin(); itx < vx.end(); ++itx) { - (*itx) = ((*itx) - Ex) / static_cast<TOutput>(vcl_sqrt(static_cast<double>(Vx))); + (*itx) = ((*itx) - Ex) / static_cast<TOutput>(std::sqrt(static_cast<double>(Vx))); } } @@ -246,7 +246,7 @@ protected: for (iti = donnees.begin(); iti < donnees.end(); ++iti) for (itj = donnees.begin(); itj < donnees.end(); ++itj) { - if (iti != itj) termeR += static_cast<TOutput>(vcl_pow(static_cast<double>(Rxy((*iti), (*itj))), 2)); + if (iti != itj) termeR += static_cast<TOutput>(std::pow(static_cast<double>(Rxy((*iti), (*itj))), 2)); for (itk = donnees.begin(); itk < donnees.end(); ++itk) for (itl = donnees.begin(); itl < donnees.end(); itl++) @@ -255,7 +255,7 @@ protected: (iti != itl)) termeQ += - static_cast<TOutput>(vcl_pow(static_cast<double>(Qxijkl((*iti), (*itj), (*itk), (*itl))), 2)); + static_cast<TOutput>(std::pow(static_cast<double>(Qxijkl((*iti), (*itj), (*itk), (*itl))), 2)); } } diff --git a/Modules/Filtering/ChangeDetection/include/otbCrossCorrelation.h b/Modules/Filtering/ChangeDetection/include/otbCrossCorrelation.h index 0dcbf566cb2313fa3a5c9b614e0fa11b9b5ec677..90523a19166ceb122e5425aa25005e8e1c45ffb4 100644 --- a/Modules/Filtering/ChangeDetection/include/otbCrossCorrelation.h +++ b/Modules/Filtering/ChangeDetection/include/otbCrossCorrelation.h @@ -74,10 +74,10 @@ public: { varA += - static_cast<TOutput>(vcl_pow(static_cast<double>(itA.GetPixel(pos)) - static_cast<double>(meanA), + static_cast<TOutput>(std::pow(static_cast<double>(itA.GetPixel(pos)) - static_cast<double>(meanA), static_cast<double>(2.0))); varB += - static_cast<TOutput>(vcl_pow(static_cast<double>(itB.GetPixel(pos)) - static_cast<double>(meanB), + static_cast<TOutput>(std::pow(static_cast<double>(itB.GetPixel(pos)) - static_cast<double>(meanB), static_cast<double>(2.0))); } @@ -94,7 +94,7 @@ public: crossCorrel += (static_cast<TOutput>(itA.GetPixel(pos)) - meanA) * - (static_cast<TOutput>(itB.GetPixel(pos)) - meanB) / (itA.Size() * vcl_sqrt(static_cast<double>(varA * varB))); + (static_cast<TOutput>(itB.GetPixel(pos)) - meanB) / (itA.Size() * std::sqrt(static_cast<double>(varA * varB))); } } else if (varA == itk::NumericTraits<TOutput>::Zero && varB == itk::NumericTraits<TOutput>::Zero) diff --git a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMI.h b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMI.h index 7c077776ec7a55e6af7b899d86ed4675d89c25a5..b8b84442f00a19f04850b19e82631c3df1630045 100644 --- a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMI.h +++ b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMI.h @@ -58,13 +58,13 @@ public: HistogramFrequencyType freq = histogram->GetFrequency(index); if (freq > 0) { - jointEntropy += freq * vcl_log(freq); + jointEntropy += freq * std::log(freq); } } jointEntropy = -jointEntropy / static_cast<TOutput>(totalFreq) + - vcl_log(totalFreq); + std::log(totalFreq); return jointEntropy; } diff --git a/Modules/Filtering/ChangeDetection/include/otbLHMI.h b/Modules/Filtering/ChangeDetection/include/otbLHMI.h index eb7d1caf2e68c1c52dc3dd2e8110a688943115d9..94427156cbe0396c6a1ad9ccffa2f5538f9729f2 100644 --- a/Modules/Filtering/ChangeDetection/include/otbLHMI.h +++ b/Modules/Filtering/ChangeDetection/include/otbLHMI.h @@ -135,22 +135,22 @@ public: HistogramFrequencyType freq = histogram->GetFrequency(i, 0); if (freq > 0) { - entropyX += freq * vcl_log(freq); + entropyX += freq * std::log(freq); } } - entropyX = -entropyX / static_cast<TOutput>(totalFreq) + vcl_log(totalFreq); + entropyX = -entropyX / static_cast<TOutput>(totalFreq) + std::log(totalFreq); for (unsigned int i = 0; i < histogram->GetSize()[1]; ++i) { HistogramFrequencyType freq = histogram->GetFrequency(i, 1); if (freq > 0) { - entropyY += freq * vcl_log(freq); + entropyY += freq * std::log(freq); } } - entropyY = -entropyY / static_cast<TOutput>(totalFreq) + vcl_log(totalFreq); + entropyY = -entropyY / static_cast<TOutput>(totalFreq) + std::log(totalFreq); HistogramIteratorType it = histogram->Begin(); HistogramIteratorType end = histogram->End(); @@ -159,13 +159,13 @@ public: HistogramFrequencyType freq = it.GetFrequency(); if (freq > 0) { - jointEntropy += freq * vcl_log(freq); + jointEntropy += freq * std::log(freq); } ++it; } jointEntropy = -jointEntropy / static_cast<TOutput>(totalFreq) + - vcl_log(totalFreq); + std::log(totalFreq); return static_cast<TOutput>(jointEntropy / (entropyX + entropyY)); } diff --git a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx index 5caa2b0012d4da3e2f98c11aa5304e31993b7ec2..656294f8642d28ddd214c67e21f287140a153a01 100644 --- a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx +++ b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx @@ -157,12 +157,12 @@ MultivariateAlterationDetectorImageFilter<TInputImage, TOutputImage> // Compute canonical correlation matrix m_Rho = ges.D.get_diagonal(); - m_Rho = m_Rho.apply(&vcl_sqrt); + m_Rho = m_Rho.apply(&std::sqrt); // We do not need to scale v1 since the // vnl_generalized_eigensystem already gives unit variance - VnlMatrixType invstderr1 = s11.apply(&vcl_sqrt); + VnlMatrixType invstderr1 = s11.apply(&std::sqrt); invstderr1 = invstderr1.apply(&InverseValue); VnlVectorType diag1 = invstderr1.get_diagonal(); invstderr1.fill(0); @@ -189,7 +189,7 @@ MultivariateAlterationDetectorImageFilter<TInputImage, TOutputImage> // Scale v2 for unit variance VnlMatrixType aux1 = m_V2.transpose() * (s22 * m_V2); VnlVectorType aux2 = aux1.get_diagonal(); - aux2 = aux2.apply(&vcl_sqrt); + aux2 = aux2.apply(&std::sqrt); aux2 = aux2.apply(&InverseValue); VnlMatrixType aux3 = VnlMatrixType(aux2.size(), aux2.size(), 0); aux3.fill(0); @@ -221,14 +221,14 @@ MultivariateAlterationDetectorImageFilter<TInputImage, TOutputImage> VnlMatrixType aux1 = m_V1.transpose() * (s11 * m_V1); VnlVectorType aux2 = aux1.get_diagonal(); - aux2 = aux2.apply(&vcl_sqrt); + aux2 = aux2.apply(&std::sqrt); aux2 = aux2.apply(&InverseValue); VnlMatrixType aux3 = VnlMatrixType(aux2.size(), aux2.size(), 0); aux3.set_diagonal(aux2); m_V1 = m_V1 * aux3; - VnlMatrixType invstderr1 = s11.apply(&vcl_sqrt); + VnlMatrixType invstderr1 = s11.apply(&std::sqrt); invstderr1 = invstderr1.apply(&InverseValue); VnlVectorType diag1 = invstderr1.get_diagonal(); invstderr1.fill(0); @@ -253,7 +253,7 @@ MultivariateAlterationDetectorImageFilter<TInputImage, TOutputImage> // Scale v2 for unit variance aux1 = m_V2.transpose() * (s22 * m_V2); aux2 = aux1.get_diagonal(); - aux2 = aux2.apply(&vcl_sqrt); + aux2 = aux2.apply(&std::sqrt); aux2 = aux2.apply(&InverseValue); aux3 = VnlMatrixType(aux2.size(), aux2.size(), 0); aux3.fill(0); @@ -349,7 +349,7 @@ MultivariateAlterationDetectorImageFilter<TInputImage, TOutputImage> if(i < outNbComp - std::min(nbComp1, nbComp2)) { - outPixel[i]*=vcl_sqrt(2.); + outPixel[i]*=std::sqrt(2.); } } } diff --git a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx index 09934d80b65372364017b23fd7a5cea41116053a..dd68c531705177e29ee02cea7540a2346cec7e68 100644 --- a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx @@ -132,9 +132,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPre norm = itk::NumericTraits<InputRealType>::Zero; for (i = 0; i < neighborhoodSize; ++i) { - norm += static_cast<InputRealType>(vcl_abs(m_Filter(i))); + norm += static_cast<InputRealType>(std::abs(m_Filter(i))); } - norm_double = static_cast<double>(vcl_abs(norm)); + norm_double = static_cast<double>(std::abs(norm)); } while (!inputIt.IsAtEnd()) diff --git a/Modules/Filtering/Convolution/include/otbGaborFilterGenerator.hxx b/Modules/Filtering/Convolution/include/otbGaborFilterGenerator.hxx index 03cea48f91c442d00512f11f01052fdee60d4bef..ccd69d71eabd7e81bcd923b69cc25e988e966024 100644 --- a/Modules/Filtering/Convolution/include/otbGaborFilterGenerator.hxx +++ b/Modules/Filtering/Convolution/include/otbGaborFilterGenerator.hxx @@ -64,8 +64,8 @@ GaborFilterGenerator<TPrecision> PrecisionType coef, xr, yr, costheta, sintheta; unsigned int k = 0; - costheta = vcl_cos(m_Theta * CONST_PI_180); - sintheta = vcl_sin(m_Theta * CONST_PI_180); + costheta = std::cos(m_Theta * CONST_PI_180); + sintheta = std::sin(m_Theta * CONST_PI_180); for (PrecisionType y = -static_cast<PrecisionType>(m_Radius[1]); y <= static_cast<PrecisionType>(m_Radius[1]); y += 1) @@ -75,7 +75,7 @@ GaborFilterGenerator<TPrecision> { xr = x * costheta + y * sintheta; yr = y * costheta - x * sintheta; - coef = vcl_exp(-CONST_PI * (vcl_pow(m_A * xr, 2) + vcl_pow(m_B * yr, 2))) * cos( + coef = std::exp(-CONST_PI * (std::pow(m_A * xr, 2) + std::pow(m_B * yr, 2))) * cos( CONST_2PI * (m_U0 * x + m_V0 * y) + m_Phi); m_Filter.SetElement(k, coef); ++k; diff --git a/Modules/Filtering/DEM/include/otbDEMCaracteristicsExtractor.hxx b/Modules/Filtering/DEM/include/otbDEMCaracteristicsExtractor.hxx index 227381aff1101b0f4c024d22ebb276248a105c36..caf739628ec5b7dc1682e7cf3eb7ca6704ad86a5 100644 --- a/Modules/Filtering/DEM/include/otbDEMCaracteristicsExtractor.hxx +++ b/Modules/Filtering/DEM/include/otbDEMCaracteristicsExtractor.hxx @@ -142,7 +142,7 @@ DEMCaracteristicsExtractor<TInputImage, TOutputImage> cosAAzimut->SetInput(addAzimut->GetOutput()); typename MultiplyByScalarImageFilterType::Pointer sinSsinSolarAngleFilter = MultiplyByScalarImageFilterType::New(); - sinSsinSolarAngleFilter->SetCoef(vcl_sin(m_SolarAngle / rad2degCoef)); + sinSsinSolarAngleFilter->SetCoef(std::sin(m_SolarAngle / rad2degCoef)); sinSsinSolarAngleFilter->SetInput(sinS->GetOutput()); typename MultiplyImageFilterType::Pointer cosAAzimuthsinSsinAngle = MultiplyImageFilterType::New(); @@ -150,7 +150,7 @@ DEMCaracteristicsExtractor<TInputImage, TOutputImage> cosAAzimuthsinSsinAngle->SetInput2(cosAAzimut->GetOutput()); typename MultiplyByScalarImageFilterType::Pointer cosScosSolarAngleFilter = MultiplyByScalarImageFilterType::New(); - cosScosSolarAngleFilter->SetCoef(vcl_cos(m_SolarAngle / rad2degCoef)); + cosScosSolarAngleFilter->SetCoef(std::cos(m_SolarAngle / rad2degCoef)); cosScosSolarAngleFilter->SetInput(cosS->GetOutput()); typename AddImageFilterType::Pointer cosIncidence = AddImageFilterType::New(); @@ -178,7 +178,7 @@ DEMCaracteristicsExtractor<TInputImage, TOutputImage> cosAAzimut2->SetInput(addAzimut2->GetOutput()); typename MultiplyByScalarImageFilterType::Pointer sinSsinSolarAngleFilter2 = MultiplyByScalarImageFilterType::New(); - sinSsinSolarAngleFilter2->SetCoef(vcl_sin(m_ViewAngle / rad2degCoef)); + sinSsinSolarAngleFilter2->SetCoef(std::sin(m_ViewAngle / rad2degCoef)); sinSsinSolarAngleFilter2->SetInput(sinS->GetOutput()); typename MultiplyImageFilterType::Pointer cosAAzimuthsinSsinAngle2 = MultiplyImageFilterType::New(); @@ -186,7 +186,7 @@ DEMCaracteristicsExtractor<TInputImage, TOutputImage> cosAAzimuthsinSsinAngle2->SetInput2(cosAAzimut2->GetOutput()); typename MultiplyByScalarImageFilterType::Pointer cosScosSolarAngleFilter2 = MultiplyByScalarImageFilterType::New(); - cosScosSolarAngleFilter2->SetCoef(vcl_cos(m_ViewAngle / rad2degCoef)); + cosScosSolarAngleFilter2->SetCoef(std::cos(m_ViewAngle / rad2degCoef)); cosScosSolarAngleFilter2->SetInput(cosS->GetOutput()); typename AddImageFilterType::Pointer cosIncidence2 = AddImageFilterType::New(); diff --git a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionBinaryImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionBinaryImageFilter.hxx index 768f895475e5f403c821c57cb4288adfd9d4d610..961804450b2a27117aa3df19773332631c1fbb57 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionBinaryImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionBinaryImageFilter.hxx @@ -138,8 +138,8 @@ AngularProjectionBinaryImageFilter< TInputImage, TOutputImage, TPrecision > { for ( unsigned int i = 0; i < outIter.size(); ++i ) { - outIter[i].Set( vcl_cos( m_AngleSet[i] ) * iter1.Get() - + vcl_sin( m_AngleSet[i] ) * iter2.Get() ); + outIter[i].Set( std::cos( m_AngleSet[i] ) * iter1.Get() + + std::sin( m_AngleSet[i] ) * iter2.Get() ); ++outIter[i]; } diff --git a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionImageFilter.hxx index b4885472d422b03f96e24d007e8c902a2ec4fc9b..f2ca6925a66adfb83868f60721f84fdf94fe753b 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbAngularProjectionImageFilter.hxx @@ -113,17 +113,17 @@ AngularProjectionImageFilter< TInputImage, TOutputImage, TAngleArray, TPrecision if ( this->GetNumberOfInputs() == 2 ) { PrecisionType alpha = static_cast<PrecisionType>( m_AngleArray[0] ); - output = static_cast<PrecisionType>( it[0].Get() ) * vcl_cos( alpha ) - - static_cast<PrecisionType>( it[1].Get() ) * vcl_sin( alpha ); + output = static_cast<PrecisionType>( it[0].Get() ) * std::cos( alpha ) + - static_cast<PrecisionType>( it[1].Get() ) * std::sin( alpha ); } else if ( this->GetNumberOfInputs() == 3 ) { PrecisionType alpha = static_cast<PrecisionType>( m_AngleArray[0] ); PrecisionType beta = static_cast<PrecisionType>( m_AngleArray[1] ); - output = static_cast<PrecisionType>( it[0].Get() ) * vcl_cos( alpha ) - - static_cast<PrecisionType>( it[1].Get() ) * vcl_sin( alpha ) * vcl_cos ( beta ) - + static_cast<PrecisionType>( it[2].Get() ) * vcl_sin( alpha ) * vcl_sin ( beta ); + output = static_cast<PrecisionType>( it[0].Get() ) * std::cos( alpha ) + - static_cast<PrecisionType>( it[1].Get() ) * std::sin( alpha ) * std::cos ( beta ) + + static_cast<PrecisionType>( it[2].Get() ) * std::sin( alpha ) * std::sin ( beta ); } else { @@ -132,8 +132,8 @@ AngularProjectionImageFilter< TInputImage, TOutputImage, TAngleArray, TPrecision do { PrecisionType alpha = static_cast<PrecisionType>( m_AngleArray[i] ); - output = static_cast<PrecisionType>( it[i].Get() ) * vcl_cos( alpha ) - - output * vcl_sin( alpha ); + output = static_cast<PrecisionType>( it[i].Get() ) * std::cos( alpha ) + - output * std::sin( alpha ); } while ( i-- == 0 ); } diff --git a/Modules/Filtering/DimensionalityReduction/include/otbFastICAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbFastICAImageFilter.hxx index e3c432eb2569896e9ad0234268d0647aeea21aec..0bd3105abb93e9f4b0fd0dd715d72da6a391f4da 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbFastICAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbFastICAImageFilter.hxx @@ -48,7 +48,7 @@ FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > m_NumberOfIterations = 50; m_ConvergenceThreshold = 1E-4; - m_ContrastFunction = &vcl_tanh; + m_ContrastFunction = &std::tanh; m_Mu = 1.; m_PCAFilter = PCAFilterType::New(); @@ -291,10 +291,10 @@ FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > { W(band, bd) -= m_Mu * ( estimator->GetMean()[bd] - optimizer->GetBeta() * W(band, bd) / optimizer->GetDen() ); - norm += vcl_pow( W(band, bd), 2. ); + norm += std::pow( W(band, bd), 2. ); } for ( unsigned int bd = 0; bd < size; bd++ ) - W(band, bd) /= vcl_sqrt( norm ); + W(band, bd) /= std::sqrt( norm ); } // Decorrelation of the W vectors @@ -302,7 +302,7 @@ FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > vnl_svd< MatrixElementType > solver ( W_tmp ); InternalMatrixType valP = solver.W(); for ( unsigned int i = 0; i < valP.rows(); ++i ) - valP(i, i) = 1. / vcl_sqrt( static_cast<double>( valP(i, i) ) ); // Watch for 0 or neg + valP(i, i) = 1. / std::sqrt( static_cast<double>( valP(i, i) ) ); // Watch for 0 or neg InternalMatrixType transf = solver.U(); W_tmp = transf * valP * transf.transpose(); W = W_tmp * W; @@ -311,7 +311,7 @@ FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > convergence = 0.; for ( unsigned int i = 0; i < W.rows(); ++i ) for ( unsigned int j = 0; j < W.cols(); ++j ) - convergence += vcl_abs( W(i, j) - W_old(i, j) ); + convergence += std::abs( W(i, j) - W_old(i, j) ); reporter.CompletedPixel(); } // end of while loop diff --git a/Modules/Filtering/DimensionalityReduction/include/otbFastICAInternalOptimizerVectorImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbFastICAInternalOptimizerVectorImageFilter.hxx index 532e649979cda35711f583923a7d77215ac54373..f262f435455a3110f2b322510547086d290d01dc 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbFastICAInternalOptimizerVectorImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbFastICAInternalOptimizerVectorImageFilter.hxx @@ -41,7 +41,7 @@ FastICAInternalOptimizerVectorImageFilter< TInputImage, TOutputImage > m_Beta = 0.; m_Den = 0.; - m_ContrastFunction = &vcl_tanh; + m_ContrastFunction = &std::tanh; m_TransformFilter = TransformFilterType::New(); } @@ -105,7 +105,7 @@ FastICAInternalOptimizerVectorImageFilter< TInputImage, TOutputImage > double x_g_x = x * g_x; beta += x_g_x; - double gp = 1. - vcl_pow( g_x, 2. ); + double gp = 1. - std::pow( g_x, 2. ); den += gp; nbSample += 1.; diff --git a/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.hxx index e9a03578e61a53f48f144c1579779fccad071577..a07fc930074e978f85f2a2f632a23f0b94fb0bba 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbMNFImageFilter.hxx @@ -418,7 +418,7 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf for ( unsigned int i = 0; i < transf.rows(); ++i ) { - double norm = 1. / vcl_sqrt( normMat.get(i, i) ); + double norm = 1. / std::sqrt( normMat.get(i, i) ); for ( unsigned int j = 0; j < transf.cols(); ++j ) transf.put( j, i, transf.get(j, i) * norm ); } diff --git a/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx index ed6b2a476ee91944142e78023efce158b9131a82..d0159fcc90c66022996bef8a592021573e5e5cb1 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx @@ -154,12 +154,12 @@ MaximumAutocorrelationFactorImageFilter<TInputImage, TOutputImage> VnlMatrixType invstderr = VnlMatrixType(nbComp, nbComp, 0); invstderr.set_diagonal(sigma.get_diagonal()); - invstderr = invstderr.apply(&vcl_sqrt); + invstderr = invstderr.apply(&std::sqrt); invstderr = invstderr.apply(&InverseValue); VnlMatrixType invstderrmaf = VnlMatrixType(nbComp, nbComp, 0); invstderrmaf.set_diagonal((m_V.transpose() * sigma * m_V).get_diagonal()); - invstderrmaf = invstderrmaf.apply(&vcl_sqrt); + invstderrmaf = invstderrmaf.apply(&std::sqrt); invstderrmaf = invstderrmaf.apply(&InverseValue); VnlMatrixType aux1 = invstderr * sigma * m_V * invstderrmaf; diff --git a/Modules/Filtering/DimensionalityReduction/include/otbNAPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbNAPCAImageFilter.hxx index b4edb9b64955f615f9a2ef49b48671dba9c520cb..82b24c606e5daceae0d2beb655dd95c9394edc5f 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbNAPCAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbNAPCAImageFilter.hxx @@ -50,12 +50,12 @@ NAPCAImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTran { if ( vectValPn[i] > 0. ) { - valPn(i, i) = 1. / vcl_sqrt( vectValPn[i] ); + valPn(i, i) = 1. / std::sqrt( vectValPn[i] ); } else if ( vectValPn[i] < 0. ) { otbMsgDebugMacro( << "ValPn(" << i << ") neg : " << vectValPn[i] << " taking abs value" ); - valPn(i, i) = 1. / vcl_sqrt( vcl_abs( vectValPn[i] ) ); + valPn(i, i) = 1. / std::sqrt( std::abs( vectValPn[i] ) ); } else { diff --git a/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx index c3df8ebd49720766e50ec2302b1646ae558b95f6..a0552c1e56ae8587d2b698a3ec136b0979d45c97 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx @@ -82,7 +82,7 @@ NormalizeInnerProductPCAImageFilter<TInputImage, TOutputImage> m_CoefNorm.SetSize(means.Size()); for (unsigned int i = 0; i < m_CoefNorm.Size(); ++i) { - m_CoefNorm[i] = (1. / vcl_sqrt(NbPixels * (cov[i][i] + means[i] * means[i]))); + m_CoefNorm[i] = (1. / std::sqrt(NbPixels * (cov[i][i] + means[i] * means[i]))); } } /** diff --git a/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx index 1d645a225dae1b927684af1348cd9a3196d073a1..60bd1675faebdd69f500672df0c4efa1fc85e5a8 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbPCAImageFilter.hxx @@ -363,7 +363,7 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > for ( unsigned int i = 0; i < valP.size(); ++i ) { if ( valP[i] != 0. ) - valP[i] = 1. / vcl_sqrt( vcl_abs( valP[i] ) ); + valP[i] = 1. / std::sqrt( std::abs( valP[i] ) ); else throw itk::ExceptionObject( __FILE__, __LINE__, "Null Eigen value !!", ITK_LOCATION ); @@ -394,12 +394,12 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > { if ( valP(i, i) > 0. ) { - valP(i, i) = 1. / vcl_sqrt( valP(i, i) ); + valP(i, i) = 1. / std::sqrt( valP(i, i) ); } else if ( valP(i, i) < 0. ) { otbMsgDebugMacro( << "ValP(" << i << ") neg : " << valP(i, i) << " taking abs value" ); - valP(i, i) = 1. / vcl_sqrt( vcl_abs( valP(i, i) ) ); + valP(i, i) = 1. / std::sqrt( std::abs( valP(i, i) ) ); } else { diff --git a/Modules/Filtering/DimensionalityReduction/include/otbSparseWvltToAngleMapperListFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbSparseWvltToAngleMapperListFilter.hxx index 0c034e24877da4bc08871d0c6bd711937d79e866..99b3d7bd75033fbbc2641a48c4a6cd3482a9ba7b 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbSparseWvltToAngleMapperListFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbSparseWvltToAngleMapperListFilter.hxx @@ -192,10 +192,10 @@ SparseWvltToAngleMapperListFilter< TInputImageList, TOutputSampleList, VNbInputI double modulus = 0; for ( unsigned int i = 0; i < NumberOfInputImages; ++i ) { - modulus += vcl_pow( static_cast<double>( it[i].Get() ), 2. ); + modulus += std::pow( static_cast<double>( it[i].Get() ), 2. ); } // The modulus cannot be nul since it is over the threshold... - modulus = vcl_sqrt( modulus ); + modulus = std::sqrt( modulus ); // FIXME test if NaN nor infinite @@ -206,20 +206,20 @@ SparseWvltToAngleMapperListFilter< TInputImageList, TOutputSampleList, VNbInputI { if ( it[1].Get() < 0 ) { - angle[0] = vcl_acos( it[0].Get() / modulus ); + angle[0] = std::acos( it[0].Get() / modulus ); } else { - angle[0] = - vcl_acos( it[0].Get() / modulus ); + angle[0] = - std::acos( it[0].Get() / modulus ); } } else { for ( unsigned int k = 0; k < angle.Size()-1; ++k ) { - double phase = vcl_acos( it[k].Get() / modulus ); + double phase = std::acos( it[k].Get() / modulus ); angle[k] = phase; - modulus *= vcl_sin( phase ); + modulus *= std::sin( phase ); // FIXME test also if not finite if ( modulus < 1e-5 ) @@ -237,11 +237,11 @@ SparseWvltToAngleMapperListFilter< TInputImageList, TOutputSampleList, VNbInputI double sign = NumberOfInputImages == 3 ? -1. : 1.; if ( it[ NumberOfInputImages-1 ].Get() < 0 ) { - angle[ angle.Size()-1 ] = sign * vcl_acos( it[ NumberOfInputImages-2 ].Get() / modulus ); + angle[ angle.Size()-1 ] = sign * std::acos( it[ NumberOfInputImages-2 ].Get() / modulus ); } else { - angle[ angle.Size()-1 ] = - sign * vcl_acos( it[ NumberOfInputImages-2 ].Get() / modulus ); + angle[ angle.Size()-1 ] = - sign * std::acos( it[ NumberOfInputImages-2 ].Get() / modulus ); } } diff --git a/Modules/Filtering/ImageManipulation/include/otbAlphaBlendingFunctor.h b/Modules/Filtering/ImageManipulation/include/otbAlphaBlendingFunctor.h index 7a2852b2e5f1faef3c0e4a5b1bd8e3d1abe1800a..601520f8fa409764f21f7f3259afbf153fb696d5 100644 --- a/Modules/Filtering/ImageManipulation/include/otbAlphaBlendingFunctor.h +++ b/Modules/Filtering/ImageManipulation/include/otbAlphaBlendingFunctor.h @@ -86,7 +86,7 @@ public: OutputPixelType resp; double alpha = this->GetAlpha(); - resp = static_cast<OutputPixelType>(vcl_floor(0.5 + (1.0 - alpha) * static_cast<double>(input1) + resp = static_cast<OutputPixelType>(std::floor(0.5 + (1.0 - alpha) * static_cast<double>(input1) + alpha * static_cast<double>(input2))); return resp; } @@ -120,15 +120,15 @@ public: resp.Fill(itk::NumericTraits<InternalOutputPixelType>::max()); double alpha = static_cast<double>(input2.GetAlpha()) / 255.0 * this->GetAlpha(); - resp.SetRed(static_cast<InternalOutputPixelType>(vcl_floor(0.5 + + resp.SetRed(static_cast<InternalOutputPixelType>(std::floor(0.5 + (1.0 - alpha) * static_cast<double>(input1.GetRed()) + alpha * static_cast<double>(input2.GetRed()) ))); - resp.SetGreen(static_cast<InternalOutputPixelType>(vcl_floor(0.5 + + resp.SetGreen(static_cast<InternalOutputPixelType>(std::floor(0.5 + (1.0 - alpha) * static_cast<double>(input1.GetGreen()) + alpha * static_cast<double>(input2.GetGreen()) ))); - resp.SetBlue(static_cast<InternalOutputPixelType>(vcl_floor(0.5 + + resp.SetBlue(static_cast<InternalOutputPixelType>(std::floor(0.5 + (1.0 - alpha) * static_cast<double>(input1.GetBlue()) + alpha * static_cast<double>(input2.GetBlue()) ))); diff --git a/Modules/Filtering/ImageManipulation/include/otbAmplitudeFunctor.h b/Modules/Filtering/ImageManipulation/include/otbAmplitudeFunctor.h index a543b2ae58832756c51810dff8851407d97d722c..4d2e7164f2f22f6d9701747380c22bec544f40a0 100644 --- a/Modules/Filtering/ImageManipulation/include/otbAmplitudeFunctor.h +++ b/Modules/Filtering/ImageManipulation/include/otbAmplitudeFunctor.h @@ -126,7 +126,7 @@ public: private: inline ScalarType ComputeAmplitude(ScalarType a, ScalarType b) const { - return vcl_sqrt(a * a + b * b); + return std::sqrt(a * a + b * b); } }; diff --git a/Modules/Filtering/ImageManipulation/include/otbBinarySpectralAngleFunctor.h b/Modules/Filtering/ImageManipulation/include/otbBinarySpectralAngleFunctor.h index 7aa744c0b7cd2aa8a42fe3e751bce6738c4a0946..11c59a64994aebc580fdbde72359a1475157e6d6 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBinarySpectralAngleFunctor.h +++ b/Modules/Filtering/ImageManipulation/include/otbBinarySpectralAngleFunctor.h @@ -61,14 +61,14 @@ public: norma += a[i] * a[i]; normb += b[i] * b[i]; } - sqrtNormProd = vcl_sqrt(norma * normb); - if ( vcl_abs(sqrtNormProd) < Epsilon || scalarProd / sqrtNormProd > 1 ) + sqrtNormProd = std::sqrt(norma * normb); + if ( std::abs(sqrtNormProd) < Epsilon || scalarProd / sqrtNormProd > 1 ) { dist = 0.0; } else { - dist = vcl_acos(scalarProd / sqrtNormProd); + dist = std::acos(scalarProd / sqrtNormProd); } return static_cast<TOutputValue>(dist); diff --git a/Modules/Filtering/ImageManipulation/include/otbEuclideanDistanceMetricWithMissingValue.h b/Modules/Filtering/ImageManipulation/include/otbEuclideanDistanceMetricWithMissingValue.h index 37e08144ba0ad7ff5d1bb4ce74554f380712c3e5..ecdd0e2b22d4f6ec7afb3fd3bfc0a5cbe07aec66 100644 --- a/Modules/Filtering/ImageManipulation/include/otbEuclideanDistanceMetricWithMissingValue.h +++ b/Modules/Filtering/ImageManipulation/include/otbEuclideanDistanceMetricWithMissingValue.h @@ -72,20 +72,20 @@ public: /** Gets the distance between the origin and x */ double Evaluate(const TVector& x) const override { - return ::vcl_sqrt(Superclass::Evaluate(x)); + return ::std::sqrt(Superclass::Evaluate(x)); } /** Gets the distance between x1 and x2 */ double Evaluate(const TVector& x1, const TVector& x2) const override { - return ::vcl_sqrt(Superclass::Evaluate(x1, x2)); + return ::std::sqrt(Superclass::Evaluate(x1, x2)); } /** Gets the cooridnate distance between a and b. NOTE: a and b * should be type of component */ double Evaluate(const ValueType& a, const ValueType& b) const { - return ::vcl_sqrt(Superclass::Evaluate(a, b)); + return ::std::sqrt(Superclass::Evaluate(a, b)); } /** Returns true if the distance between x and the origin is less diff --git a/Modules/Filtering/ImageManipulation/include/otbFlexibleDistanceWithMissingValue.hxx b/Modules/Filtering/ImageManipulation/include/otbFlexibleDistanceWithMissingValue.hxx index 80649d8abae360bc9096160cd5750158a5275b94..309825ad2145a2addb58a9c6f1c9b275e4b7f599 100644 --- a/Modules/Filtering/ImageManipulation/include/otbFlexibleDistanceWithMissingValue.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbFlexibleDistanceWithMissingValue.hxx @@ -49,7 +49,7 @@ FlexibleDistanceWithMissingValue<TVector> { if (!this->IsMissingValue(x1[i]) && !this->IsMissingValue(x2[i])) { - temp = vcl_pow(vcl_abs(vcl_pow(x1[i], this->Alpha) - vcl_pow(x2[i], this->Alpha)), this->Beta); + temp = std::pow(std::abs(std::pow(x1[i], this->Alpha) - std::pow(x2[i], this->Alpha)), this->Beta); distance += temp; } } @@ -81,7 +81,7 @@ FlexibleDistanceWithMissingValue<TVector> { if (!this->IsMissingValue(this->GetOrigin()[i]) && !this->IsMissingValue(x[i])) { - temp = vcl_pow(vcl_abs(vcl_pow(this->GetOrigin()[i], this->Alpha) - vcl_pow(x[i], this->Alpha)), this->Beta); + temp = std::pow(std::abs(std::pow(this->GetOrigin()[i], this->Alpha) - std::pow(x[i], this->Alpha)), this->Beta); distance += temp; } } @@ -99,7 +99,7 @@ FlexibleDistanceWithMissingValue<TVector> // FIXME throw NaN exception instaed of returning 0. ?? if (this->IsMissingValue(a) || this->IsMissingValue(b)) return 0.0; - double temp = vcl_pow(vcl_abs(vcl_pow(a, this->Alpha) - vcl_pow(b, this->Alpha)), this->Beta); + double temp = std::pow(std::abs(std::pow(a, this->Alpha) - std::pow(b, this->Alpha)), this->Beta); return temp; } diff --git a/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx index c273425f3133f5f015a91c6309fdd960009482de..9b2d2829d689954557a25b87c7f6f32cd765f096 100644 --- a/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx @@ -88,8 +88,8 @@ FunctionWithNeighborhoodToImageFilter<TInputImage, TOutputImage, TFunction> // pad the input requested region by the operator radius InputImageSizeType maxRad; - maxRad[0] = m_Radius[0] + vcl_abs(m_Offset[0]); - maxRad[1] = m_Radius[0] + vcl_abs(m_Offset[1]); + maxRad[0] = m_Radius[0] + std::abs(m_Offset[0]); + maxRad[1] = m_Radius[0] + std::abs(m_Offset[1]); inputRequestedRegion.PadByRadius(maxRad); // crop the input requested region at the input's largest possible region diff --git a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx index df609b6a8c136fabc7270a8c5fbe73e049518459..3e033614df48d289fcbebf61858f6d91a8631825 100644 --- a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx @@ -167,8 +167,8 @@ GridResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision> // Ensure correct rounding of coordinates - inULIndex[dim] = vcl_floor(inULCIndex[dim]); - inLRIndex[dim] = vcl_ceil(inLRCIndex[dim]); + inULIndex[dim] = std::floor(inULCIndex[dim]); + inLRIndex[dim] = std::ceil(inLRCIndex[dim]); inSize[dim] = static_cast<typename SizeType::SizeValueType>(inLRIndex[dim]-inULIndex[dim])+1; } @@ -277,12 +277,12 @@ GridResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision> IndexType outputIndex; // This needs to take into account negative spacing - outputIndex[0] = vcl_ceil(std::min(outUL[0],outLR[0])); - outputIndex[1] = vcl_ceil(std::min(outUL[1],outLR[1])); + outputIndex[0] = std::ceil(std::min(outUL[0],outLR[0])); + outputIndex[1] = std::ceil(std::min(outUL[1],outLR[1])); SizeType outputSize; - outputSize[0] = vcl_floor(std::max(outUL[0],outLR[0])) - outputIndex[0] + 1; - outputSize[1] = vcl_floor(std::max(outUL[1],outLR[1])) - outputIndex[1] + 1; + outputSize[0] = std::floor(std::max(outUL[0],outLR[0])) - outputIndex[0] + 1; + outputSize[1] = std::floor(std::max(outUL[1],outLR[1])) - outputIndex[1] + 1; m_ReachableOutputRegion.SetIndex(outputIndex); m_ReachableOutputRegion.SetSize(outputSize); diff --git a/Modules/Filtering/ImageManipulation/include/otbHillShadingFunctor.h b/Modules/Filtering/ImageManipulation/include/otbHillShadingFunctor.h index 3e002256e2a7e05fa98c1c4248a28aa8c1235fba..ed9d207f4fe71498573374cd555f54de9c39dde6 100644 --- a/Modules/Filtering/ImageManipulation/include/otbHillShadingFunctor.h +++ b/Modules/Filtering/ImageManipulation/include/otbHillShadingFunctor.h @@ -81,10 +81,10 @@ public: HillShadingFunctor() : m_AzimuthLight(30.0 * CONST_PI_180), m_ElevationLight(45.0 *CONST_PI_180), m_XRes(100.0), m_YRes(100.0), m_Scale(0.1) { - m_SinElev = vcl_sin(m_ElevationLight); - m_CosElev = vcl_cos(m_ElevationLight); - m_SinAz = vcl_sin(m_AzimuthLight); - m_CosAz = vcl_cos(m_AzimuthLight); + m_SinElev = std::sin(m_ElevationLight); + m_CosElev = std::cos(m_ElevationLight); + m_SinAz = std::sin(m_AzimuthLight); + m_CosAz = std::cos(m_AzimuthLight); } ~HillShadingFunctor() {} @@ -100,12 +100,12 @@ public: void SetXRes(double res) { - m_XRes = vcl_abs(res); + m_XRes = std::abs(res); } void SetYRes(double res) { - m_YRes = vcl_abs(res); + m_YRes = std::abs(res); } double GetScale() const @@ -126,8 +126,8 @@ public: void SetAzimuthLight(double az) { m_AzimuthLight = az; - m_SinAz = vcl_sin(m_AzimuthLight); - m_CosAz = vcl_cos(m_AzimuthLight); + m_SinAz = std::sin(m_AzimuthLight); + m_CosAz = std::cos(m_AzimuthLight); } double GetElevationLight() const @@ -138,8 +138,8 @@ public: void SetElevationLight(double el) { m_ElevationLight = el; - m_SinElev = vcl_sin(m_ElevationLight); - m_CosElev = vcl_cos(m_ElevationLight); + m_SinElev = std::sin(m_ElevationLight); + m_CosElev = std::cos(m_ElevationLight); } inline TOutput operator ()(const TNeighIter& it) const @@ -166,7 +166,7 @@ public: // permutation between x and y as the azimuth angle is given compared to the north-south axis float lambertian = ((m_CosElev * m_CosAz * ySlope) + (m_CosElev * m_SinAz * xSlope) + m_SinElev) - / vcl_sqrt(xSlope * xSlope + ySlope * ySlope + 1); + / std::sqrt(xSlope * xSlope + ySlope * ySlope + 1); return (lambertian + 1) / 2; //normalize between 0 and 1 diff --git a/Modules/Filtering/ImageManipulation/include/otbLog10ThresholdedImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbLog10ThresholdedImageFilter.h index 10b6b5dcd4ab153da4b41e8179213867b3febb84..d65994715a60eeb59a20ec0968537c37bd202275 100644 --- a/Modules/Filtering/ImageManipulation/include/otbLog10ThresholdedImageFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbLog10ThresholdedImageFilter.h @@ -27,7 +27,7 @@ namespace otb { /** \class Log10ThresholdedImageFilter - * \brief Computes the 10 * vcl_log10(x) pixel-wise with a threshold for the lowest values + * \brief Computes the 10 * std::log10(x) pixel-wise with a threshold for the lowest values * * \ingroup OTBImageManipulation */ @@ -57,11 +57,11 @@ public: { if ((static_cast<double> (A) >= m_ThresholdValue) && (A == A)) { - return static_cast<TOutput> (10.0 * vcl_log10(static_cast<double> (A))); + return static_cast<TOutput> (10.0 * std::log10(static_cast<double> (A))); } else // If (A != A) then A is a NaN { - return static_cast<TOutput> (10.0 * vcl_log10(m_ThresholdValue)); + return static_cast<TOutput> (10.0 * std::log10(m_ThresholdValue)); } } diff --git a/Modules/Filtering/ImageManipulation/include/otbPhaseFunctor.h b/Modules/Filtering/ImageManipulation/include/otbPhaseFunctor.h index b289c7f4c79db961740391334889745b47128e19..1aff32f57c04369e3233e6487ba388a2bceff80c 100644 --- a/Modules/Filtering/ImageManipulation/include/otbPhaseFunctor.h +++ b/Modules/Filtering/ImageManipulation/include/otbPhaseFunctor.h @@ -124,7 +124,7 @@ public: private: inline ScalarType ComputePhase(ScalarType a, ScalarType b) const { - return vcl_atan2(b, a); + return std::atan2(b, a); } }; diff --git a/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx index 138bc5caf68339fff12da010580ccea114a157cc..456fbf744edd4cfecc57a0f860a8f60ca41525fe 100644 --- a/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx @@ -108,13 +108,13 @@ SpectralAngleDistanceImageFilter<TInputImage, TOutputImage> } else { - dist = vcl_acos(scalarProd / vcl_sqrt(normProd)); + dist = std::acos(scalarProd / std::sqrt(normProd)); } //------ This part was suppressed since the filter must perform only the spectral angle computation --- // Spectral angle normalization // dist = dist/(CONST_PI_2); //square ponderation - // dist = vcl_sqrt(dist); + // dist = std::sqrt(dist); outputIt.Set(static_cast<OutputPixelType>(dist)); ++inputIt; ++outputIt; diff --git a/Modules/Filtering/ImageManipulation/include/otbSpectralAngleFunctor.h b/Modules/Filtering/ImageManipulation/include/otbSpectralAngleFunctor.h index d68977523992a6b1aa11ff5e2d74fbcb30667792..e646208f05a4cbbbf0865a07d0babdf374e2e554 100644 --- a/Modules/Filtering/ImageManipulation/include/otbSpectralAngleFunctor.h +++ b/Modules/Filtering/ImageManipulation/include/otbSpectralAngleFunctor.h @@ -58,7 +58,7 @@ public: { m_RefNorm += ref[i] * ref[i]; } - m_RefNorm = vcl_sqrt(static_cast<double>(m_RefNorm)); + m_RefNorm = std::sqrt(static_cast<double>(m_RefNorm)); } TInput GetReferencePixel() const { @@ -83,14 +83,14 @@ protected: normProd1 += inPix[i] * inPix[i]; } normProd = normProd1 * m_RefNorm * m_RefNorm; - sqrtNormProd = vcl_sqrt(normProd); + sqrtNormProd = std::sqrt(normProd); if ((sqrtNormProd == 0.0) || (scalarProd / sqrtNormProd > 1)) { dist = 0.0; } else { - dist = vcl_acos(scalarProd / sqrtNormProd); + dist = std::acos(scalarProd / sqrtNormProd); } out = static_cast<TOutputValue>(dist); diff --git a/Modules/Filtering/ImageManipulation/include/otbSqrtSpectralAngleFunctor.h b/Modules/Filtering/ImageManipulation/include/otbSqrtSpectralAngleFunctor.h index 48226356e25f6d56e879a6c2efadb0b51735d6db..87b32db955a4eb5872e8c97be90bc3a92e497d9f 100644 --- a/Modules/Filtering/ImageManipulation/include/otbSqrtSpectralAngleFunctor.h +++ b/Modules/Filtering/ImageManipulation/include/otbSqrtSpectralAngleFunctor.h @@ -48,7 +48,7 @@ public: protected: TOutputPixel Evaluate(const TInputVectorPixel& inPix) const override { - return static_cast<TOutputPixel>(vcl_sqrt(Superclass::Evaluate(inPix))); + return static_cast<TOutputPixel>(std::sqrt(Superclass::Evaluate(inPix))); } }; diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingResampleImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbStreamingResampleImageFilter.hxx index f02c31b010b43358635de7c2943799350d832ec6..eadc84ef6cb7960bb38a306e21752f0067edd366 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingResampleImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingResampleImageFilter.hxx @@ -81,15 +81,15 @@ StreamingResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecisionTy for(unsigned int dim = 0; dim < InputImageType::ImageDimension; ++dim) { - // vcl_ceil to avoid numerical problems due to division of + // std::ceil to avoid numerical problems due to division of // spacings // + 1 : We need to enlarge the displacement field size cause // itk::WarpImageFilter::EvaluateDisplacementAtPhysicalPoint needs // 4 neighbors and in the edges we can need 1 neighbor pixel // outside the field displacementFieldLargestSize[dim] = static_cast<unsigned int>( - vcl_ceil( largestSize[dim]* - vcl_abs(this->GetOutputSpacing()[dim] / + std::ceil( largestSize[dim]* + std::abs(this->GetOutputSpacing()[dim] / this->GetDisplacementFieldSpacing()[dim]))) + 1; } m_DisplacementFilter->SetOutputSize(displacementFieldLargestSize); diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx index bdd8309470c0b20020732cfe0e491e85a8f833a9..2f32ad5be9bc287406ee617f44c172074f5c0142 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx @@ -80,8 +80,8 @@ UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage, TOutputImage, TFuncti // pad the input requested region by the operator radius InputImageSizeType maxRad; - maxRad[0] = m_Radius[0] + vcl_abs(m_Offset[0]); - maxRad[1] = m_Radius[1] + vcl_abs(m_Offset[1]); + maxRad[0] = m_Radius[0] + std::abs(m_Offset[0]); + maxRad[1] = m_Radius[1] + std::abs(m_Offset[1]); inputRequestedRegion.PadByRadius(maxRad); // crop the input requested region at the input's largest possible region @@ -130,8 +130,8 @@ UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage, TOutputImage, TFuncti // Neighborhood+offset iterator RadiusType rOff; - rOff[0] = m_Radius[0] + vcl_abs(m_Offset[0]); - rOff[1] = m_Radius[1] + vcl_abs(m_Offset[1]); + rOff[0] = m_Radius[0] + std::abs(m_Offset[0]); + rOff[1] = m_Radius[1] + std::abs(m_Offset[1]); NeighborhoodIteratorType neighInputOffIt; // Find the data-set boundary "faces" typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<TInputImage>::FaceListType faceListOff; diff --git a/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h index aec014512d71be463ed770e0c3bae14e8214cda1..1f044a76a615a282206162fe41483c59eadef503 100644 --- a/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h @@ -178,7 +178,7 @@ public: else { RealType scaledComponent = static_cast<RealType>(x[i] - m_InputMinimum[i])/ static_cast<RealType> (m_InputMaximum[i] - m_InputMinimum[i]); - scaledComponent = vcl_pow(scaledComponent,1./m_Gamma); + scaledComponent = std::pow(scaledComponent,1./m_Gamma); scaledComponent *= static_cast<RealType> (m_OutputMaximum[i] - m_OutputMinimum[i]); result[i] = static_cast<typename TOutput::ValueType>(scaledComponent + m_OutputMinimum[i]); } diff --git a/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.hxx index 2fde9765cec5fc26aeeb024ec8f205aa88848eaa..24eb2ef75da4606899457dd032b77b6e2b6a3861 100644 --- a/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.hxx @@ -139,7 +139,7 @@ VectorRescaleIntensityImageFilter<TInputImage, TOutputImage> size.SetSize(sl->GetNthElement(i)->GetMeasurementVectorSize()); if (m_ClampThreshold > 0.) - size.Fill(static_cast<unsigned int>(vcl_ceil(1 / m_ClampThreshold) * 10)); + size.Fill(static_cast<unsigned int>(std::ceil(1 / m_ClampThreshold) * 10)); else size.Fill(256); diff --git a/Modules/Filtering/ImageManipulation/src/otbStreamingShrinkImageFilter.cxx b/Modules/Filtering/ImageManipulation/src/otbStreamingShrinkImageFilter.cxx index 40b98202eeba4d8c205ce1cdb5c2c549f19b2567..5b7b132e37548c646c5b5e74b6c1604b62c1d31c 100644 --- a/Modules/Filtering/ImageManipulation/src/otbStreamingShrinkImageFilter.cxx +++ b/Modules/Filtering/ImageManipulation/src/otbStreamingShrinkImageFilter.cxx @@ -28,7 +28,7 @@ StreamingShrinkImageRegionSplitter ::GetNumberOfSplits(const RegionType& region, unsigned int requestedNumber) { unsigned int theoricalNbPixelPerTile = region.GetNumberOfPixels() / requestedNumber; - unsigned int theoricalTileDimension = static_cast<unsigned int> (vcl_sqrt(static_cast<double>(theoricalNbPixelPerTile)) ); + unsigned int theoricalTileDimension = static_cast<unsigned int> (std::sqrt(static_cast<double>(theoricalNbPixelPerTile)) ); // Take the previous multiple of m_ShrinkFactor (eventually generate more splits than requested) m_TileDimension = theoricalTileDimension / m_ShrinkFactor * m_ShrinkFactor; diff --git a/Modules/Filtering/ImageManipulation/test/otbAmplitudeFunctorTest.cxx b/Modules/Filtering/ImageManipulation/test/otbAmplitudeFunctorTest.cxx index a036121b82cd6d4bf4217cbfdac048bc830f17bd..9e13dfd1e939742e20a16fe15536b502a43f6167 100644 --- a/Modules/Filtering/ImageManipulation/test/otbAmplitudeFunctorTest.cxx +++ b/Modules/Filtering/ImageManipulation/test/otbAmplitudeFunctorTest.cxx @@ -57,8 +57,8 @@ int otbAmplitudeFunctorTest(int itkNotUsed(argc), char * itkNotUsed(argv) []) channels.push_back(j); funct.SetChannelList(channels); output = funct.operator ()(vectorPixel); - result = vcl_sqrt(vectorPixel[i] * vectorPixel[i] + vectorPixel[j] * vectorPixel[j]); - if( vcl_abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) + result = std::sqrt(vectorPixel[i] * vectorPixel[i] + vectorPixel[j] * vectorPixel[j]); + if( std::abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test VectorPixelType failed for channels " << i<< " and " << j << " !" << std::endl; @@ -81,8 +81,8 @@ int otbAmplitudeFunctorTest(int itkNotUsed(argc), char * itkNotUsed(argv) []) channels.push_back(j); funct.SetChannelList(channels); output = funct.operator ()(rgbPixel); - result = vcl_sqrt(rgbPixel[i] * rgbPixel[i] + rgbPixel[j] * rgbPixel[j]); - if( vcl_abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) + result = std::sqrt(rgbPixel[i] * rgbPixel[i] + rgbPixel[j] * rgbPixel[j]); + if( std::abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test RGBPixelType failed for channels " << i<< " and " << j << " !" << std::endl; @@ -110,7 +110,7 @@ int otbAmplitudeFunctorTest(int itkNotUsed(argc), char * itkNotUsed(argv) []) channels.push_back(j); funct.SetChannelList(channels); output = funct.operator ()(rgbaPixel); - result = vcl_sqrt(rgbaPixel[i] * rgbaPixel[i] + rgbaPixel[j] * rgbaPixel[j]); + result = std::sqrt(rgbaPixel[i] * rgbaPixel[i] + rgbaPixel[j] * rgbaPixel[j]); if( std::abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test RGBAPixelType failed for channels " << i<< " and " diff --git a/Modules/Filtering/ImageManipulation/test/otbMultiplyByScalarImageTest.cxx b/Modules/Filtering/ImageManipulation/test/otbMultiplyByScalarImageTest.cxx index 58448f5ef56bb1f91d33291c6e7d9171b17dd32e..661c7954dfcdba73bcde9d7ff700412c0c731172 100644 --- a/Modules/Filtering/ImageManipulation/test/otbMultiplyByScalarImageTest.cxx +++ b/Modules/Filtering/ImageManipulation/test/otbMultiplyByScalarImageTest.cxx @@ -73,7 +73,7 @@ int otbMultiplyByScalarImageFilterTest(int itkNotUsed(argc), char * itkNotUsed(a InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - const double pi = vcl_atan(1.0) * 4.0; + const double pi = std::atan(1.0) * 4.0; const double value = pi / 6.0; std::cout << "Content of the Input " << std::endl; it.GoToBegin(); @@ -115,7 +115,7 @@ int otbMultiplyByScalarImageFilterTest(int itkNotUsed(argc), char * itkNotUsed(a const InputImageType::PixelType input = it.Get(); const OutputImageType::PixelType output = ot.Get(); const OutputImageType::PixelType multiplyByScal = 10.0 * input; - if (vcl_abs(multiplyByScal - output) > epsilon) + if (std::abs(multiplyByScal - output) > epsilon) { std::cerr << "Error in otbMultiplyScalarImageFilterTest " << std::endl; std::cerr << " 10.0 * " << input << ") = " << multiplyByScal << std::endl; diff --git a/Modules/Filtering/ImageManipulation/test/otbPhaseFunctorTest.cxx b/Modules/Filtering/ImageManipulation/test/otbPhaseFunctorTest.cxx index 6f648698f569e9e96948c0892dc36be58b4a84f7..01c647a86d2037ec49321da228c9dfa34576ec08 100644 --- a/Modules/Filtering/ImageManipulation/test/otbPhaseFunctorTest.cxx +++ b/Modules/Filtering/ImageManipulation/test/otbPhaseFunctorTest.cxx @@ -57,8 +57,8 @@ int otbPhaseFunctorTest(int itkNotUsed(argc), char * itkNotUsed(argv) []) channels.push_back(j); funct.SetChannelList(channels); output = funct.operator ()(vectorPixel); - result = vcl_atan2(vectorPixel[j],vectorPixel[i]); - if( vcl_abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) + result = std::atan2(vectorPixel[j],vectorPixel[i]); + if( std::abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test VectorPixelType failed for channels " << i<< " and " << j << " !" << std::endl; @@ -81,8 +81,8 @@ int otbPhaseFunctorTest(int itkNotUsed(argc), char * itkNotUsed(argv) []) channels.push_back(j); funct.SetChannelList(channels); output = funct.operator ()(rgbPixel); - result = vcl_atan2(rgbPixel[j],rgbPixel[i]); - if( vcl_abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) + result = std::atan2(rgbPixel[j],rgbPixel[i]); + if( std::abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test RGBPixelType failed for channels " << i<< " and " << j << " !" << std::endl; @@ -110,8 +110,8 @@ int otbPhaseFunctorTest(int itkNotUsed(argc), char * itkNotUsed(argv) []) channels.push_back(j); funct.SetChannelList(channels); output = funct.operator ()(rgbaPixel); - result = vcl_atan2(rgbaPixel[j],rgbaPixel[i]); - if( vcl_abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) + result = std::atan2(rgbaPixel[j],rgbaPixel[i]); + if( std::abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001) { std::cout << "vectorPixelType Test RGBAPixelType failed for channels " << i<< " and " << j << " !" << std::endl; diff --git a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx index ba9be08cf6094f01078b65ad99ff578bdbe897e4..365034e57d4489238c2dd8d979474b36951362c6 100644 --- a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx @@ -162,11 +162,11 @@ void FrostImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData( Variance = sum2 / double(neighborhoodSize-1); const double epsilon = 0.0000000001; - if (vcl_abs(Mean) < epsilon) + if (std::abs(Mean) < epsilon) { dPixel = itk::NumericTraits<OutputPixelType>::Zero; } - else if (vcl_abs(Variance) < epsilon) + else if (std::abs(Variance) < epsilon) { dPixel = Mean; } @@ -184,13 +184,13 @@ void FrostImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData( { for (int y = -rad_y; y <= rad_y; ++y) { - double Dist = vcl_sqrt(static_cast<double>(x * x + y * y)); + double Dist = std::sqrt(static_cast<double>(x * x + y * y)); off[0] = x; off[1] = y; dPixel = static_cast<double>(bit.GetPixel(off)); - CoefFilter = vcl_exp(-Alpha * Dist); + CoefFilter = std::exp(-Alpha * Dist); NormFilter += CoefFilter; FrostFilter += (CoefFilter * dPixel); } diff --git a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx index 9020b330daebab1f17515aeda7dfee7c8a2910c7..2f62cdecaeb9bc52ed8941c071d00e6bb2427b74 100644 --- a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx @@ -126,7 +126,7 @@ void GammaMAPImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData( //Compute the ratio using the number of looks Cu2 = 1.0/m_NbLooks; - Cu = vcl_sqrt(Cu2); + Cu = std::sqrt(Cu2); // Process each of the boundary faces. These are N-d regions which border // the edge of the buffer. @@ -164,14 +164,14 @@ void GammaMAPImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData( I = static_cast<double>(bit.GetCenterPixel()); Ci2 = Var_I / (E_I * E_I); - Ci = vcl_sqrt(Ci2); + Ci = std::sqrt(Ci2); const double epsilon = 0.0000000001; - if (vcl_abs(E_I) < epsilon) + if (std::abs(E_I) < epsilon) { dPixel = itk::NumericTraits<OutputPixelType>::Zero; } - else if (vcl_abs(Var_I) < epsilon) + else if (std::abs(Var_I) < epsilon) { dPixel = E_I; } @@ -181,14 +181,14 @@ void GammaMAPImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData( } else { - Cmax = vcl_sqrt(2.0) * Cu; + Cmax = std::sqrt(2.0) * Cu; if (Ci < Cmax) { alpha = (1 + Cu2) / (Ci2 - Cu2); b = alpha - m_NbLooks - 1; d = E_I * E_I * b * b + 4 * alpha * m_NbLooks * E_I * I; - dPixel = (b * E_I + vcl_sqrt(d)) / (2 * alpha); + dPixel = (b * E_I + std::sqrt(d)) / (2 * alpha); } else dPixel = I; diff --git a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx index 986673d4ea4e34d8481552cd4488437776d63c58..287c327d8cd97766492d65aff09c59081f83e9a4 100644 --- a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx @@ -165,11 +165,11 @@ void KuanImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData( Ci2 = Var_I / (E_I * E_I); const double epsilon = 0.0000000001; - if (vcl_abs(E_I) < epsilon) + if (std::abs(E_I) < epsilon) { dPixel = itk::NumericTraits<OutputPixelType>::Zero; } - else if (vcl_abs(Var_I) < epsilon) + else if (std::abs(Var_I) < epsilon) { dPixel = E_I; } diff --git a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx index d04bcd1d164611b111d1e2c73c1c330116d0f4f2..6e4ac42566f02100367c3136650c7ee3f0c2eb19 100644 --- a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx @@ -165,11 +165,11 @@ void LeeImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData( Ci2 = Var_I / (E_I * E_I); const double epsilon = 0.0000000001; - if (vcl_abs(E_I) < epsilon) + if (std::abs(E_I) < epsilon) { dPixel = itk::NumericTraits<OutputPixelType>::Zero; } - else if (vcl_abs(Var_I) < epsilon) + else if (std::abs(Var_I) < epsilon) { dPixel = E_I; } diff --git a/Modules/Filtering/MathParser/src/otbParser.cxx b/Modules/Filtering/MathParser/src/otbParser.cxx index 685f9a5aff791ddc0a070801a945334ee4e42b1b..565ea0ec7559973d14577ea852d42e5b61774dae 100644 --- a/Modules/Filtering/MathParser/src/otbParser.cxx +++ b/Modules/Filtering/MathParser/src/otbParser.cxx @@ -203,7 +203,7 @@ private: //---------- User Defined Functions ----------//BEGIN static ValueType NDVI(ValueType r, ValueType niri) { - if ( vcl_abs(r + niri) < 1E-6 ) + if ( std::abs(r + niri) < 1E-6 ) { return 0.; } @@ -212,7 +212,7 @@ private: static ValueType ATAN2(ValueType y, ValueType x) { - return vcl_atan2(y,x); + return std::atan2(y,x); } #ifdef OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS diff --git a/Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx b/Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx index 366e84ba0aaa3d3ea7061dd3a57c4783c1300f4f..69d452b1f47e5d451ae9ec1f5b0361babe20286a 100644 --- a/Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx +++ b/Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx @@ -125,13 +125,13 @@ int otbBandMathImageFilter( int itkNotUsed(argc), char* itkNotUsed(argv) []) PixelType ndvi_expected; PixelType error; - if ( vcl_abs( px1 + px2) < 1E-6 ) + if ( std::abs( px1 + px2) < 1E-6 ) ndvi_expected = 0.0; else ndvi_expected = (px2-px1)/(px2+px1); - PixelType expected = vcl_cos( 2 * otb::CONST_PI * px1 ) / ( 2 * otb::CONST_PI * px2 + 1E-3 ) * vcl_sin( otb::CONST_PI * px3 ) - + ndvi_expected * vcl_sqrt(PixelType(2)) * px3; + PixelType expected = std::cos( 2 * otb::CONST_PI * px1 ) / ( 2 * otb::CONST_PI * px2 + 1E-3 ) * std::sin( otb::CONST_PI * px3 ) + + ndvi_expected * std::sqrt(PixelType(2)) * px3; /* std::cout << "Pixel_1 = " << it1.Get() << " Pixel_2 = " << it2.Get() << " Pixel_3 = " << it3.Get() diff --git a/Modules/Filtering/MathParser/test/otbParserTest.cxx b/Modules/Filtering/MathParser/test/otbParserTest.cxx index a146ef0edcd1251ab1907e6df756393dc3c2c8d3..256aa0368c3fdf5a56e865dccb53d44ee098f6a5 100644 --- a/Modules/Filtering/MathParser/test/otbParserTest.cxx +++ b/Modules/Filtering/MathParser/test/otbParserTest.cxx @@ -34,7 +34,7 @@ int otbParserTestNew(int itkNotUsed(argc), char * itkNotUsed(argv) []) void otbParserTest_ThrowIfNotEqual(double output, double ref, std::string testname, double epsilon = 1.0E-12) { std::cout << "Running test " << testname << std::endl; - if (vcl_abs(output-ref) > epsilon) + if (std::abs(output-ref) > epsilon) { itkGenericExceptionMacro( << "Got " << output << " while waiting for " << ref ); } @@ -62,14 +62,14 @@ void otbParserTest_BuildInFun(void) { ParserType::Pointer parser = ParserType::New(); parser->SetExpr("cos(1.55)"); - otbParserTest_ThrowIfNotEqual(parser->Eval(), vcl_cos(1.55), "BuildInFun"); + otbParserTest_ThrowIfNotEqual(parser->Eval(), std::cos(1.55), "BuildInFun"); } void otbParserTest_UserDefinedCst(void) { ParserType::Pointer parser = ParserType::New(); parser->SetExpr("ln10"); - otbParserTest_ThrowIfNotEqual(parser->Eval(), vcl_log(10.0), "UserDefinedCst"); + otbParserTest_ThrowIfNotEqual(parser->Eval(), std::log(10.0), "UserDefinedCst"); } void otbParserTest_UserDefinedFun(void) @@ -102,7 +102,7 @@ void otbParserTest_Mixed(void) ParserType::Pointer parser = ParserType::New(); parser->SetExpr("(7+10)/2+cos(pi/4)*10-10*ln10+ndvi(100, 10)"); otbParserTest_ThrowIfNotEqual(parser->Eval(), - (7.0+10.0)/2.0+vcl_cos(otb::CONST_PI/4)*10.0-10.0*vcl_log(10.0)+(10.0-100.0)/(10.0+100.0), + (7.0+10.0)/2.0+std::cos(otb::CONST_PI/4)*10.0-10.0*std::log(10.0)+(10.0-100.0)/(10.0+100.0), "Mixed"); } diff --git a/Modules/Filtering/MathParserX/src/otbParserXPlugins.cxx b/Modules/Filtering/MathParserX/src/otbParserXPlugins.cxx index a32f39f1f6bd22a62294ff677a22bcd1605b9dd8..3f2e5e14d9c71adb7aee03012517ff4f5fd416bb 100644 --- a/Modules/Filtering/MathParserX/src/otbParserXPlugins.cxx +++ b/Modules/Filtering/MathParserX/src/otbParserXPlugins.cxx @@ -116,7 +116,7 @@ void ElementWiseDivision::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type * for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) { - assert(vcl_abs(b.At(p,k).GetFloat()) > 1e-9); + assert(std::abs(b.At(p,k).GetFloat()) > 1e-9); res.At(p,k) = a.At(p,k).GetFloat() / b.At(p,k).GetFloat(); } @@ -152,7 +152,7 @@ void DivisionByScalar::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_p break; } - assert(vcl_abs(scalar) > 1e-9); + assert(std::abs(scalar) > 1e-9); int nbrows = a.GetRows(); int nbcols = a.GetCols(); @@ -257,7 +257,7 @@ void ElementWisePower::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_p for (int p=0; p<nbrows; ++p) { assert(a.At(p,k).GetFloat() >= 0 ); - res.At(p,k) = vcl_pow(a.At(p,k).GetFloat(),b.At(p,k).GetFloat()); + res.At(p,k) = std::pow(a.At(p,k).GetFloat(),b.At(p,k).GetFloat()); } // The return value is passed by writing it to the reference ret @@ -298,7 +298,7 @@ void PowerByScalar::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_pow(a.At(p,k).GetFloat() , scalar); + res.At(p,k) = std::pow(a.At(p,k).GetFloat() , scalar); // The return value is passed by writing it to the reference ret @@ -318,7 +318,7 @@ void ndvi::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i // The return value is passed by writing it to the reference ret - if ( vcl_abs(r + niri) < 1E-6 ) + if ( std::abs(r + niri) < 1E-6 ) *ret = 0.; else *ret = (niri-r)/(niri+r); @@ -453,7 +453,7 @@ void var::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_iA for (int i=0; i<nbrows; i++) for (int j=0; j<nbcols; j++) - sum += vcl_pow(mean - m1.At(i,j).GetFloat(),2); + sum += std::pow(mean - m1.At(i,j).GetFloat(),2); vect.push_back( sum / (double) (nbrows*nbcols) ); @@ -502,7 +502,7 @@ void corr::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int itk double var1=0.0; for (int i=0; i<nbrows; i++) for (int j=0; j<nbcols; j++) - var1 += vcl_pow(mean1 - a.At(i,j).GetFloat(),2); + var1 += std::pow(mean1 - a.At(i,j).GetFloat(),2); var1 = var1 / (double) (nbrows*nbcols); double mean2=0.0; @@ -514,7 +514,7 @@ void corr::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int itk double var2=0.0; for (int i=0; i<nbrows; i++) for (int j=0; j<nbcols; j++) - var2 += vcl_pow(mean2 - b.At(i,j).GetFloat(),2); + var2 += std::pow(mean2 - b.At(i,j).GetFloat(),2); var2 = var2 / (double) (nbrows*nbcols); double cross=0.0; @@ -524,7 +524,7 @@ void corr::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int itk cross = cross / (double) (nbrows*nbcols); - *ret = cross / ( vcl_sqrt(var1)*vcl_sqrt(var2) ); + *ret = cross / ( std::sqrt(var1)*std::sqrt(var2) ); } @@ -665,11 +665,11 @@ void vnorm::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_ for (int i=0; i<nbrows; i++) for (int j=0; j<nbcols; j++) - sum += vcl_pow(m1.At(i,j).GetFloat(),2.0); + sum += std::pow(m1.At(i,j).GetFloat(),2.0); // The return value is passed by writing it to the reference ret - mup::matrix_type res(1,1,vcl_sqrt(sum)); + mup::matrix_type res(1,1,std::sqrt(sum)); *ret = res; } @@ -778,7 +778,7 @@ void vcos::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_cos(a.At(p,k).GetFloat()); + res.At(p,k) = std::cos(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret @@ -804,7 +804,7 @@ void vacos::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_ for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_acos(a.At(p,k).GetFloat()); + res.At(p,k) = std::acos(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret @@ -829,7 +829,7 @@ void vsin::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_sin(a.At(p,k).GetFloat()); + res.At(p,k) = std::sin(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -854,7 +854,7 @@ void vasin::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_ for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_asin(a.At(p,k).GetFloat()); + res.At(p,k) = std::asin(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret @@ -879,7 +879,7 @@ void vtan::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_tan(a.At(p,k).GetFloat()); + res.At(p,k) = std::tan(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -903,7 +903,7 @@ void vatan::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_ for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_atan(a.At(p,k).GetFloat()); + res.At(p,k) = std::atan(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -928,7 +928,7 @@ void vtanh::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_ for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_tanh(a.At(p,k).GetFloat()); + res.At(p,k) = std::tanh(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -953,7 +953,7 @@ void vsinh::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_ for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_sinh(a.At(p,k).GetFloat()); + res.At(p,k) = std::sinh(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -978,7 +978,7 @@ void vcosh::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_ for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_cosh(a.At(p,k).GetFloat()); + res.At(p,k) = std::cosh(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -1002,7 +1002,7 @@ void vlog::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_log(a.At(p,k).GetFloat()); + res.At(p,k) = std::log(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -1027,7 +1027,7 @@ void vlog10::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_log10(a.At(p,k).GetFloat()); + res.At(p,k) = std::log10(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -1051,7 +1051,7 @@ void vabs::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_abs(a.At(p,k).GetFloat()); + res.At(p,k) = std::abs(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -1076,7 +1076,7 @@ void vexp::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_i for (int k=0; k<nbcols; ++k) for (int p=0; p<nbrows; ++p) - res.At(p,k) = vcl_exp(a.At(p,k).GetFloat()); + res.At(p,k) = std::exp(a.At(p,k).GetFloat()); // The return value is passed by writing it to the reference ret *ret = res; @@ -1102,7 +1102,7 @@ void vsqrt::Eval(mup::ptr_val_type &ret, const mup::ptr_val_type *a_pArg, int a_ for (int p=0; p<nbrows; ++p) { assert(a.At(p,k).GetFloat() >= 0 ); - res.At(p,k) = vcl_sqrt(a.At(p,k).GetFloat()); + res.At(p,k) = std::sqrt(a.At(p,k).GetFloat()); } // The return value is passed by writing it to the reference ret diff --git a/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx b/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx index 111441bcb50b9ecea3244474eb997a2ab39c6cd8..bc69c6b19fcbf9008903f8253b2e3a42be477e07 100644 --- a/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx +++ b/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx @@ -150,9 +150,9 @@ int otbBandMathXImageFilter( int itkNotUsed(argc), char* itkNotUsed(argv) []) double error1,error2,error3; - double expected1 = vcl_cos( 2 * otb::CONST_PI * px1[0] ) / ( 2 * otb::CONST_PI * px2[0] + 3.38 ) * vcl_sin( otb::CONST_PI * px3[0] ); - double expected2 = vcl_cos( 2 * otb::CONST_PI * px1[1] ) / ( 2 * otb::CONST_PI * px2[0] + 3.38 ) * vcl_sin( otb::CONST_PI * px3[0] ); - double expected3 = vcl_cos( 2 * otb::CONST_PI * px1[2] ) / ( 2 * otb::CONST_PI * px2[0] + 3.38 ) * vcl_sin( otb::CONST_PI * px3[0] ); + double expected1 = std::cos( 2 * otb::CONST_PI * px1[0] ) / ( 2 * otb::CONST_PI * px2[0] + 3.38 ) * std::sin( otb::CONST_PI * px3[0] ); + double expected2 = std::cos( 2 * otb::CONST_PI * px1[1] ) / ( 2 * otb::CONST_PI * px2[0] + 3.38 ) * std::sin( otb::CONST_PI * px3[0] ); + double expected3 = std::cos( 2 * otb::CONST_PI * px1[2] ) / ( 2 * otb::CONST_PI * px2[0] + 3.38 ) * std::sin( otb::CONST_PI * px3[0] ); /*std::cout << "Pixel_1 = " << it1.Get()[0] << " Pixel_2 = " << it2.Get()[0] << " Pixel_3 = " << it3.Get()[0] << " Result = " << itoutput1.Get()[0] << " Expected = " << expected1 << std::endl; */ @@ -285,7 +285,7 @@ int otbBandMathXImageFilterConv( int itkNotUsed(argc), char* argv []) n++; // Var of im1 band 3 - imageAb3Var += vcl_pow(it1.GetCenterPixel()[2],2.0); + imageAb3Var += std::pow(it1.GetCenterPixel()[2],2.0); // Maximum of im2 band 1 if (im2b1Maxi < it2.GetCenterPixel()[0]) @@ -353,9 +353,9 @@ int otbBandMathXImageFilterConv( int itkNotUsed(argc), char* argv []) for(unsigned int i=0; i<it1.Size(); ++i) px1[1] += coefs[i]*it1.GetPixel(i)[1]; - px1[2]= vcl_pow(it2.GetCenterPixel()[0],expo); + px1[2]= std::pow(it2.GetCenterPixel()[0],expo); - px1[3]= vcl_cos(it3.GetCenterPixel()[0]); + px1[3]= std::cos(it3.GetCenterPixel()[0]); // mean var median std::vector<double> vect; @@ -381,8 +381,8 @@ int otbBandMathXImageFilterConv( int itkNotUsed(argc), char* argv []) for (unsigned int i=0; i<it3.Size(); i++) vect2.push_back(it3.GetPixel(i)[0]); std::sort(vect2.begin(),vect2.end()); - px2[0] = (vect2.back() + vect2.front())/2.0 + imageAb3Var / 2.0 + (imageAb2Mini / im2b1Maxi)*3.4 + vcl_pow(imageAb3Mean / imageAb1Sum * imageAb3Var,1.2); - if ( vcl_acos(0.5)+vcl_asin(0.5)+vcl_atan(0.5) > 2.0 ) + px2[0] = (vect2.back() + vect2.front())/2.0 + imageAb3Var / 2.0 + (imageAb2Mini / im2b1Maxi)*3.4 + std::pow(imageAb3Mean / imageAb1Sum * imageAb3Var,1.2); + if ( std::acos(0.5)+std::asin(0.5)+std::atan(0.5) > 2.0 ) px2[1]=1.0; else px2[1]=0.0; diff --git a/Modules/Filtering/MathParserX/test/otbParserXTest.cxx b/Modules/Filtering/MathParserX/test/otbParserXTest.cxx index 52e9e3dd6a5f4dc2d956e7bf5cfe6f1733ab5e26..fcb016471f9864b398b575255e4bf73c1fc0304d 100644 --- a/Modules/Filtering/MathParserX/test/otbParserXTest.cxx +++ b/Modules/Filtering/MathParserX/test/otbParserXTest.cxx @@ -34,7 +34,7 @@ int otbParserXTestNew(int itkNotUsed(argc), char * itkNotUsed(argv) []) void otbParserXTest_ThrowIfNotEqual(double output, double ref, std::string testname, double epsilon = 1.0E-12) { std::cout << "Running test " << testname << std::endl; - if (vcl_abs(output-ref) > epsilon) + if (std::abs(output-ref) > epsilon) { itkGenericExceptionMacro( << "Got " << output << " while waiting for " << ref ); } @@ -62,14 +62,14 @@ void otbParserXTest_BuildInFun(void) { ParserType::Pointer parser = ParserType::New(); parser->SetExpr("cos(1.55)"); - otbParserXTest_ThrowIfNotEqual(parser->Eval(), vcl_cos(1.55), "BuildInFun"); + otbParserXTest_ThrowIfNotEqual(parser->Eval(), std::cos(1.55), "BuildInFun"); } void otbParserXTest_UserDefinedCst(void) { ParserType::Pointer parser = ParserType::New(); parser->SetExpr("ln10"); - otbParserXTest_ThrowIfNotEqual(parser->Eval(), vcl_log(10.0), "UserDefinedCst"); + otbParserXTest_ThrowIfNotEqual(parser->Eval(), std::log(10.0), "UserDefinedCst"); } void otbParserXTest_UserDefinedFun(void) @@ -108,7 +108,7 @@ void otbParserXTest_Mixed(void) ParserType::Pointer parser = ParserType::New(); parser->SetExpr("(7+10)/2+cos(pi/4)*10-10*ln10+ndvi(100, 10)"); otbParserXTest_ThrowIfNotEqual(parser->Eval(), - (7.0+10.0)/2.0+vcl_cos(otb::CONST_PI/4)*10.0-10.0*vcl_log(10.0)+(10.0-100.0)/(10.0+100.0), + (7.0+10.0)/2.0+std::cos(otb::CONST_PI/4)*10.0-10.0*std::log(10.0)+(10.0-100.0)/(10.0+100.0), "Mixed"); } diff --git a/Modules/Filtering/MorphologicalPyramid/include/otbMorphologicalPyramidAnalysisFilter.hxx b/Modules/Filtering/MorphologicalPyramid/include/otbMorphologicalPyramidAnalysisFilter.hxx index d2c37353d4bbc4726525bfb58a028e79f1ea8e4b..877b35875dccf20c53babc04d92268190cdf159b 100644 --- a/Modules/Filtering/MorphologicalPyramid/include/otbMorphologicalPyramidAnalysisFilter.hxx +++ b/Modules/Filtering/MorphologicalPyramid/include/otbMorphologicalPyramidAnalysisFilter.hxx @@ -150,7 +150,7 @@ MorphologicalPyramidAnalysisFilter<TInputImage, TOutputImage, TMorphoFilter> typename InputImageType::Pointer upsampled; // Structuring element size computation - const int structElementDimension = static_cast<int>(vcl_ceil(this->GetDecimationRatio() / 2.)); + const int structElementDimension = static_cast<int>(std::ceil(this->GetDecimationRatio() / 2.)); // Structuring element creation KernelType structuringElement; @@ -217,7 +217,7 @@ MorphologicalPyramidAnalysisFilter<TInputImage, TOutputImage, TMorphoFilter> { sizeTmp = size[j]; // As we knwow that our values will always be positive ones, we can simulate round by ceil(value+0.5) - size[j] = static_cast<unsigned int>(vcl_ceil((static_cast<double>(sizeTmp) / this->GetDecimationRatio()) + 0.5)); + size[j] = static_cast<unsigned int>(std::ceil((static_cast<double>(sizeTmp) / this->GetDecimationRatio()) + 0.5)); } otbMsgDevMacro(<< "New size: " << size); diff --git a/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx b/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx index 22509246b3b8cda99584f0184e90f0c9c9c3e447..2d7d0b7d86ccd68fa7d32f1d1d1db0cefd773120 100644 --- a/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx +++ b/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx @@ -78,7 +78,7 @@ CompacityPathFunction<TInputPath, TOutput> RealType Norm; - Norm = vcl_sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); + Norm = std::sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); Perimeter += Norm; diff --git a/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx b/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx index c3224044f0c096c089a28c334b00e78885301320..5885df2ea7148db1326774c846d9fd11e903311e 100644 --- a/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx +++ b/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx @@ -64,7 +64,7 @@ OrientationPathFunction<TInputPath, TOutput> RealType x2 = cindex[0]; RealType y2 = cindex[1]; - Theta = vcl_atan2(y2 - y1, x2 - x1); + Theta = std::atan2(y2 - y1, x2 - x1); } // IF loop else { diff --git a/Modules/Filtering/Path/include/otbPathMeanDistanceFunctor.h b/Modules/Filtering/Path/include/otbPathMeanDistanceFunctor.h index 4a22403aa2438cfa9661b8dab174664d09f9a350..dda58a62fba5260af7f53c6ac9d9cfc7fcb96ad3 100644 --- a/Modules/Filtering/Path/include/otbPathMeanDistanceFunctor.h +++ b/Modules/Filtering/Path/include/otbPathMeanDistanceFunctor.h @@ -74,7 +74,7 @@ public: { v1 = v2; v2 = beginIt.Value(); - meanDistance += vcl_sqrt(vcl_pow(v1[0] - v2[0], 2) + vcl_pow(v1[1] - v2[1], 2)); + meanDistance += std::sqrt(std::pow(v1[0] - v2[0], 2) + std::pow(v1[1] - v2[1], 2)); ++beginIt; } diff --git a/Modules/Filtering/Path/include/otbPolyLineImageConstIterator.hxx b/Modules/Filtering/Path/include/otbPolyLineImageConstIterator.hxx index 0beaac96e612e8949e1104dc41f0fb81c7087670..eb7b183a2bda98c5c70db3bcfbbd7b011c2ae4f9 100644 --- a/Modules/Filtering/Path/include/otbPolyLineImageConstIterator.hxx +++ b/Modules/Filtering/Path/include/otbPolyLineImageConstIterator.hxx @@ -42,7 +42,7 @@ PolyLineImageConstIterator<TImage, TPath> IndexType source, target; for (unsigned int i = 0; i < ImageType::ImageDimension; ++i) { - source[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5)); + source[i] = static_cast<unsigned int> (std::floor(m_InternalVertexIterator.Value()[i] + 0.5)); } ++m_InternalVertexIterator; if (m_InternalVertexIterator != m_Path->GetVertexList()->End()) @@ -50,7 +50,7 @@ PolyLineImageConstIterator<TImage, TPath> for (unsigned int i = 0; i < ImageType::ImageDimension; ++i) { - target[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5)); + target[i] = static_cast<unsigned int> (std::floor(m_InternalVertexIterator.Value()[i] + 0.5)); } } else @@ -81,7 +81,7 @@ PolyLineImageConstIterator<TImage, TPath> IndexType source, target; for (unsigned int i = 0; i < ImageType::ImageDimension; ++i) { - source[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5)); + source[i] = static_cast<unsigned int> (std::floor(m_InternalVertexIterator.Value()[i] + 0.5)); } ++m_InternalVertexIterator; if (m_InternalVertexIterator != m_Path->GetVertexList()->End()) @@ -89,7 +89,7 @@ PolyLineImageConstIterator<TImage, TPath> for (unsigned int i = 0; i < ImageType::ImageDimension; ++i) { - target[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5)); + target[i] = static_cast<unsigned int> (std::floor(m_InternalVertexIterator.Value()[i] + 0.5)); } } else @@ -113,7 +113,7 @@ PolyLineImageConstIterator<TImage, TPath> IndexType source; for (unsigned int i = 0; i < ImageType::ImageDimension; ++i) { - source[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5)); + source[i] = static_cast<unsigned int> (std::floor(m_InternalVertexIterator.Value()[i] + 0.5)); } // otbMsgDebugMacro(<<"Source: "<<source); ++m_InternalVertexIterator; @@ -122,7 +122,7 @@ PolyLineImageConstIterator<TImage, TPath> IndexType target; for (unsigned int i = 0; i < ImageType::ImageDimension; ++i) { - target[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5)); + target[i] = static_cast<unsigned int> (std::floor(m_InternalVertexIterator.Value()[i] + 0.5)); } // otbMsgDebugMacro(<<"Target: "<<target); m_InternalImageIterator = InternalImageIteratorType(const_cast<ImageType *> (m_Image.GetPointer()), source, diff --git a/Modules/Filtering/Path/include/otbRegionImageToRectangularPathListFilter.hxx b/Modules/Filtering/Path/include/otbRegionImageToRectangularPathListFilter.hxx index 2b80dd220f994486ef160c6a234ccc95afe48173..157c01cc3fa28c204b63a166fdd4bcb406b63354 100644 --- a/Modules/Filtering/Path/include/otbRegionImageToRectangularPathListFilter.hxx +++ b/Modules/Filtering/Path/include/otbRegionImageToRectangularPathListFilter.hxx @@ -216,15 +216,15 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> for (regionIterator = regionContainer.begin(); regionIterator != regionContainer.end(); ++regionIterator) { explorerIndex = *regionIterator; - ax = vcl_abs(explorerIndex[0] - avgX); - ay = vcl_abs(explorerIndex[1] - avgY); + ax = std::abs(explorerIndex[0] - avgX); + ay = std::abs(explorerIndex[1] - avgY); sumAX += ax; sumAY += ay; crossTermAXY += ax * ay; } adevX = sumAX / n; adevY = sumAY / n; - adevXY = vcl_sqrt(crossTermAXY) / n; + adevXY = std::sqrt(crossTermAXY) / n; // Compute eigenvalues and eigenvectors of variance-covariance matrix (for DIRECTION) double delta, @@ -234,8 +234,8 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> x2 = 1, /* second eigenvector x coordinate, 1 except in special case when covarXY == 0 */ alpha /* main direction */; delta = (varX - varY) * (varX - varY) + 4 * covarXY * covarXY; - l1 = (varX + varY + vcl_sqrt(delta)) / 2; - l2 = (varX + varY - vcl_sqrt(delta)) / 2; + l1 = (varX + varY + std::sqrt(delta)) / 2; + l2 = (varX + varY - std::sqrt(delta)) / 2; if (covarXY != 0.0) // ZZ or larger than a small epsilon ? (eg 10^(-15)...) { y1 = (l1 - varX) / covarXY; // for x1 = 1 @@ -255,8 +255,8 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> ax1 = 1, /* first eigenvector x coordinate */ ax2 = 1; /* second eigenvector x coordinate, 1 except in special case when covarXY == 0 */ adelta = (adevX - adevY) * (adevX - adevY) + 4 * adevXY * adevXY; - al1 = (adevX + adevY + vcl_sqrt(adelta)) / 2; - al2 = (adevX + adevY - vcl_sqrt(adelta)) / 2; + al1 = (adevX + adevY + std::sqrt(adelta)) / 2; + al2 = (adevX + adevY - std::sqrt(adelta)) / 2; if (adevXY != 0.0) // ZZ or larger than a small epsilon ? (eg 10^(-15)...) { ay1 = (al1 - adevX) / adevXY; // for x1 = 1 @@ -269,7 +269,7 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> ay2 = 1; } - if (y1 != 0) alpha = vcl_atan(1 / y1) * 180 / vnl_math::pi; + if (y1 != 0) alpha = std::atan(1 / y1) * 180 / vnl_math::pi; else alpha = 90; if (alpha < 0) alpha += 180; // Conventionnaly given as a value between 0 and 180 degrees @@ -277,12 +277,12 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> double length, width; if (al2 != 0) { - length = vcl_sqrt(vcl_abs(al1 / al2) * n); - //length = vcl_sqrt(l1 / l2 * n); - if (al1 != 0) width = vcl_abs(al2 / al1) * length; + length = std::sqrt(std::abs(al1 / al2) * n); + //length = std::sqrt(l1 / l2 * n); + if (al1 != 0) width = std::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 + length = width = std::sqrt(static_cast<double>(n)); // should happen only when n == 1 anyway } } else @@ -293,14 +293,14 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> // Normalize eigenvectors (for following tests) double norm; - norm = vcl_sqrt(x1 * x1 + y1 * y1); + norm = std::sqrt(x1 * x1 + y1 * y1); assert (norm != 0); //(by construction of eigenvectors) if (norm != 0) { x1 /= norm; y1 /= norm; } - norm = vcl_sqrt(x2 * x2 + y2 * y2); + norm = std::sqrt(x2 * x2 + y2 * y2); assert (norm != 0); //(by construction of eigenvectors) if (norm != 0) { @@ -309,14 +309,14 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> } // Normalize eigenvectors (for following tests) (No : used only for printing values for debugging) - norm = vcl_sqrt(ax1 * ax1 + ay1 * ay1); + norm = std::sqrt(ax1 * ax1 + ay1 * ay1); assert (norm != 0); //(by construction of eigenvectors) if (norm != 0) { ax1 /= norm; ay1 /= norm; } - norm = vcl_sqrt(ax2 * ax2 + ay2 * ay2); + norm = std::sqrt(ax2 * ax2 + ay2 * ay2); assert (norm != 0); //(by construction of eigenvectors) if (norm != 0) { @@ -334,8 +334,8 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> explorerIndex = *regionIterator; vx = explorerIndex[0] - avgX; vy = explorerIndex[1] - avgY; - if (vcl_abs(vx * x1 + vy * y1) <= halfLength - && vcl_abs(vx * x2 + vy * y2) <= halfWidth) countWithin++; + if (std::abs(vx * x1 + vy * y1) <= halfLength + && std::abs(vx * x2 + vy * y2) <= halfWidth) countWithin++; } if (regionCount <= regionDebugNumber) diff --git a/Modules/Filtering/Path/test/otbCompacityPathCircle.cxx b/Modules/Filtering/Path/test/otbCompacityPathCircle.cxx index e219d961d99a31ad13d516c4daef20f8f138de10..71722d5f38741ce0b7f159cb7cc417bd3d5c7815 100644 --- a/Modules/Filtering/Path/test/otbCompacityPathCircle.cxx +++ b/Modules/Filtering/Path/test/otbCompacityPathCircle.cxx @@ -55,8 +55,8 @@ int otbCompacityPathCircle(int itkNotUsed(argc), char * argv[]) { RealType Theta = deltaTheta * static_cast<RealType>(noTheta); - cindex[0] = (Rho * vcl_cos(Theta)); - cindex[1] = (Rho * vcl_sin(Theta)); + cindex[0] = (Rho * std::cos(Theta)); + cindex[1] = (Rho * std::sin(Theta)); pathElt->AddVertex(cindex); } @@ -67,7 +67,7 @@ int otbCompacityPathCircle(int itkNotUsed(argc), char * argv[]) std::cout << "Compacity result: " << Result << std::endl; RealType Error; - Error = vcl_abs(Result - static_cast<RealType>(1.0)); + Error = std::abs(Result - static_cast<RealType>(1.0)); if (Error > 1.E-5) { diff --git a/Modules/Filtering/Path/test/otbCompacityPathRectangle.cxx b/Modules/Filtering/Path/test/otbCompacityPathRectangle.cxx index 9ae31b43f17d5ecd5681bc60281310284c0db955..0586f7f42c49f3090c26451813858bee9d250f3f 100644 --- a/Modules/Filtering/Path/test/otbCompacityPathRectangle.cxx +++ b/Modules/Filtering/Path/test/otbCompacityPathRectangle.cxx @@ -73,7 +73,7 @@ int otbCompacityPathRectangle(int itkNotUsed(argc), char * argv[]) std::cout << "Compacity result: " << Result << std::endl; RealType Error; - Error = vcl_abs(Result - static_cast<RealType>(otb::CONST_PI * A * B / (A + B) / (A + B))); + Error = std::abs(Result - static_cast<RealType>(otb::CONST_PI * A * B / (A + B) / (A + B))); if (Error > 1.E-9) { diff --git a/Modules/Filtering/Path/test/otbCompacityPathSquare.cxx b/Modules/Filtering/Path/test/otbCompacityPathSquare.cxx index 4dc67e5fcd82fdb9adaafa82a61ecec3d1e8f7b5..43818c2d073c4a41671f86e376ed30b5be59867d 100644 --- a/Modules/Filtering/Path/test/otbCompacityPathSquare.cxx +++ b/Modules/Filtering/Path/test/otbCompacityPathSquare.cxx @@ -66,7 +66,7 @@ int otbCompacityPathSquare(int itkNotUsed(argc), char * argv[]) std::cout << "Compacity result: " << Result << std::endl; RealType Error; - Error = vcl_abs(Result - static_cast<RealType>(otb::CONST_PI_4)); + Error = std::abs(Result - static_cast<RealType>(otb::CONST_PI_4)); if (Error > 1.E-9) { diff --git a/Modules/Filtering/Path/test/otbOrientationPath.cxx b/Modules/Filtering/Path/test/otbOrientationPath.cxx index 7e50057452108adde218606e9531e262fd4c16f2..cd18fca4347c25eab93b3013e9daffa7efb10e83 100644 --- a/Modules/Filtering/Path/test/otbOrientationPath.cxx +++ b/Modules/Filtering/Path/test/otbOrientationPath.cxx @@ -46,8 +46,8 @@ int otbOrientationPath(int itkNotUsed(argc), char * argv[]) cindex[0] = 30; cindex[1] = 30; pathElt->AddVertex(cindex); - cindex[0] += 100 * vcl_cos(Theta); - cindex[1] += 100 * vcl_sin(Theta); + cindex[0] += 100 * std::cos(Theta); + cindex[1] += 100 * std::sin(Theta); pathElt->AddVertex(cindex); FunctionType::Pointer function = FunctionType::New(); @@ -56,7 +56,7 @@ int otbOrientationPath(int itkNotUsed(argc), char * argv[]) RealType ResultTheta = function->Evaluate(); std::cout.precision(10); std::cout << "Orientation found : " << ResultTheta << std::endl; - if (vcl_abs(static_cast<double>(ResultTheta - Theta)) >= 10e-15) + if (std::abs(static_cast<double>(ResultTheta - Theta)) >= 10e-15) { std::cout << "Error in Theta estimation:" << (ResultTheta - Theta) << std::endl; return EXIT_FAILURE; diff --git a/Modules/Filtering/Path/test/otbPathListToHistogramGenerator.cxx b/Modules/Filtering/Path/test/otbPathListToHistogramGenerator.cxx index 3b99eadad7dfbdc6a6dbfa7768a246cff5f451ab..c5b618583668ff79c6089f1b00a196ccb8bc6dda 100644 --- a/Modules/Filtering/Path/test/otbPathListToHistogramGenerator.cxx +++ b/Modules/Filtering/Path/test/otbPathListToHistogramGenerator.cxx @@ -56,8 +56,8 @@ int otbPathListToHistogramGenerator(int itkNotUsed(argc), char * argv[]) pathElt->AddVertex(cindex); float Theta = 2.0 * static_cast<float>(otb::CONST_PI) * static_cast<float>(i) / static_cast<float>(NbAngle); - cindex[0] = 30 + vcl_cos(Theta); - cindex[1] = 30 + vcl_sin(Theta); + cindex[0] = 30 + std::cos(Theta); + cindex[1] = 30 + std::sin(Theta); pathElt->AddVertex(cindex); PathList->PushBack(pathElt); diff --git a/Modules/Filtering/Polarimetry/include/otbMuellerToPolarisationDegreeAndPowerImageFilter.h b/Modules/Filtering/Polarimetry/include/otbMuellerToPolarisationDegreeAndPowerImageFilter.h index 185125b7a725c1866bf7d1c3f601bc90b28da2ff..dabc7bc88db3843ad9a8ee88b0cf41b1a57d9041 100644 --- a/Modules/Filtering/Polarimetry/include/otbMuellerToPolarisationDegreeAndPowerImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbMuellerToPolarisationDegreeAndPowerImageFilter.h @@ -143,7 +143,7 @@ public: } else { - deg_pol = vcl_sqrt(Sr[1] * Sr[1] + Sr[2] * Sr[2] + Sr[3] * Sr[3]) / Sr[0]; + deg_pol = std::sqrt(Sr[1] * Sr[1] + Sr[2] * Sr[2] + Sr[3] * Sr[3]) / Sr[0]; } if (P > l_PowerMax) diff --git a/Modules/Filtering/Polarimetry/include/otbMuellerToReciprocalCovarianceImageFilter.h b/Modules/Filtering/Polarimetry/include/otbMuellerToReciprocalCovarianceImageFilter.h index 7da6917c69b24d14b78d0ab2ffb242c81c13bb6b..6e078f7cb57e688a0d37c0d28c5f363383b53b9d 100644 --- a/Modules/Filtering/Polarimetry/include/otbMuellerToReciprocalCovarianceImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbMuellerToReciprocalCovarianceImageFilter.h @@ -91,10 +91,10 @@ public: const ComplexType A(0.5*(M11+M22+2*M12)); - const ComplexType B(0.5*vcl_sqrt(2.0)*(M13+M23), 0.5*vcl_sqrt(2.0)*(M14+M24)); + const ComplexType B(0.5*std::sqrt(2.0)*(M13+M23), 0.5*std::sqrt(2.0)*(M14+M24)); const ComplexType C(-0.5*(M33+M44), -M34); const ComplexType E(M11-M22, 0.0); - const ComplexType F(0.5*vcl_sqrt(2.0)*(M13-M23), 0.5*vcl_sqrt(2.0)*(M14-M24)); + const ComplexType F(0.5*std::sqrt(2.0)*(M13-M23), 0.5*std::sqrt(2.0)*(M14-M24)); const ComplexType I(0.5*(M11+M22-2*M12)); result[0] = static_cast<OutputValueType>( A ); diff --git a/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx b/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx index cf21df1e13eb34005d6049c87f6ffa237ca1cfec..d52b226d889dfaa239e67380d856a126ded745b7 100644 --- a/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx +++ b/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx @@ -246,20 +246,20 @@ MultiChannelsPolarimetricSynthesisFilter<TInputImage, TOutputImage, TFunction> double DTOR = CONST_PI_180; double real, imag; - real = vcl_cos(DTOR * m_PsiI) * vcl_cos(DTOR * m_KhiI); - imag = -vcl_sin(DTOR * m_PsiI) * vcl_sin(DTOR * m_KhiI); + real = std::cos(DTOR * m_PsiI) * std::cos(DTOR * m_KhiI); + imag = -std::sin(DTOR * m_PsiI) * std::sin(DTOR * m_KhiI); ComplexType Ei0(real, imag); - real = vcl_sin(DTOR * m_PsiI) * vcl_cos(DTOR * m_KhiI); - imag = vcl_cos(DTOR * m_PsiI) * vcl_sin(DTOR * m_KhiI); + real = std::sin(DTOR * m_PsiI) * std::cos(DTOR * m_KhiI); + imag = std::cos(DTOR * m_PsiI) * std::sin(DTOR * m_KhiI); ComplexType Ei1(real, imag); - real = vcl_cos(DTOR * m_PsiR) * vcl_cos(DTOR * m_KhiR); - imag = -vcl_sin(DTOR * m_PsiR) * vcl_sin(DTOR * m_KhiR); + real = std::cos(DTOR * m_PsiR) * std::cos(DTOR * m_KhiR); + imag = -std::sin(DTOR * m_PsiR) * std::sin(DTOR * m_KhiR); ComplexType Er0(real, imag); - real = vcl_sin(DTOR * m_PsiR) * vcl_cos(DTOR * m_KhiR); - imag = vcl_cos(DTOR * m_PsiR) * vcl_sin(DTOR * m_KhiR); + real = std::sin(DTOR * m_PsiR) * std::cos(DTOR * m_KhiR); + imag = std::cos(DTOR * m_PsiR) * std::sin(DTOR * m_KhiR); ComplexType Er1(real, imag); AEi[0] = Ei0; diff --git a/Modules/Filtering/Polarimetry/include/otbPolarimetricSynthesisFunctor.h b/Modules/Filtering/Polarimetry/include/otbPolarimetricSynthesisFunctor.h index 5765462591e5a3d714b7a6735147889abbbd5c00..1d00b491f2335afef131ed93c38a102bb5911858 100644 --- a/Modules/Filtering/Polarimetry/include/otbPolarimetricSynthesisFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbPolarimetricSynthesisFunctor.h @@ -22,7 +22,7 @@ #define otbPolarimetricSynthesisFunctor_h #include "otbMath.h" -#include "vcl_complex.h" +#include "std::complex.h" #include "itkFixedArray.h" namespace otb @@ -74,10 +74,10 @@ public: ComplexType tmp; double scalar; - tmp = vcl_conj(m_Er[0]) * (m_Ei[0] * static_cast<ComplexType>(Shh) + m_Ei[1] * static_cast<ComplexType>(Shv)) - + vcl_conj(m_Er[1]) * (m_Ei[0] * static_cast<ComplexType>(Svh) + m_Ei[1] * static_cast<ComplexType>(Svv)); + tmp = std::conj(m_Er[0]) * (m_Ei[0] * static_cast<ComplexType>(Shh) + m_Ei[1] * static_cast<ComplexType>(Shv)) + + std::conj(m_Er[1]) * (m_Ei[0] * static_cast<ComplexType>(Svh) + m_Ei[1] * static_cast<ComplexType>(Svv)); - scalar = static_cast<double>(vcl_abs(tmp)) * static_cast<double>(vcl_abs(tmp)); + scalar = static_cast<double>(std::abs(tmp)) * static_cast<double>(std::abs(tmp)); return (static_cast<TOutput>(scalar)); } diff --git a/Modules/Filtering/Polarimetry/include/otbReciprocalCoherencyToReciprocalMuellerImageFilter.h b/Modules/Filtering/Polarimetry/include/otbReciprocalCoherencyToReciprocalMuellerImageFilter.h index 5bf1a145c44b79ed2ec89f20547459df0445067d..315239c7d643c1cd044541d05c8c0501e186e7ef 100644 --- a/Modules/Filtering/Polarimetry/include/otbReciprocalCoherencyToReciprocalMuellerImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbReciprocalCoherencyToReciprocalMuellerImageFilter.h @@ -88,8 +88,8 @@ public: ComplexType VAL4 = static_cast<ComplexType>( (Coherency[1] - Coherency[3]) ); ComplexType VAL5 = static_cast<ComplexType>( (Coherency[1] - Coherency[0]) ); - ComplexType VAL0 = static_cast<ComplexType>( Coherency[5] ) + VAL5 - vcl_conj(VAL4); - ComplexType VAL1 = static_cast<ComplexType>( -Coherency[5] ) + VAL5 - vcl_conj(VAL4); + ComplexType VAL0 = static_cast<ComplexType>( Coherency[5] ) + VAL5 - std::conj(VAL4); + ComplexType VAL1 = static_cast<ComplexType>( -Coherency[5] ) + VAL5 - std::conj(VAL4); result[0] = 0.5*(T1+T2+T3); result[1] = static_cast<double>( Coherency[1].real()+Coherency[3].imag() ); @@ -105,7 +105,7 @@ public: result[11] = static_cast<double>( 0.5*VAL0.imag() ); result[12] = static_cast<double>( Coherency[4].imag() ); result[13] = static_cast<double>( Coherency[2].imag() ); - result[14] = static_cast<double>( 0.5*vcl_conj(VAL1).imag() ); + result[14] = static_cast<double>( 0.5*std::conj(VAL1).imag() ); result[15] = static_cast<double>( 0.5*VAL0.real() ); return result; diff --git a/Modules/Filtering/Polarimetry/include/otbReciprocalCovarianceToCoherencyDegreeImageFilter.h b/Modules/Filtering/Polarimetry/include/otbReciprocalCovarianceToCoherencyDegreeImageFilter.h index c49ab569258f0c540eb02556610a2e6f919c08ff..9e559850bc52e064e045e50afd33755689ea168d 100644 --- a/Modules/Filtering/Polarimetry/include/otbReciprocalCovarianceToCoherencyDegreeImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbReciprocalCovarianceToCoherencyDegreeImageFilter.h @@ -79,17 +79,17 @@ public: if ((C11 >m_Epsilon) && (C33 > m_Epsilon)) { - result[0] = vcl_abs(C13) / vcl_sqrt(C11 * C33); // |<hh.vv*|/sqrt(<hh.hh*><vv.vv*>) + result[0] = std::abs(C13) / std::sqrt(C11 * C33); // |<hh.vv*|/sqrt(<hh.hh*><vv.vv*>) } if ((C22 > m_Epsilon) && (C33 > m_Epsilon)) { - result[1] = vcl_abs(C23) / vcl_sqrt(C22 * C33); // |<hv.vv*|/sqrt(<hv.hv*><vv.vv*>) + result[1] = std::abs(C23) / std::sqrt(C22 * C33); // |<hv.vv*|/sqrt(<hv.hv*><vv.vv*>) } if ((C11 > m_Epsilon) && (C22 > m_Epsilon) ) { - result[2] = vcl_abs(C12) / vcl_sqrt(C11 * C22); // |<hh.hv*|/sqrt(<hh.hh*><hv.hv*>) + result[2] = std::abs(C12) / std::sqrt(C11 * C22); // |<hh.hv*|/sqrt(<hh.hh*><hv.hv*>) } return result; diff --git a/Modules/Filtering/Polarimetry/include/otbReciprocalCovarianceToReciprocalCoherencyImageFilter.h b/Modules/Filtering/Polarimetry/include/otbReciprocalCovarianceToReciprocalCoherencyImageFilter.h index 9393cdd4d83c0344c4e69ddf0a0dfcd5102763bb..c5cff9de09cfa45e2ce9cfa161b475f953b1ff7c 100644 --- a/Modules/Filtering/Polarimetry/include/otbReciprocalCovarianceToReciprocalCoherencyImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbReciprocalCovarianceToReciprocalCoherencyImageFilter.h @@ -73,13 +73,13 @@ public: const ComplexType C33 = static_cast<ComplexType>(Covariance[5]); const ComplexType two = ComplexType(2.0, 0.0); - const ComplexType rootTwo = ComplexType(vcl_sqrt(2.0), 0.0); + const ComplexType rootTwo = ComplexType(std::sqrt(2.0), 0.0); - result[0] = static_cast<OutputValueType>( C33 + C13 + vcl_conj(C13) + C11 ); - result[1] = static_cast<OutputValueType>( -C33 - C13 + vcl_conj(C13) + C11 ); - result[2] = static_cast<OutputValueType>( rootTwo*C12 + rootTwo*vcl_conj(C23) ); - result[3] = static_cast<OutputValueType>( C33 - C13 - vcl_conj(C13) + C11 ); - result[4] = static_cast<OutputValueType>( rootTwo*C12 - rootTwo*vcl_conj(C23) ); + result[0] = static_cast<OutputValueType>( C33 + C13 + std::conj(C13) + C11 ); + result[1] = static_cast<OutputValueType>( -C33 - C13 + std::conj(C13) + C11 ); + result[2] = static_cast<OutputValueType>( rootTwo*C12 + rootTwo*std::conj(C23) ); + result[3] = static_cast<OutputValueType>( C33 - C13 - std::conj(C13) + C11 ); + result[4] = static_cast<OutputValueType>( rootTwo*C12 - rootTwo*std::conj(C23) ); result[5] = static_cast<OutputValueType>( two * C22 ); result /= 2.0; diff --git a/Modules/Filtering/Polarimetry/include/otbReciprocalHAlphaImageFilter.h b/Modules/Filtering/Polarimetry/include/otbReciprocalHAlphaImageFilter.h index bc62ab406182b18f156d2c3040070d0c6f2ce618..04c7035f9315a6ea6a314b16b8aed9599bfa6c09 100644 --- a/Modules/Filtering/Polarimetry/include/otbReciprocalHAlphaImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbReciprocalHAlphaImageFilter.h @@ -111,11 +111,11 @@ public: VNLVectorType sortedGreaterEigenVector(3, eigenVectors[0][0]); for(unsigned int i=0; i<3; ++i) { - if( vcl_abs( eigenValues[1].real()-sortedRealEigenValues[i] ) < m_Epsilon ) + if( std::abs( eigenValues[1].real()-sortedRealEigenValues[i] ) < m_Epsilon ) { sortedGreaterEigenVector[i] = eigenVectors[1][0]; } - else if( vcl_abs( eigenValues[2].real()-sortedRealEigenValues[i] ) < m_Epsilon ) + else if( std::abs( eigenValues[2].real()-sortedRealEigenValues[i] ) < m_Epsilon ) { sortedGreaterEigenVector[i] = eigenVectors[2][0]; } @@ -149,13 +149,13 @@ public: double a0, a1, a2; val0 = std::abs(sortedGreaterEigenVector[0]); - a0=acos(vcl_abs(val0)) * CONST_180_PI; + a0=acos(std::abs(val0)) * CONST_180_PI; val1 = std::abs(sortedGreaterEigenVector[1]); - a1=acos(vcl_abs(val1)) * CONST_180_PI; + a1=acos(std::abs(val1)) * CONST_180_PI; val2= std::abs(sortedGreaterEigenVector[2]); - a2=acos(vcl_abs(val2)) * CONST_180_PI; + a2=acos(std::abs(val2)) * CONST_180_PI; alpha=p[0]*a0 + p[1]*a1 + p[2]*a2; diff --git a/Modules/Filtering/Polarimetry/include/otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter.h b/Modules/Filtering/Polarimetry/include/otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter.h index e3a60859e7bc5f775e130eb174628d5379a09aae..2ccc69ccf0af9d7051ab12a1fc657d6cc7726bf2 100644 --- a/Modules/Filtering/Polarimetry/include/otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter.h @@ -23,7 +23,7 @@ #define otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter_h #include "itkUnaryFunctorImageFilter.h" -#include "vcl_complex.h" +#include "std::complex.h" namespace otb { @@ -79,15 +79,15 @@ public: const ComplexType C33 = static_cast<ComplexType>( Covariance[5] ); // <vv.vv*> - const ComplexType cst1 = ComplexType(0.0, vcl_sqrt(2.0)); + const ComplexType cst1 = ComplexType(0.0, std::sqrt(2.0)); const ComplexType two = ComplexType(2.0, 0 ); - result[0] = static_cast<ComplexType>( C33-cst1*C23-C13+cst1*vcl_conj(C23)-vcl_conj(C13)+two*C22-cst1*C12+cst1*vcl_conj(C12)+C11 ) ; - result[1] = static_cast<ComplexType>( cst1*C33+two*C23-cst1*C13+cst1*vcl_conj(C13)+two*vcl_conj(C12)-cst1*C11 ); - result[2] = static_cast<ComplexType>( -C33+cst1*C23+C13+cst1*vcl_conj(C23)+vcl_conj(C13)+two*C22-cst1*C12-cst1*vcl_conj(C12)-C11 ) ; - result[3] = static_cast<ComplexType>( two*C33+two*C13+two*vcl_conj(C13)+two*C11 ) ; - result[4] = static_cast<ComplexType>( cst1*C33+cst1*C13+two*vcl_conj(C23)-cst1*vcl_conj(C13)+two*C12-cst1*C11 ) ; - result[5] = static_cast<ComplexType>( C33+cst1*C23-C13-cst1*vcl_conj(C23)-vcl_conj(C13)+two*C22+cst1*C12-cst1*vcl_conj(C12)+C11 ) ; + result[0] = static_cast<ComplexType>( C33-cst1*C23-C13+cst1*std::conj(C23)-std::conj(C13)+two*C22-cst1*C12+cst1*std::conj(C12)+C11 ) ; + result[1] = static_cast<ComplexType>( cst1*C33+two*C23-cst1*C13+cst1*std::conj(C13)+two*std::conj(C12)-cst1*C11 ); + result[2] = static_cast<ComplexType>( -C33+cst1*C23+C13+cst1*std::conj(C23)+std::conj(C13)+two*C22-cst1*C12-cst1*std::conj(C12)-C11 ) ; + result[3] = static_cast<ComplexType>( two*C33+two*C13+two*std::conj(C13)+two*C11 ) ; + result[4] = static_cast<ComplexType>( cst1*C33+cst1*C13+two*std::conj(C23)-cst1*std::conj(C13)+two*C12-cst1*C11 ) ; + result[5] = static_cast<ComplexType>( C33+cst1*C23-C13-cst1*std::conj(C23)-std::conj(C13)+two*C22+cst1*C12-cst1*std::conj(C12)+C11 ) ; result /= 4.0; diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h index 9230345b16d0fcf86a0bb0c31c604ad62e68c412..4a0dddeb27d3f9eb45ae76d89d95a292d8ebeb32 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h @@ -21,7 +21,7 @@ #ifndef otbSinclairToCircularCovarianceMatrixFunctor_h #define otbSinclairToCircularCovarianceMatrixFunctor_h -#include "vcl_complex.h" +#include "std::complex.h" #include "otbSinclairToCovarianceMatrixFunctor.h" namespace otb @@ -102,10 +102,10 @@ public: const ComplexType Srl = coef*( jS_hh-S_hv+S_vh+jS_vv ); const ComplexType Srr = coef*( -S_hh+jS_hv+jS_vh+S_vv ); - //const ComplexType conjSll = vcl_conj(Sll); - //const ComplexType conjSlr = vcl_conj(Slr); - //const ComplexType conjSrl = vcl_conj(Srl); - //const ComplexType conjSrr = vcl_conj(Srr); + //const ComplexType conjSll = std::conj(Sll); + //const ComplexType conjSlr = std::conj(Slr); + //const ComplexType conjSrl = std::conj(Srl); + //const ComplexType conjSrr = std::conj(Srr); SinclairToCovarianceFunctorType funct; return ( funct( Sll, Slr, Srl, Srr ) ); diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToCoherencyMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToCoherencyMatrixFunctor.h index b682604ef9f7ac2d4e9e8b54c07f187c9dc61d93..ff65105ab336a7c800ffa496b975a9b0321952e2 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToCoherencyMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToCoherencyMatrixFunctor.h @@ -21,7 +21,7 @@ #ifndef otbSinclairToCoherencyMatrixFunctor_h #define otbSinclairToCoherencyMatrixFunctor_h -#include "vcl_complex.h" +#include "std::complex.h" namespace otb { @@ -87,14 +87,14 @@ public: const ComplexType jHVMinusVH = (S_hv - S_vh) * ComplexType(0., 1.); result[0] = static_cast<OutputValueType>( std::norm(HHPlusVV) ); - result[1] = static_cast<OutputValueType>( HHPlusVV * vcl_conj(HHMinusVV) ); - result[2] = static_cast<OutputValueType>( HHPlusVV * vcl_conj(HVPlusVH) ); - result[3] = static_cast<OutputValueType>( HHPlusVV * vcl_conj(jHVMinusVH) ); + result[1] = static_cast<OutputValueType>( HHPlusVV * std::conj(HHMinusVV) ); + result[2] = static_cast<OutputValueType>( HHPlusVV * std::conj(HVPlusVH) ); + result[3] = static_cast<OutputValueType>( HHPlusVV * std::conj(jHVMinusVH) ); result[4] = static_cast<OutputValueType>( std::norm(HHMinusVV) ); - result[5] = static_cast<OutputValueType>( HHMinusVV * vcl_conj(HVPlusVH) ); - result[6] = static_cast<OutputValueType>( HHMinusVV * vcl_conj(jHVMinusVH) ); + result[5] = static_cast<OutputValueType>( HHMinusVV * std::conj(HVPlusVH) ); + result[6] = static_cast<OutputValueType>( HHMinusVV * std::conj(jHVMinusVH) ); result[7] = static_cast<OutputValueType>( std::norm(HVPlusVH) ); - result[8] = static_cast<OutputValueType>( HVPlusVH * vcl_conj(jHVMinusVH) ); + result[8] = static_cast<OutputValueType>( HVPlusVH * std::conj(jHVMinusVH) ); result[9] = static_cast<OutputValueType>( std::norm(jHVMinusVH) ); result /= 2.0; diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToCovarianceMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToCovarianceMatrixFunctor.h index 65b8af387f6df27dab9a6d0abd4031bb0dd9683f..03416a4f6102427616f8e86217206989d248dde6 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToCovarianceMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToCovarianceMatrixFunctor.h @@ -21,7 +21,7 @@ #ifndef otbSinclairToCovarianceMatrixFunctor_h #define otbSinclairToCovarianceMatrixFunctor_h -#include "vcl_complex.h" +#include "std::complex.h" namespace otb { @@ -81,14 +81,14 @@ public: const ComplexType S_vv = static_cast<ComplexType>(Svv); result[0] = static_cast<OutputValueType>( std::norm(S_hh) ); - result[1] = static_cast<OutputValueType>( S_hh*vcl_conj(S_hv) ); - result[2] = static_cast<OutputValueType>( S_hh*vcl_conj(S_vh) ); - result[3] = static_cast<OutputValueType>( S_hh*vcl_conj(S_vv) ); + result[1] = static_cast<OutputValueType>( S_hh*std::conj(S_hv) ); + result[2] = static_cast<OutputValueType>( S_hh*std::conj(S_vh) ); + result[3] = static_cast<OutputValueType>( S_hh*std::conj(S_vv) ); result[4] = static_cast<OutputValueType>( std::norm(S_hv) ); - result[5] = static_cast<OutputValueType>( S_hv*vcl_conj(S_vh) ); - result[6] = static_cast<OutputValueType>( S_hv*vcl_conj(S_vv) ); + result[5] = static_cast<OutputValueType>( S_hv*std::conj(S_vh) ); + result[6] = static_cast<OutputValueType>( S_hv*std::conj(S_vv) ); result[7] = static_cast<OutputValueType>( std::norm(S_vh) ); - result[8] = static_cast<OutputValueType>( S_vh*vcl_conj(S_vv) ); + result[8] = static_cast<OutputValueType>( S_vh*std::conj(S_vv) ); result[9] = static_cast<OutputValueType>( std::norm(S_vv) ); return (result); diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToMuellerMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToMuellerMatrixFunctor.h index 89cd7d9c6b24b92b12e06bacc8ca99f5db85f714..800876df5672dff80c3fd82f3fc18e2acce6726b 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToMuellerMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToMuellerMatrixFunctor.h @@ -21,7 +21,7 @@ #ifndef otbSinclairToMuellerMatrixFunctor_h #define otbSinclairToMuellerMatrixFunctor_h -#include "vcl_complex.h" +#include "std::complex.h" namespace otb { @@ -101,10 +101,10 @@ public: const ComplexType Tyx = static_cast<ComplexType>(Svh); const ComplexType Tyy = static_cast<ComplexType>(Svv); - const ComplexType conjTxx = vcl_conj(Txx); - const ComplexType conjTxy = vcl_conj(Txy); - const ComplexType conjTyx = vcl_conj(Tyx); - const ComplexType conjTyy = vcl_conj(Tyy); + const ComplexType conjTxx = std::conj(Txx); + const ComplexType conjTxy = std::conj(Txy); + const ComplexType conjTyx = std::conj(Tyx); + const ComplexType conjTyy = std::conj(Tyy); result[0] = static_cast<OutputValueType>( 0.5 * ( std::norm(Txx) + std::norm(Txy) + std::norm(Tyx) + std::norm(Tyy) ) ); result[1] = static_cast<OutputValueType>( 0.5 * ( std::norm(Txx) - std::norm(Txy) + std::norm(Tyx) - std::norm(Tyy) ) ); diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCircularCovarianceMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCircularCovarianceMatrixFunctor.h index 5e842fc02f8b8dd70cbfe7036bab1ea6a5f1dbb1..4c179f8f709b44c75815442de54da4e1cdd7dfdf 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCircularCovarianceMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCircularCovarianceMatrixFunctor.h @@ -21,7 +21,7 @@ #ifndef otbSinclairToReciprocalCircularCovarianceMatrixFunctor_h #define otbSinclairToReciprocalCircularCovarianceMatrixFunctor_h -#include "vcl_complex.h" +#include "std::complex.h" #include "otbSinclairToReciprocalCovarianceMatrixFunctor.h" namespace otb diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCoherencyMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCoherencyMatrixFunctor.h index 43c92e8473d4bb6cd6ece32e6214cab0e5232b40..a353fb787fad3cc8389727d80e180c28f42ea939 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCoherencyMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCoherencyMatrixFunctor.h @@ -22,7 +22,7 @@ #define otbSinclairToReciprocalCoherencyMatrixFunctor_h #include "itkMacro.h" -#include "vcl_complex.h" +#include "std::complex.h" #include "otbMath.h" #include "vnl/vnl_matrix.h" diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCovarianceMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCovarianceMatrixFunctor.h index 5bcf20057c838b14689e87a654b46ec598b5130e..a1cc099a65b8c17cbd525443fe96937e315b0f3a 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCovarianceMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToReciprocalCovarianceMatrixFunctor.h @@ -21,7 +21,7 @@ #ifndef otbSinclairToReciprocalCovarianceMatrixFunctor_h #define otbSinclairToReciprocalCovarianceMatrixFunctor_h -#include "vcl_complex.h" +#include "std::complex.h" #include "otbMath.h" #include "vnl/vnl_matrix.h" diff --git a/Modules/Filtering/Polarimetry/test/otbMuellerToReciprocalCovarianceFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbMuellerToReciprocalCovarianceFunctor.cxx index bb3c3d7950764f50f1328e8b58a85555761cedee..d1d9d953e8d1947970649e9096c1981d50e2560a 100644 --- a/Modules/Filtering/Polarimetry/test/otbMuellerToReciprocalCovarianceFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbMuellerToReciprocalCovarianceFunctor.cxx @@ -57,18 +57,18 @@ int otbMuellerToReciprocalCovarianceFunctor(int itkNotUsed(argc), char * itkNotU outputFunct = funct.operator ()( input ); std::cout<<outputFunct<<std::endl; - if( vcl_abs(result[0].real()-outputFunct[0].real()) > 1e-10 || - vcl_abs(result[0].imag()-outputFunct[0].imag()) > 1e-10 || - vcl_abs(result[1].real()-outputFunct[1].real()) > 1e-10 || - vcl_abs(result[1].imag()-outputFunct[1].imag()) > 1e-10 || - vcl_abs(result[2].real()-outputFunct[2].real()) > 1e-10 || - vcl_abs(result[2].imag()-outputFunct[2].imag()) > 1e-10 || - vcl_abs(result[3].real()-outputFunct[3].real()) > 1e-10 || - vcl_abs(result[3].imag()-outputFunct[3].imag()) > 1e-10 || - vcl_abs(result[4].real()-outputFunct[4].real()) > 1e-10 || - vcl_abs(result[4].imag()-outputFunct[4].imag()) > 1e-10 || - vcl_abs(result[5].real()-outputFunct[5].real()) > 1e-10 || - vcl_abs(result[5].imag()-outputFunct[5].imag()) > 1e-10 ) + if( std::abs(result[0].real()-outputFunct[0].real()) > 1e-10 || + std::abs(result[0].imag()-outputFunct[0].imag()) > 1e-10 || + std::abs(result[1].real()-outputFunct[1].real()) > 1e-10 || + std::abs(result[1].imag()-outputFunct[1].imag()) > 1e-10 || + std::abs(result[2].real()-outputFunct[2].real()) > 1e-10 || + std::abs(result[2].imag()-outputFunct[2].imag()) > 1e-10 || + std::abs(result[3].real()-outputFunct[3].real()) > 1e-10 || + std::abs(result[3].imag()-outputFunct[3].imag()) > 1e-10 || + std::abs(result[4].real()-outputFunct[4].real()) > 1e-10 || + std::abs(result[4].imag()-outputFunct[4].imag()) > 1e-10 || + std::abs(result[5].real()-outputFunct[5].real()) > 1e-10 || + std::abs(result[5].imag()-outputFunct[5].imag()) > 1e-10 ) { std::cout<<"Test gives :"<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbPolarimetricSynthesisFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbPolarimetricSynthesisFunctor.cxx index 4bfbf12dc86cddfb717d3d91acc788c27d820db7..65661769d571c973caeaffb07994eea4f96de73b 100644 --- a/Modules/Filtering/Polarimetry/test/otbPolarimetricSynthesisFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbPolarimetricSynthesisFunctor.cxx @@ -18,7 +18,7 @@ * limitations under the License. */ -#include "vcl_complex.h" +#include "std::complex.h" #include "vcl_cmath.h" #include "otbPolarimetricSynthesisFunctor.h" @@ -45,7 +45,7 @@ int otbPolarimetricSynthesisFunctor(int itkNotUsed(argc), char * itkNotUsed(argv outputFunct = funct.operator ()( ComplexType(1.5, 4.5), ComplexType(2.5, 3.5), ComplexType(3.5, 2.5), ComplexType(4.5, 1.5) ); - if( vcl_abs(result-outputFunct) > 1e-10 ) + if( std::abs(result-outputFunct) > 1e-10 ) { std::cout<<"Test gives :"<<std::endl; std::cout<<outputFunct<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx index 7e20c938b39a590d803c51fbe4d9a00c9fc5bf25..115738e3b77335a47cd76939dff69484cab51a9a 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx @@ -47,16 +47,16 @@ int otbSinclairToCircularCovarianceMatrixFunctor(int itkNotUsed(argc), char * it outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); - if( vcl_abs(result[0]-outputFunct[0]) > 1e-10 || - vcl_abs(result[1]-outputFunct[1]) > 1e-10 || - vcl_abs(result[2]-outputFunct[2]) > 1e-10 || - vcl_abs(result[3]-outputFunct[3]) > 1e-10 || - vcl_abs(result[4]-outputFunct[4]) > 1e-10 || - vcl_abs(result[5]-outputFunct[5]) > 1e-10 || - vcl_abs(result[6]-outputFunct[6]) > 1e-10 || - vcl_abs(result[7]-outputFunct[7]) > 1e-10 || - vcl_abs(result[8]-outputFunct[8]) > 1e-10 || - vcl_abs(result[9]-outputFunct[9]) > 1e-10) + if( std::abs(result[0]-outputFunct[0]) > 1e-10 || + std::abs(result[1]-outputFunct[1]) > 1e-10 || + std::abs(result[2]-outputFunct[2]) > 1e-10 || + std::abs(result[3]-outputFunct[3]) > 1e-10 || + std::abs(result[4]-outputFunct[4]) > 1e-10 || + std::abs(result[5]-outputFunct[5]) > 1e-10 || + std::abs(result[6]-outputFunct[6]) > 1e-10 || + std::abs(result[7]-outputFunct[7]) > 1e-10 || + std::abs(result[8]-outputFunct[8]) > 1e-10 || + std::abs(result[9]-outputFunct[9]) > 1e-10) { std::cout<<"Test gives :"<<std::endl; std::cout<<outputFunct<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToCoherencyMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToCoherencyMatrixFunctor.cxx index 0ba669f8a2f68b3943eda7d3d506b2cf9348ad0e..b4c0ac4f7e1aa0899e499f1cd4afc36ab7fb7063 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToCoherencyMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToCoherencyMatrixFunctor.cxx @@ -46,16 +46,16 @@ int otbSinclairToCoherencyMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed( outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); - if( vcl_abs(result[0]-outputFunct[0]) > 1e-10 || - vcl_abs(result[1]-outputFunct[1]) > 1e-10 || - vcl_abs(result[2]-outputFunct[2]) > 1e-10 || - vcl_abs(result[3]-outputFunct[3]) > 1e-10 || - vcl_abs(result[4]-outputFunct[4]) > 1e-10 || - vcl_abs(result[5]-outputFunct[5]) > 1e-10 || - vcl_abs(result[6]-outputFunct[6]) > 1e-10 || - vcl_abs(result[7]-outputFunct[7]) > 1e-10 || - vcl_abs(result[8]-outputFunct[8]) > 1e-10 || - vcl_abs(result[9]-outputFunct[9]) > 1e-10) + if( std::abs(result[0]-outputFunct[0]) > 1e-10 || + std::abs(result[1]-outputFunct[1]) > 1e-10 || + std::abs(result[2]-outputFunct[2]) > 1e-10 || + std::abs(result[3]-outputFunct[3]) > 1e-10 || + std::abs(result[4]-outputFunct[4]) > 1e-10 || + std::abs(result[5]-outputFunct[5]) > 1e-10 || + std::abs(result[6]-outputFunct[6]) > 1e-10 || + std::abs(result[7]-outputFunct[7]) > 1e-10 || + std::abs(result[8]-outputFunct[8]) > 1e-10 || + std::abs(result[9]-outputFunct[9]) > 1e-10) { std::cout<<"Test gives :"<<std::endl; std::cout<<outputFunct<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToCovarianceMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToCovarianceMatrixFunctor.cxx index c047a25aa2a82c8878d4c327ee365a2cf0d3cf3d..9de6d61a8ade01160c0dd66f2a846baf2a32b2c9 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToCovarianceMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToCovarianceMatrixFunctor.cxx @@ -48,16 +48,16 @@ int otbSinclairToCovarianceMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); - if( vcl_abs(result[0]-outputFunct[0]) > 1e-10 || - vcl_abs(result[1]-outputFunct[1]) > 1e-10 || - vcl_abs(result[2]-outputFunct[2]) > 1e-10 || - vcl_abs(result[3]-outputFunct[3]) > 1e-10 || - vcl_abs(result[4]-outputFunct[4]) > 1e-10 || - vcl_abs(result[5]-outputFunct[5]) > 1e-10 || - vcl_abs(result[6]-outputFunct[6]) > 1e-10 || - vcl_abs(result[7]-outputFunct[7]) > 1e-10 || - vcl_abs(result[8]-outputFunct[8]) > 1e-10 || - vcl_abs(result[9]-outputFunct[9]) > 1e-10) + if( std::abs(result[0]-outputFunct[0]) > 1e-10 || + std::abs(result[1]-outputFunct[1]) > 1e-10 || + std::abs(result[2]-outputFunct[2]) > 1e-10 || + std::abs(result[3]-outputFunct[3]) > 1e-10 || + std::abs(result[4]-outputFunct[4]) > 1e-10 || + std::abs(result[5]-outputFunct[5]) > 1e-10 || + std::abs(result[6]-outputFunct[6]) > 1e-10 || + std::abs(result[7]-outputFunct[7]) > 1e-10 || + std::abs(result[8]-outputFunct[8]) > 1e-10 || + std::abs(result[9]-outputFunct[9]) > 1e-10) { std::cout<<"Test gives :"<<std::endl; std::cout<<outputFunct<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToMuellerMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToMuellerMatrixFunctor.cxx index f5731c44c395e523b8bfba0689d8ae3924c9945d..e70c4a416ef50acbfa9dd9cc3e25a7c182b9b7dc 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToMuellerMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToMuellerMatrixFunctor.cxx @@ -53,22 +53,22 @@ int otbSinclairToMuellerMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed(ar outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); - if( vcl_abs(result[0]-outputFunct[0]) > 1e-10 || - vcl_abs(result[1]-outputFunct[1]) > 1e-10 || - vcl_abs(result[2]-outputFunct[2]) > 1e-10 || - vcl_abs(result[3]-outputFunct[3]) > 1e-10 || - vcl_abs(result[4]-outputFunct[4]) > 1e-10 || - vcl_abs(result[5]-outputFunct[5]) > 1e-10 || - vcl_abs(result[6]-outputFunct[6]) > 1e-10 || - vcl_abs(result[7]-outputFunct[7]) > 1e-10 || - vcl_abs(result[8]-outputFunct[8]) > 1e-10 || - vcl_abs(result[9]-outputFunct[9]) > 1e-10 || - vcl_abs(result[10]-outputFunct[10]) > 1e-10 || - vcl_abs(result[11]-outputFunct[11]) > 1e-10 || - vcl_abs(result[12]-outputFunct[12]) > 1e-10 || - vcl_abs(result[13]-outputFunct[13]) > 1e-10 || - vcl_abs(result[14]-outputFunct[14]) > 1e-10 || - vcl_abs(result[15]-outputFunct[15]) > 1e-10 ) + if( std::abs(result[0]-outputFunct[0]) > 1e-10 || + std::abs(result[1]-outputFunct[1]) > 1e-10 || + std::abs(result[2]-outputFunct[2]) > 1e-10 || + std::abs(result[3]-outputFunct[3]) > 1e-10 || + std::abs(result[4]-outputFunct[4]) > 1e-10 || + std::abs(result[5]-outputFunct[5]) > 1e-10 || + std::abs(result[6]-outputFunct[6]) > 1e-10 || + std::abs(result[7]-outputFunct[7]) > 1e-10 || + std::abs(result[8]-outputFunct[8]) > 1e-10 || + std::abs(result[9]-outputFunct[9]) > 1e-10 || + std::abs(result[10]-outputFunct[10]) > 1e-10 || + std::abs(result[11]-outputFunct[11]) > 1e-10 || + std::abs(result[12]-outputFunct[12]) > 1e-10 || + std::abs(result[13]-outputFunct[13]) > 1e-10 || + std::abs(result[14]-outputFunct[14]) > 1e-10 || + std::abs(result[15]-outputFunct[15]) > 1e-10 ) { std::cout<<"Test gives :"<<std::endl; std::cout<<outputFunct<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCircularCovarianceMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCircularCovarianceMatrixFunctor.cxx index fd3b233677efd73fb4d8f62cdb5d217413fca913..7ab3dd6b29ece24e8f4d84e934418814b12de155 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCircularCovarianceMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCircularCovarianceMatrixFunctor.cxx @@ -42,12 +42,12 @@ int otbSinclairToReciprocalCircularCovarianceMatrixFunctor(int itkNotUsed(argc), outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.) ); - if( vcl_abs(result[0]-outputFunct[0]) > 1e-10 || - vcl_abs(result[1]-outputFunct[1]) > 1e-10 || - vcl_abs(result[2]-outputFunct[2]) > 1e-10 || - vcl_abs(result[3]-outputFunct[3]) > 1e-10 || - vcl_abs(result[4]-outputFunct[4]) > 1e-10 || - vcl_abs(result[5]-outputFunct[5]) > 1e-10 ) + if( std::abs(result[0]-outputFunct[0]) > 1e-10 || + std::abs(result[1]-outputFunct[1]) > 1e-10 || + std::abs(result[2]-outputFunct[2]) > 1e-10 || + std::abs(result[3]-outputFunct[3]) > 1e-10 || + std::abs(result[4]-outputFunct[4]) > 1e-10 || + std::abs(result[5]-outputFunct[5]) > 1e-10 ) { std::cout.precision(15); std::cout<<"Test gives :"<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCoherencyMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCoherencyMatrixFunctor.cxx index d32a123233c1c52a62ff015f2443a7b8749ec316..4caad27012ce9599b6514c59813c80c578722256 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCoherencyMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCoherencyMatrixFunctor.cxx @@ -42,12 +42,12 @@ int otbSinclairToReciprocalCoherencyMatrixFunctor(int itkNotUsed(argc), char * i result[5] = ComplexType(26., 0.); outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.) ); - if( vcl_abs(result[0]-outputFunct[0]) > 1e-10 || - vcl_abs(result[1]-outputFunct[1]) > 1e-10 || - vcl_abs(result[2]-outputFunct[2]) > 1e-10 || - vcl_abs(result[3]-outputFunct[3]) > 1e-10 || - vcl_abs(result[4]-outputFunct[4]) > 1e-10 || - vcl_abs(result[5]-outputFunct[5]) > 1e-10 ) + if( std::abs(result[0]-outputFunct[0]) > 1e-10 || + std::abs(result[1]-outputFunct[1]) > 1e-10 || + std::abs(result[2]-outputFunct[2]) > 1e-10 || + std::abs(result[3]-outputFunct[3]) > 1e-10 || + std::abs(result[4]-outputFunct[4]) > 1e-10 || + std::abs(result[5]-outputFunct[5]) > 1e-10 ) { std::cout<<"Test gives :"<<std::endl; std::cout<<outputFunct<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCovarianceMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCovarianceMatrixFunctor.cxx index a1fa8ab535a9d45c0fcdf18327b660f92ef758d6..8ad32897ac9afdacb4824d928893b91d5363a4a2 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCovarianceMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToReciprocalCovarianceMatrixFunctor.cxx @@ -43,12 +43,12 @@ int otbSinclairToReciprocalCovarianceMatrixFunctor(int itkNotUsed(argc), char * outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.) ); - if( vcl_abs(result[0]-outputFunct[0]) > 1e-10 || - vcl_abs(result[1]-outputFunct[1]) > 1e-10 || - vcl_abs(result[2]-outputFunct[2]) > 1e-10 || - vcl_abs(result[3]-outputFunct[3]) > 1e-10 || - vcl_abs(result[4]-outputFunct[4]) > 1e-10 || - vcl_abs(result[5]-outputFunct[5]) > 1e-10) + if( std::abs(result[0]-outputFunct[0]) > 1e-10 || + std::abs(result[1]-outputFunct[1]) > 1e-10 || + std::abs(result[2]-outputFunct[2]) > 1e-10 || + std::abs(result[3]-outputFunct[3]) > 1e-10 || + std::abs(result[4]-outputFunct[4]) > 1e-10 || + std::abs(result[5]-outputFunct[5]) > 1e-10) { std::cout<<"Test gives :"<<std::endl; std::cout<<outputFunct<<std::endl; diff --git a/Modules/Filtering/Projection/include/otbGeographicalDistance.hxx b/Modules/Filtering/Projection/include/otbGeographicalDistance.hxx index 2539ab69a7bace6c76ffecbb89be16f1e3396eb8..0566b9e84ebc77a3880591c6c700a9623bf82da9 100644 --- a/Modules/Filtering/Projection/include/otbGeographicalDistance.hxx +++ b/Modules/Filtering/Projection/include/otbGeographicalDistance.hxx @@ -66,13 +66,13 @@ GeographicalDistance<TVector> const double Deg2Rad = CONST_PI/180.; // Compute latitude and longitude differences - double dLat = (vcl_fabs(x[1] - y[1])) * Deg2Rad; - double dLon = (vcl_fabs(x[0] - y[0])) * Deg2Rad; + double dLat = (std::fabs(x[1] - y[1])) * Deg2Rad; + double dLon = (std::fabs(x[0] - y[0])) * Deg2Rad; // Compute dx in meters - double a = vcl_sin(dLat / Two) * vcl_sin(dLat / Two) + vcl_cos(y[1] * Deg2Rad) * vcl_cos( - x[1] * Deg2Rad) * vcl_sin(dLon / Two) * vcl_sin(dLon / Two); - double c = Two * vcl_atan2(vcl_sqrt(a), vcl_sqrt(One - a)); + double a = std::sin(dLat / Two) * std::sin(dLat / Two) + std::cos(y[1] * Deg2Rad) * std::cos( + x[1] * Deg2Rad) * std::sin(dLon / Two) * std::sin(dLon / Two); + double c = Two * std::atan2(std::sqrt(a), std::sqrt(One - a)); double d = m_EarthRadius * c; // Return result diff --git a/Modules/Filtering/Projection/include/otbGroundSpacingImageFunction.hxx b/Modules/Filtering/Projection/include/otbGroundSpacingImageFunction.hxx index 0c7a2d85c4f1eb422e7b5d6036a4e978afe43aa0..d6210e5f07cfc71d7ccd46d07df0910f2f1f0e4b 100644 --- a/Modules/Filtering/Projection/include/otbGroundSpacingImageFunction.hxx +++ b/Modules/Filtering/Projection/include/otbGroundSpacingImageFunction.hxx @@ -72,42 +72,42 @@ GroundSpacingImageFunction<TInputImage, TCoordRep> IndexType indexSrcX, indexSrcY; indexSrcX[0] = - static_cast<IndexValueType>(vcl_fabs(static_cast<ValueType>(this->GetInputImage()->GetLargestPossibleRegion(). + static_cast<IndexValueType>(std::fabs(static_cast<ValueType>(this->GetInputImage()->GetLargestPossibleRegion(). GetSize()[0] - index[0]))); // x position indexSrcX[1] = index[1]; // y position indexSrcY[0] = index[0]; // x position indexSrcY[1] = - static_cast<IndexValueType>(vcl_fabs(static_cast<ValueType>(this->GetInputImage()->GetLargestPossibleRegion(). + static_cast<IndexValueType>(std::fabs(static_cast<ValueType>(this->GetInputImage()->GetLargestPossibleRegion(). GetSize()[1] - index[1]))); PointType pointSrcX = this->GetPixelLocation(indexSrcX); PointType pointSrcY = this->GetPixelLocation(indexSrcY); - ValueType dLatX = (vcl_fabs(pointSrcX[1] - point[1])) * m_Deg2radCoef; - ValueType dLonX = (vcl_fabs(pointSrcX[0] - point[0])) * m_Deg2radCoef; + ValueType dLatX = (std::fabs(pointSrcX[1] - point[1])) * m_Deg2radCoef; + ValueType dLonX = (std::fabs(pointSrcX[0] - point[0])) * m_Deg2radCoef; const ValueType One = itk::NumericTraits<ValueType>::One; const ValueType Two = One + One; - ValueType aX = vcl_sin(dLatX / Two) * vcl_sin(dLatX / Two) + vcl_cos(point[1] * m_Deg2radCoef) * vcl_cos( - pointSrcX[1] * m_Deg2radCoef) * vcl_sin(dLonX / Two) * vcl_sin(dLonX / Two); - ValueType cX = Two * vcl_atan2(vcl_sqrt(aX), vcl_sqrt(One - aX)); + ValueType aX = std::sin(dLatX / Two) * std::sin(dLatX / Two) + std::cos(point[1] * m_Deg2radCoef) * std::cos( + pointSrcX[1] * m_Deg2radCoef) * std::sin(dLonX / Two) * std::sin(dLonX / Two); + ValueType cX = Two * std::atan2(std::sqrt(aX), std::sqrt(One - aX)); ValueType dX = m_R * cX; - ValueType dLatY = (vcl_fabs(pointSrcY[1] - point[1])) * m_Deg2radCoef; - ValueType dLonY = (vcl_fabs(pointSrcY[0] - point[0])) * m_Deg2radCoef; + ValueType dLatY = (std::fabs(pointSrcY[1] - point[1])) * m_Deg2radCoef; + ValueType dLonY = (std::fabs(pointSrcY[0] - point[0])) * m_Deg2radCoef; - ValueType aY = vcl_sin(dLatY / Two) * vcl_sin(dLatY / Two) + vcl_cos(point[1] * m_Deg2radCoef) * vcl_cos( - pointSrcY[1] * m_Deg2radCoef) * vcl_sin(dLonY / Two) * vcl_sin(dLonY / Two); - ValueType cY = Two * vcl_atan2(vcl_sqrt(aY), vcl_sqrt(One - aY)); + ValueType aY = std::sin(dLatY / Two) * std::sin(dLatY / Two) + std::cos(point[1] * m_Deg2radCoef) * std::cos( + pointSrcY[1] * m_Deg2radCoef) * std::sin(dLonY / Two) * std::sin(dLonY / Two); + ValueType cY = Two * std::atan2(std::sqrt(aY), std::sqrt(One - aY)); ValueType dY = m_R * cY; //FloatType var; - var[0] = dX / (vcl_fabs(static_cast<ValueType>(indexSrcX[0] - index[0]))); - var[1] = dY / (vcl_fabs(static_cast<ValueType>(indexSrcY[1] - index[1]))); + var[0] = dX / (std::fabs(static_cast<ValueType>(indexSrcX[0] - index[0]))); + var[1] = dY / (std::fabs(static_cast<ValueType>(indexSrcY[1] - index[1]))); return var; } diff --git a/Modules/Filtering/Projection/include/otbVectorDataIntoImageProjectionFilter.hxx b/Modules/Filtering/Projection/include/otbVectorDataIntoImageProjectionFilter.hxx index 067342ec3c0b87b9d4ed6b0021e8919d6a37fb15..395a12c73ef5c1e5ce4eff7e20ebd8d2abddec32 100644 --- a/Modules/Filtering/Projection/include/otbVectorDataIntoImageProjectionFilter.hxx +++ b/Modules/Filtering/Projection/include/otbVectorDataIntoImageProjectionFilter.hxx @@ -165,8 +165,8 @@ VectorDataIntoImageProjectionFilter<TInputVectorData, TInputImage> typename RemoteSensingRegionType::SizeType rsSize; rsOrigin[0] = std::min(pul[0], plr[0]); rsOrigin[1] = std::min(pul[1], plr[1]); - rsSize[0] = vcl_abs(pul[0] - plr[0]); - rsSize[1] = vcl_abs(pul[1] - plr[1]); + rsSize[0] = std::abs(pul[0] - plr[0]); + rsSize[1] = std::abs(pul[1] - plr[1]); rsRegion.SetOrigin(rsOrigin); rsRegion.SetSize(rsSize); diff --git a/Modules/Filtering/Projection/src/otbPleiadesPToXSAffineTransformCalculator.cxx b/Modules/Filtering/Projection/src/otbPleiadesPToXSAffineTransformCalculator.cxx index 2218647e422411eb672d7818f71d1bd80477b868..51d414aff1697b9a0cf58550ccd30853f60aa9af 100644 --- a/Modules/Filtering/Projection/src/otbPleiadesPToXSAffineTransformCalculator.cxx +++ b/Modules/Filtering/Projection/src/otbPleiadesPToXSAffineTransformCalculator.cxx @@ -164,7 +164,7 @@ PleiadesPToXSAffineTransformCalculator This leads to the following formula: */ - double lineShift_MS_P = -vcl_floor((timeDelta/(linePeriodPan/1000)+0.5))+1.5; + double lineShift_MS_P = -std::floor((timeDelta/(linePeriodPan/1000)+0.5))+1.5; double colShift_MS_P = -((colStartXS-1)*4 - colStartPan + 1)+1.5; OffsetType offset; diff --git a/Modules/Filtering/Projection/test/otbGeographicalDistance.cxx b/Modules/Filtering/Projection/test/otbGeographicalDistance.cxx index ab16ca6e8aa78b5e1d25dc42080115335af13ae2..c22069156ffa02f5bf3f512ad72eb76579d74e99 100644 --- a/Modules/Filtering/Projection/test/otbGeographicalDistance.cxx +++ b/Modules/Filtering/Projection/test/otbGeographicalDistance.cxx @@ -63,13 +63,13 @@ int otbGeographicalDistance(int itkNotUsed(argc), char * argv[]) bool failFlag = false; std::cerr.setf(std::ios_base::fixed); std::cerr.precision(5); - if(vcl_abs(distEvaluate1 - expectedDistance) > tolerance) + if(std::abs(distEvaluate1 - expectedDistance) > tolerance) { std::cerr<<"Evaluate("<<a<<") with origin "<<o<<" is inaccurate: expected "<< expectedDistance<<", found "<<distEvaluate1<<std::endl; failFlag = true; } - if(vcl_abs(distEvaluate2 - expectedDistance) > tolerance) + if(std::abs(distEvaluate2 - expectedDistance) > tolerance) { std::cerr<<"Evaluate("<<a<<", "<<b<<") is inaccurate: expected "<< expectedDistance<<", found "<<distEvaluate2<<std::endl; failFlag = true; diff --git a/Modules/Filtering/Projection/test/otbVectorDataIntoImageProjectionFilterTest.cxx b/Modules/Filtering/Projection/test/otbVectorDataIntoImageProjectionFilterTest.cxx index be39753484d4ea49e85f4f946f43d62951e87c45..3eccae96282470432ab01419bd3e916d427f6730 100644 --- a/Modules/Filtering/Projection/test/otbVectorDataIntoImageProjectionFilterTest.cxx +++ b/Modules/Filtering/Projection/test/otbVectorDataIntoImageProjectionFilterTest.cxx @@ -209,8 +209,8 @@ int otbVectorDataIntoImageProjectionFilterCompareImplTest(int itkNotUsed(argc), RemoteSensingRegionType::SizeType rsSize; rsOrigin[0] = std::min(pul[0], plr[0]); rsOrigin[1] = std::min(pul[1], plr[1]); - rsSize[0] = vcl_abs(pul[0] - plr[0]); - rsSize[1] = vcl_abs(pul[1] - plr[1]); + rsSize[0] = std::abs(pul[0] - plr[0]); + rsSize[1] = std::abs(pul[1] - plr[1]); rsRegion.SetOrigin(rsOrigin); rsRegion.SetSize(rsSize); diff --git a/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.h b/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.h index 4ef154a0e4ed2c449a98199af3bdd008006d195c..6b7af43801a11bd85ce1fa68654780a53a071a6e 100644 --- a/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.h +++ b/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.h @@ -129,7 +129,7 @@ public: RealType operator()(RealType x) const { - return vcl_exp(-0.5 * x); + return std::exp(-0.5 * x); } RealType GetRadius(RealType bandwidth) const @@ -246,8 +246,8 @@ public: while (!inputIt.IsAtEnd()) { const PixelType &p = inputIt.Get(); - minValue = vcl_min(minValue, p[m_SpectralCoordinate]); - maxValue = vcl_max(maxValue, p[m_SpectralCoordinate]); + minValue = std::min(minValue, p[m_SpectralCoordinate]); + maxValue = std::max(maxValue, p[m_SpectralCoordinate]); ++inputIt; } diff --git a/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx b/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx index 79078aaff2594440b968e72d2d49da36f794ee47..0747dcb0a4f2594bd2d2af4e695c4cfcd04efbda 100644 --- a/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx @@ -362,16 +362,16 @@ void MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIt // Calculates current pixel neighborhood region, restricted to the output image region for (unsigned int comp = 0; comp < ImageDimension; ++comp) { - inputIndex[comp] = vcl_floor(jointPixel[comp] + 0.5) - m_GlobalShift[comp]; + inputIndex[comp] = std::floor(jointPixel[comp] + 0.5) - m_GlobalShift[comp]; - regionIndex[comp] = vcl_max(static_cast<long int> (outputRegion.GetIndex().GetElement(comp)), + regionIndex[comp] = std::max(static_cast<long int> (outputRegion.GetIndex().GetElement(comp)), static_cast<long int> (inputIndex[comp] - m_SpatialRadius[comp] - 1)); - const long int indexRight = vcl_min( + const long int indexRight = std::min( static_cast<long int> (outputRegion.GetIndex().GetElement(comp) + outputRegion.GetSize().GetElement(comp) - 1), static_cast<long int> (inputIndex[comp] + m_SpatialRadius[comp] + 1)); - regionSize[comp] = vcl_max(0l, indexRight - static_cast<long int> (regionIndex[comp]) + 1); + regionSize[comp] = std::max(0l, indexRight - static_cast<long int> (regionIndex[comp]) + 1); } RegionType neighborhoodRegion; @@ -637,7 +637,7 @@ void MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIt // Find index of the pixel closest to the current jointPixel (not normalized by bandwidth) for (unsigned int comp = 0; comp < ImageDimension; comp++) { - modeCandidate[comp] = vcl_floor(jointPixel[comp] - m_GlobalShift[comp] + 0.5); + modeCandidate[comp] = std::floor(jointPixel[comp] - m_GlobalShift[comp] + 0.5); } // Check status of candidate mode diff --git a/Modules/Filtering/Statistics/include/otbHistogramStatisticsFunction.hxx b/Modules/Filtering/Statistics/include/otbHistogramStatisticsFunction.hxx index d3cd3b37663c66bedb95dfb584cdc0b6fed8885b..066d26eac33f623a13783a790909c3337e802c86 100644 --- a/Modules/Filtering/Statistics/include/otbHistogramStatisticsFunction.hxx +++ b/Modules/Filtering/Statistics/include/otbHistogramStatisticsFunction.hxx @@ -92,7 +92,7 @@ HistogramStatisticsFunction<TInputHistogram, TOutput> Proba /= static_cast<RealType>(globalFrequency); if (Proba != 0.0) { - entropy -= Proba * vcl_log(Proba); + entropy -= Proba * std::log(Proba); } ++iter; } diff --git a/Modules/Filtering/Statistics/include/otbListSampleGenerator.hxx b/Modules/Filtering/Statistics/include/otbListSampleGenerator.hxx index 1aa680e18ef11c8fdd197da70de6b7b8d0b8f7a5..e52e8d6398b9a32825493ba60c59525a56f571ad 100644 --- a/Modules/Filtering/Statistics/include/otbListSampleGenerator.hxx +++ b/Modules/Filtering/Statistics/include/otbListSampleGenerator.hxx @@ -435,7 +435,7 @@ double ListSampleGenerator<TImage, TVectorData> ::GetPolygonAreaInPixelsUnits(DataNodeType* polygonDataNode, ImageType* image) { - const double pixelArea = vcl_abs(image->GetSignedSpacing()[0] * image->GetSignedSpacing()[1]); + const double pixelArea = std::abs(image->GetSignedSpacing()[0] * image->GetSignedSpacing()[1]); // Compute area of exterior ring in pixels PolygonPointerType exteriorRing = polygonDataNode->GetPolygonExteriorRing(); diff --git a/Modules/Filtering/Statistics/include/otbLocalHistogramImageFunction.hxx b/Modules/Filtering/Statistics/include/otbLocalHistogramImageFunction.hxx index cdef25d6e0122ff5fe17925a34b5ee4a492f82da..03126726562c72600239cb8b805d53432fb3a667 100644 --- a/Modules/Filtering/Statistics/include/otbLocalHistogramImageFunction.hxx +++ b/Modules/Filtering/Statistics/include/otbLocalHistogramImageFunction.hxx @@ -114,7 +114,7 @@ LocalHistogramImageFunction<TInputImage, TCoordRep> double gWeight = 1.; if(m_GaussianSmoothing) { - gWeight = (1/vcl_sqrt(otb::CONST_2PI*squaredSigma)) * vcl_exp(- currentSquaredRadius/(2*squaredSigma)); + gWeight = (1/std::sqrt(otb::CONST_2PI*squaredSigma)) * std::exp(- currentSquaredRadius/(2*squaredSigma)); } // Compute pixel location diff --git a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.h b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.h index 462b80d70f121b645364a256c8d074ab6dc28981..f8f60f48c977f57c5634df68051e72665c14f14d 100644 --- a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.h +++ b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.h @@ -93,7 +93,7 @@ public: m_StdDev.SetSize( var.Size() ); for ( unsigned int i = 0; i < m_StdDev.Size(); ++i ) { - m_StdDev[i] = vcl_sqrt( static_cast< RealType >( var[i] ) ); + m_StdDev[i] = std::sqrt( static_cast< RealType >( var[i] ) ); if ( m_StdDev[i] == itk::NumericTraits< RealType >::Zero ) { throw itk::ExceptionObject(__FILE__, __LINE__, diff --git a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx index f2534c4e223b2d31479a3a75caff76828b57f721..ae3c4315aa787f6fb1eaaec3310e8d0a99727286 100644 --- a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx @@ -76,7 +76,7 @@ NormalizeVectorImageFilter< TInputImage, TOutputImage > typename StreamingStatisticsVectorImageFilter< InputImageType >::RealPixelType sigma ( this->GetInput()->GetNumberOfComponentsPerPixel() ); for ( unsigned int i = 0; i < sigma.Size(); ++i ) - sigma[i] = vcl_sqrt( m_CovarianceEstimator->GetCovariance()(i, i) ); + sigma[i] = std::sqrt( m_CovarianceEstimator->GetCovariance()(i, i) ); this->GetFunctor().SetStdDev( sigma ); } diff --git a/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx index b67233a61908df8efe1f5f0e5ff33f3906856b6d..dfb0f307c1d09658494ed400368b28baadbe95dc 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx @@ -268,7 +268,7 @@ PersistentCompareImageFilter<TInputImage> mae = (count != 0) ? absoluteValueOfDifferences / static_cast<RealType>(count) : 0.; //compute psnr - psnr = (vcl_abs(mse)>0.0000000001 && (maximumRef-minimumRef)>0.0000000001) ? 10.*vcl_log10(((maximumRef-minimumRef)*(maximumRef-minimumRef))/mse):0.; + psnr = (std::abs(mse)>0.0000000001 && (maximumRef-minimumRef)>0.0000000001) ? 10.*std::log10(((maximumRef-minimumRef)*(maximumRef-minimumRef))/mse):0.; // Set the output this->GetMSEOutput()->Set(mse); this->GetMAEOutput()->Set(mae); @@ -353,7 +353,7 @@ PersistentCompareImageFilter<TInputImage> RealType diffVal = realValue1 - realValue2; m_SquareOfDifferences[threadId] += diffVal * diffVal; - m_AbsoluteValueOfDifferences[threadId] += vcl_abs( diffVal ); + m_AbsoluteValueOfDifferences[threadId] += std::abs( diffVal ); if (! itk::Math::FloatAlmostEqual(realValue1, realValue2)) { m_DiffCount[threadId]++; diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx index b6018ac992fa9a229ec0c1636495b68fb0441e09..5504e9411f26982d2216863bfc9086c485c63e98 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx @@ -278,7 +278,7 @@ PersistentStatisticsImageFilter<TInputImage> // unbiased estimate variance = (sumOfSquares - (sum * sum / static_cast<RealType>(count))) / static_cast<RealType>(count - 1); - sigma = vcl_sqrt(variance); + sigma = std::sqrt(variance); } } else diff --git a/Modules/Filtering/Statistics/src/otbPatternSampler.cxx b/Modules/Filtering/Statistics/src/otbPatternSampler.cxx index b085b45963e5eca18ba25705c8f81679cdb73996..9fef18f820219a04a270769cd0184cc6ea56567d 100644 --- a/Modules/Filtering/Statistics/src/otbPatternSampler.cxx +++ b/Modules/Filtering/Statistics/src/otbPatternSampler.cxx @@ -59,7 +59,7 @@ PatternSampler::Reset(void) if (this->m_Parameters.Seed) { unsigned long T1 = FindBestSize(this->GetTotalElements()); - unsigned long N1 = static_cast<unsigned long>(vcl_floor( this->GetRate() * T1 )); + unsigned long N1 = static_cast<unsigned long>(std::floor( this->GetRate() * T1 )); double selected_ratio = static_cast<double>(N1)/static_cast<double>(T1); @@ -78,7 +78,7 @@ PatternSampler::Reset(void) T2 = FindBestSize(this->GetTotalElements()/T1*(T1-N1)); if (T2>0) { - N2 = static_cast<unsigned long>(vcl_ceil( ratio2 * T2 )); + N2 = static_cast<unsigned long>(std::ceil( ratio2 * T2 )); } } diff --git a/Modules/Filtering/Statistics/src/otbPeriodicSampler.cxx b/Modules/Filtering/Statistics/src/otbPeriodicSampler.cxx index d72413ffe5a78fd5689d319252edb0dfecbc4c0f..1e26e9dcd5a795ea5ab61c38e8741818a5d2e401 100644 --- a/Modules/Filtering/Statistics/src/otbPeriodicSampler.cxx +++ b/Modules/Filtering/Statistics/src/otbPeriodicSampler.cxx @@ -80,7 +80,7 @@ PeriodicSampler::TakeSample(void) // if ceil(val) > 0; then take the sample this->m_ProcessedElements += 1UL; double val = ((double)(this->m_ProcessedElements) - m_OffsetValue )*this->GetRate() - (double)(this->m_ChosenElements); - if (0 < (int)(vcl_ceil(val))) + if (0 < (int)(std::ceil(val))) { this->m_ChosenElements += 1UL; if (m_JitterSize > 0.0) diff --git a/Modules/Filtering/Statistics/src/otbSamplerBase.cxx b/Modules/Filtering/Statistics/src/otbSamplerBase.cxx index 002ec6075c14a728e771d400c129a282b8358810..ccb783d63c7b94e3af16b758a133b0a6b7a5428a 100644 --- a/Modules/Filtering/Statistics/src/otbSamplerBase.cxx +++ b/Modules/Filtering/Statistics/src/otbSamplerBase.cxx @@ -98,7 +98,7 @@ SamplerBase::SetRate(double rate, unsigned long total) } if (modified) { - m_NeededElements = (unsigned long)(vcl_floor(0.5 + m_Rate * (double)(m_TotalElements) )); + m_NeededElements = (unsigned long)(std::floor(0.5 + m_Rate * (double)(m_TotalElements) )); this->Modified(); } } diff --git a/Modules/Filtering/Statistics/test/otbHistogramStatisticsFunction.cxx b/Modules/Filtering/Statistics/test/otbHistogramStatisticsFunction.cxx index c7374a8e485cb7e0088bc5274dc226b54b90fb3e..55c5a90c967a29a4d3667c59f29ecd7c53646363 100644 --- a/Modules/Filtering/Statistics/test/otbHistogramStatisticsFunction.cxx +++ b/Modules/Filtering/Statistics/test/otbHistogramStatisticsFunction.cxx @@ -65,7 +65,7 @@ int otbHistogramStatisticsFunction(int itkNotUsed(argc), char * argv[]) Entropy = HistogramStatisticsFunction->GetEntropy()[0]; std::cout << "Entropy 1 : " << Entropy << std::endl; - if (vcl_abs(Entropy - vcl_log(static_cast<double>(NbOfBins))) > 0.00001) + if (std::abs(Entropy - std::log(static_cast<double>(NbOfBins))) > 0.00001) { std::cout << "Error in entropy estimation" << std::endl; return EXIT_FAILURE; diff --git a/Modules/Filtering/TimeSeries/include/otbTimeSeries.h b/Modules/Filtering/TimeSeries/include/otbTimeSeries.h index f93617ae5eefc9df7a7ab634f4fea7a3c8007c73..2e3f180459895dad8bf412af20fe21f9483301e0 100644 --- a/Modules/Filtering/TimeSeries/include/otbTimeSeries.h +++ b/Modules/Filtering/TimeSeries/include/otbTimeSeries.h @@ -62,7 +62,7 @@ public: { CoefficientsPrecisionType tmpVal = 0; for( unsigned int i=0; i<=TDegree; ++i) - tmpVal += m_Coefficients[i]*vcl_pow(val, static_cast<CoefficientsPrecisionType>(i)); + tmpVal += m_Coefficients[i]*std::pow(val, static_cast<CoefficientsPrecisionType>(i)); return tmpVal; } diff --git a/Modules/Filtering/TimeSeries/test/otbEnvelopeSavitzkyGolayInterpolationFunctorTest.cxx b/Modules/Filtering/TimeSeries/test/otbEnvelopeSavitzkyGolayInterpolationFunctorTest.cxx index 03e8bacafb2aa974a3311a3bb4da52fd2a3334c0..a4235b82c1c033364cebf2d69819adf3e597f25a 100644 --- a/Modules/Filtering/TimeSeries/test/otbEnvelopeSavitzkyGolayInterpolationFunctorTest.cxx +++ b/Modules/Filtering/TimeSeries/test/otbEnvelopeSavitzkyGolayInterpolationFunctorTest.cxx @@ -43,7 +43,7 @@ int otbEnvelopeSavitzkyGolayInterpolationFunctorTest(int itkNotUsed(argc), char* for(unsigned int i=0; i<nbDates; ++i) { - inSeries[i] = 10*vcl_cos(i/10.0); + inSeries[i] = 10*std::cos(i/10.0); cleanSeries[i] = inSeries[i]; doySeries[i] = i; weightSeries[i] = 1; @@ -72,7 +72,7 @@ int otbEnvelopeSavitzkyGolayInterpolationFunctorTest(int itkNotUsed(argc), char* for(unsigned int i=0; i<nbDates; ++i) { - interpolError += vcl_fabs(outSeries[i]-cleanSeries[i]); + interpolError += std::fabs(outSeries[i]-cleanSeries[i]); } diff --git a/Modules/Filtering/TimeSeries/test/otbSavitzkyGolayInterpolationFunctorTest.cxx b/Modules/Filtering/TimeSeries/test/otbSavitzkyGolayInterpolationFunctorTest.cxx index 207ee80c594e02a8b8d644ce32a67d97affce132..45d915d0eaad55f8e634d914974927dcef454a01 100644 --- a/Modules/Filtering/TimeSeries/test/otbSavitzkyGolayInterpolationFunctorTest.cxx +++ b/Modules/Filtering/TimeSeries/test/otbSavitzkyGolayInterpolationFunctorTest.cxx @@ -41,7 +41,7 @@ int otbSavitzkyGolayInterpolationFunctorTest(int itkNotUsed(argc), char* itkNotU for(unsigned int i=0; i<nbDates; ++i) { - inSeries[i] = 10*vcl_cos(i/10.0); + inSeries[i] = 10*std::cos(i/10.0); doySeries[i] = i; weightSeries[i] = 1; } @@ -66,7 +66,7 @@ int otbSavitzkyGolayInterpolationFunctorTest(int itkNotUsed(argc), char* itkNotU for(unsigned int i=0; i<nbDates; ++i) { - interpolError += vcl_fabs(outSeries[i]-inSeries[i]); + interpolError += std::fabs(outSeries[i]-inSeries[i]); } diff --git a/Modules/Filtering/TimeSeries/test/otbTimeSeriesLeastSquareFittingFunctorTest.cxx b/Modules/Filtering/TimeSeries/test/otbTimeSeriesLeastSquareFittingFunctorTest.cxx index 6c6e4a3c18e943e2d7e4bec8121586a3945f90a1..2b9c2bcd6c43d3acc856d709436bd96f37e84408 100644 --- a/Modules/Filtering/TimeSeries/test/otbTimeSeriesLeastSquareFittingFunctorTest.cxx +++ b/Modules/Filtering/TimeSeries/test/otbTimeSeriesLeastSquareFittingFunctorTest.cxx @@ -51,7 +51,7 @@ int otbTimeSeriesLeastSquareFittingFunctorTest(int itkNotUsed(argc), char* argv[ // x = a + b * t + c * t^2 for(unsigned int i = 0; i<nbDates; ++i) - inSeries[i] = inCoefs[0]+inCoefs[1]*doySeries[i]+inCoefs[2]*vcl_pow(doySeries[i], 2.0); + inSeries[i] = inCoefs[0]+inCoefs[1]*doySeries[i]+inCoefs[2]*std::pow(doySeries[i], 2.0); FunctorType f; diff --git a/Modules/Filtering/TimeSeries/test/otbTimeSeriesLeastSquareFittingFunctorWeightsTest.cxx b/Modules/Filtering/TimeSeries/test/otbTimeSeriesLeastSquareFittingFunctorWeightsTest.cxx index 23c4c555e350d61661881d0c582bb636ace88968..5c70093f200cd67eaa1fe4767031f6c9e5602626 100644 --- a/Modules/Filtering/TimeSeries/test/otbTimeSeriesLeastSquareFittingFunctorWeightsTest.cxx +++ b/Modules/Filtering/TimeSeries/test/otbTimeSeriesLeastSquareFittingFunctorWeightsTest.cxx @@ -53,7 +53,7 @@ int otbTimeSeriesLeastSquareFittingFunctorWeightsTest(int itkNotUsed(argc), char // x = a + b * t + c * t^2 for(unsigned int i = 0; i<nbDates; ++i) { - inSeries[i] = inCoefs[0]+inCoefs[1]*doySeries[i]+inCoefs[2]*vcl_pow(doySeries[i], 2.0); + inSeries[i] = inCoefs[0]+inCoefs[1]*doySeries[i]+inCoefs[2]*std::pow(doySeries[i], 2.0); weightSeries[i] = 1; } diff --git a/Modules/Filtering/VectorDataManipulation/include/otbDBOverlapDataNodeFeatureFunction.hxx b/Modules/Filtering/VectorDataManipulation/include/otbDBOverlapDataNodeFeatureFunction.hxx index 424f50a3da00118780d5141d2bbdd65ea9c671db..c5fc6b427cb7a302b6d50582e29aacfa47679e9c 100644 --- a/Modules/Filtering/VectorDataManipulation/include/otbDBOverlapDataNodeFeatureFunction.hxx +++ b/Modules/Filtering/VectorDataManipulation/include/otbDBOverlapDataNodeFeatureFunction.hxx @@ -73,7 +73,7 @@ DBOverlapDataNodeFeatureFunction<TCoordRep, TPrecision> double dx = x - p[0]; double dy = y - p[1]; - return vcl_sqrt(dx*dx + dy*dy); + return std::sqrt(dx*dx + dy*dy); } template <class TCoordRep, class TPrecision> diff --git a/Modules/Filtering/VectorDataManipulation/include/otbSpectralAngleDataNodeFeatureFunction.hxx b/Modules/Filtering/VectorDataManipulation/include/otbSpectralAngleDataNodeFeatureFunction.hxx index a155f52b6358b6f802ffb82aa624da84b69bee84..a6884ee597791e4117613863d1d0c6d71ff26f30 100644 --- a/Modules/Filtering/VectorDataManipulation/include/otbSpectralAngleDataNodeFeatureFunction.hxx +++ b/Modules/Filtering/VectorDataManipulation/include/otbSpectralAngleDataNodeFeatureFunction.hxx @@ -176,7 +176,7 @@ typename SpectralAngleDataNodeFeatureFunction<TImage, TCoordRep, TPrecision>::Ou if (centralNbVisitedPixel != 0.) { meanCentral = static_cast<double> (centralAccSpectralAngle) / centralNbVisitedPixel; - //stddevCentral = vcl_sqrt( centralAccSpectralAngleSecondOrder/centralNbVisitedPixel - meanCentral*meanCentral ); + //stddevCentral = std::sqrt( centralAccSpectralAngleSecondOrder/centralNbVisitedPixel - meanCentral*meanCentral ); } if (meanCentral == 0.) diff --git a/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.hxx b/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.hxx index f6a9274ece4d6f26bad97537bc8e1e75c64096c5..97f7e3a2882b6442b1b3cd6ce75cbb9a317a7f85 100644 --- a/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.hxx +++ b/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.hxx @@ -254,8 +254,8 @@ VectorDataToMapFilter<TVectorData, TImage> RegionType requestedRegion = output->GetRequestedRegion(); otbMsgDevMacro("requestedRegion: " << requestedRegion); - m_NbTile = (vcl_pow(std::max(vcl_floor((double)requestedRegion.GetSize()[0] / 16000), - vcl_floor((double)requestedRegion.GetSize()[1] / 16000))+1, 2)); + m_NbTile = (std::pow(std::max(std::floor((double)requestedRegion.GetSize()[0] / 16000), + std::floor((double)requestedRegion.GetSize()[1] / 16000))+1, 2)); //std::cout << "nbTile: " << m_NbTile << std::endl; //std::cout << "requestedRegion: " << requestedRegion << std::endl; @@ -268,12 +268,12 @@ VectorDataToMapFilter<TVectorData, TImage> unsigned int stdXOffset; unsigned int stdYOffset; - stdXOffset = vcl_floor((double)requestedRegion.GetSize()[0]/ (m_NbTile/2))+1; - stdYOffset = vcl_floor((double)requestedRegion.GetSize()[1]/ (m_NbTile/2))+1; + stdXOffset = std::floor((double)requestedRegion.GetSize()[0]/ (m_NbTile/2))+1; + stdYOffset = std::floor((double)requestedRegion.GetSize()[1]/ (m_NbTile/2))+1; - for(unsigned int i=0; i < vcl_floor((double)(m_NbTile)/2 + 0.5); ++i) + for(unsigned int i=0; i < std::floor((double)(m_NbTile)/2 + 0.5); ++i) { - for(unsigned int j=0; j < vcl_floor((double)(m_NbTile)/2 + 0.5); ++j) + for(unsigned int j=0; j < std::floor((double)(m_NbTile)/2 + 0.5); ++j) { //Set Regions SizeType size; diff --git a/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx b/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx index 65b7072c3fe567bbe5e57f337c7d78f429bd1a51..f9dff2c8c738d8f7132d162a8b44fc6c3b297a5d 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx +++ b/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx @@ -146,8 +146,8 @@ WaveletsBandsListToWaveletsSynopsisImageFilter<TImageList,TImage> currentSubBand = (bandIndex-1)%3; // Compute potentiel offset in x and y - unsigned int offsetX = largestSize[0]/(unsigned int)vcl_pow((double)m_DecimationRatio,(double)1+numberOfDecompositionLevels-currentLevel); - unsigned int offsetY = largestSize[1]/(unsigned int)vcl_pow((double)m_DecimationRatio,(double)1+numberOfDecompositionLevels-currentLevel); + unsigned int offsetX = largestSize[0]/(unsigned int)std::pow((double)m_DecimationRatio,(double)1+numberOfDecompositionLevels-currentLevel); + unsigned int offsetY = largestSize[1]/(unsigned int)std::pow((double)m_DecimationRatio,(double)1+numberOfDecompositionLevels-currentLevel); // Compute final offset according to the subband index if(currentSubBand == 0) diff --git a/Modules/Filtering/Wavelet/include/otbWaveletsSynopsisImageToWaveletsBandsListFilter.hxx b/Modules/Filtering/Wavelet/include/otbWaveletsSynopsisImageToWaveletsBandsListFilter.hxx index 5089f4964acd628296dc94490def2adde6a02695..e01cae3b9e1ff145fddda321523fca1f45041a1e 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletsSynopsisImageToWaveletsBandsListFilter.hxx +++ b/Modules/Filtering/Wavelet/include/otbWaveletsSynopsisImageToWaveletsBandsListFilter.hxx @@ -103,8 +103,8 @@ WaveletsSynopsisImageToWaveletsBandsListFilter<TImage,TImageList> unsigned int currentLevel = (i-1)/3; unsigned int currentSubBand = (i-1)%3; - unsigned int offsetX = largestSize[0]/(unsigned int)vcl_pow((double)m_DecimationRatio,(double)m_NumberOfLevels-currentLevel); - unsigned int offsetY = largestSize[1]/(unsigned int)vcl_pow((double)m_DecimationRatio,(double)m_NumberOfLevels-currentLevel); + unsigned int offsetX = largestSize[0]/(unsigned int)std::pow((double)m_DecimationRatio,(double)m_NumberOfLevels-currentLevel); + unsigned int offsetY = largestSize[1]/(unsigned int)std::pow((double)m_DecimationRatio,(double)m_NumberOfLevels-currentLevel); // Compute current size currentSize[0] = offsetX; @@ -128,8 +128,8 @@ WaveletsSynopsisImageToWaveletsBandsListFilter<TImage,TImageList> else { // The coarsest scale size - currentSize[0] = largestSize[0]/(unsigned int)vcl_pow((double)m_DecimationRatio,(double)m_NumberOfLevels); - currentSize[1] = largestSize[1]/(unsigned int)vcl_pow((double)m_DecimationRatio,(double)m_NumberOfLevels); + currentSize[0] = largestSize[0]/(unsigned int)std::pow((double)m_DecimationRatio,(double)m_NumberOfLevels); + currentSize[1] = largestSize[1]/(unsigned int)std::pow((double)m_DecimationRatio,(double)m_NumberOfLevels); } // Build current region currentRegion.SetIndex(currentIndex); diff --git a/Modules/Fusion/PanSharpening/include/otbBayesianFusionFilter.hxx b/Modules/Fusion/PanSharpening/include/otbBayesianFusionFilter.hxx index e87c8d82232b3e80c0197f559b5078c58c87a066..ca718c967e6c973c0c6b8944171991eddc8ab44e 100644 --- a/Modules/Fusion/PanSharpening/include/otbBayesianFusionFilter.hxx +++ b/Modules/Fusion/PanSharpening/include/otbBayesianFusionFilter.hxx @@ -275,7 +275,7 @@ BayesianFusionFilter<TInputMultiSpectralImage, eye.Fill(itk::NumericTraits<InputMultiSpectralInterpRealType>::Zero); for (unsigned int r = 1; r < eye.Rows(); ++r) { - eye(r, r) = vcl_pow(10., -12.); + eye(r, r) = std::pow(10., -12.); } /** TODO diff --git a/Modules/Fusion/PanSharpening/include/otbLmvmPanSharpeningFusionImageFilter.h b/Modules/Fusion/PanSharpening/include/otbLmvmPanSharpeningFusionImageFilter.h index 02b5f0a5488effc2600ce1e817406242871d9f6c..74d85336699d1def707944156b84873e772c68f2 100644 --- a/Modules/Fusion/PanSharpening/include/otbLmvmPanSharpeningFusionImageFilter.h +++ b/Modules/Fusion/PanSharpening/include/otbLmvmPanSharpeningFusionImageFilter.h @@ -164,7 +164,7 @@ private: TInternalPrecision scale = 1.; - if(vcl_abs(stdPanchroPixel) > 1e-10) + if(std::abs(stdPanchroPixel) > 1e-10) { scale = 1.0/stdPanchroPixel; } diff --git a/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.h b/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.h index 7256c1e6893a15f74e2d649a663e4d2f987b1e52..ab0d4de8ca5d2dfaa1bf53787176a67367be2aff 100644 --- a/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.h +++ b/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.h @@ -127,7 +127,7 @@ private: TInternalPrecision scale = 1.; - if(vcl_abs(smoothPanchroPixel) > 1e-10) + if(std::abs(smoothPanchroPixel) > 1e-10) { scale = sharpPanchroPixel/smoothPanchroPixel; } @@ -174,7 +174,7 @@ private: TInternalPrecision scale = 1.; - if(vcl_abs(smoothPanchroPixel) > 1e-10) + if(std::abs(smoothPanchroPixel) > 1e-10) { scale = sharpPanchroPixel/smoothPanchroPixel; } diff --git a/Modules/Hyperspectral/EndmembersExtraction/include/otbEigenvalueLikelihoodMaximisation.hxx b/Modules/Hyperspectral/EndmembersExtraction/include/otbEigenvalueLikelihoodMaximisation.hxx index 205f99aa3f143367aaf8a9da8c242fbe0cc49684..621195c3dd32483d38653c0c9f478b1cc4347883 100644 --- a/Modules/Hyperspectral/EndmembersExtraction/include/otbEigenvalueLikelihoodMaximisation.hxx +++ b/Modules/Hyperspectral/EndmembersExtraction/include/otbEigenvalueLikelihoodMaximisation.hxx @@ -48,12 +48,12 @@ EigenvalueLikelihoodMaximisation<TInputImage> // Compute diagonalisation of covariance and correlation vnl_symmetric_eigensystem<PrecisionType> eigenK(m_Covariance); VectorType eigenCovariance = eigenK.D.diagonal(); - vcl_sort(eigenCovariance.begin(), eigenCovariance.end()); + std::sort(eigenCovariance.begin(), eigenCovariance.end()); eigenCovariance.flip(); vnl_symmetric_eigensystem<PrecisionType> eigenR(m_Correlation); VectorType eigenCorrelation = eigenR.D.diagonal(); - vcl_sort(eigenCorrelation.begin(), eigenCorrelation.end()); + std::sort(eigenCorrelation.begin(), eigenCorrelation.end()); eigenCorrelation.flip(); // Compute likelihood log @@ -74,7 +74,7 @@ EigenvalueLikelihoodMaximisation<TInputImage> //std::cout << "sigma[" << j << "]=" << sigma[j] << std::endl; t[j] = (r - k) * (r - k) / sigma[j]; //std::cout << "t[" << j <<"]=" << t[j] << std::endl; - sigma[j] = vcl_log(sigma[j]); + sigma[j] = std::log(sigma[j]); } m_Likelihood(i) = -0.5*t.sum() - 0.5*sigma.sum(); } diff --git a/Modules/Hyperspectral/EndmembersExtraction/include/otbVcaImageFilter.hxx b/Modules/Hyperspectral/EndmembersExtraction/include/otbVcaImageFilter.hxx index 6ff8dad735381821d93bb3ee43b8a355e10883e4..6fc9bc3e5f04d7f2fece2dacefd2a9de83a33427 100644 --- a/Modules/Hyperspectral/EndmembersExtraction/include/otbVcaImageFilter.hxx +++ b/Modules/Hyperspectral/EndmembersExtraction/include/otbVcaImageFilter.hxx @@ -120,10 +120,10 @@ void VCAImageFilter<TImage>::GenerateData() double P_Rp = m_NumberOfEndmembers * transformedStats->GetComponentCorrelation() + statsInput->GetMean().GetSquaredNorm(); //const double qL = static_cast<double>(m_NumberOfEndmembers) / nbBands; - SNR = vcl_abs(10*vcl_log10( (P_Rp - (m_NumberOfEndmembers/nbBands)*P_R) / (P_R - P_Rp) )); + SNR = std::abs(10*std::log10( (P_Rp - (m_NumberOfEndmembers/nbBands)*P_R) / (P_R - P_Rp) )); } - SNRth = 15.0 + 10.0 * vcl_log( static_cast<double>(m_NumberOfEndmembers) ) + 8.0; + SNRth = 15.0 + 10.0 * std::log( static_cast<double>(m_NumberOfEndmembers) ) + 8.0; typename VectorImageType::Pointer Xd; typename VectorImageType::Pointer Y; diff --git a/Modules/Hyperspectral/EndmembersExtraction/include/otbVirtualDimensionality.hxx b/Modules/Hyperspectral/EndmembersExtraction/include/otbVirtualDimensionality.hxx index 2f8fefab8922eef3b45e871f68b029ab994d9baf..e9cd3213df13daa8fda9ca4ec050004ac213df29 100644 --- a/Modules/Hyperspectral/EndmembersExtraction/include/otbVirtualDimensionality.hxx +++ b/Modules/Hyperspectral/EndmembersExtraction/include/otbVirtualDimensionality.hxx @@ -50,18 +50,18 @@ VirtualDimensionality<TInputImage> // Compute diagonalisation of sample covariance and correlation matrices vnl_symmetric_eigensystem<PrecisionType> eigenK(m_Covariance); VectorType eigenCovariance = eigenK.D.diagonal(); - vcl_sort(eigenCovariance.begin(), eigenCovariance.end()); + std::sort(eigenCovariance.begin(), eigenCovariance.end()); eigenCovariance.flip(); vnl_symmetric_eigensystem<PrecisionType> eigenR(m_Correlation); VectorType eigenCorrelation = eigenR.D.diagonal(); - vcl_sort(eigenCorrelation.begin(), eigenCorrelation.end()); + std::sort(eigenCorrelation.begin(), eigenCorrelation.end()); eigenCorrelation.flip(); m_NumberOfEndmembers = 0; for(unsigned int i = 0; i < nbBands; ++i) { - double sigma = vcl_sqrt( 2.0 / m_NumberOfPixels + double sigma = std::sqrt( 2.0 / m_NumberOfPixels * (eigenCovariance[i] + eigenCorrelation[i] + eigenCovariance[i] * eigenCorrelation[i]) ); boost::math::normal normalDist(0, sigma); diff --git a/Modules/Hyperspectral/EndmembersExtraction/test/otbVirtualDimensionality.cxx b/Modules/Hyperspectral/EndmembersExtraction/test/otbVirtualDimensionality.cxx index 1db963f03c10539fecbc82199fda1ac195b3e14a..ae09d913bb5c597f3600084327b75366911dc903 100644 --- a/Modules/Hyperspectral/EndmembersExtraction/test/otbVirtualDimensionality.cxx +++ b/Modules/Hyperspectral/EndmembersExtraction/test/otbVirtualDimensionality.cxx @@ -65,7 +65,7 @@ int otbVirtualDimensionalityTest(int itkNotUsed(argc), char * argv[]) for (int i = 2; i < 10; ++i) { - double falseAlarmRate = vcl_pow(static_cast<double>(10), static_cast<double>(-i)); + double falseAlarmRate = std::pow(static_cast<double>(10), static_cast<double>(-i)); vd->SetFAR(falseAlarmRate); vd->Compute(); diff --git a/Modules/IO/Carto/include/otbCoordinateToName.h b/Modules/IO/Carto/include/otbCoordinateToName.h index 8d21dfd22750a7d84cc847411b041f872956a965..563c545da62b806523922ac3924850a0ef571b15 100644 --- a/Modules/IO/Carto/include/otbCoordinateToName.h +++ b/Modules/IO/Carto/include/otbCoordinateToName.h @@ -68,7 +68,7 @@ public: */ bool SetLonLat(PointType point) { - if ((vcl_abs(point[0] - m_Lon) > m_UpdateDistance) || (vcl_abs(point[1] - m_Lat) > m_UpdateDistance)) + if ((std::abs(point[0] - m_Lon) > m_UpdateDistance) || (std::abs(point[1] - m_Lat) > m_UpdateDistance)) { // std::cout << "Update lon/lat " << m_Lon << ", " << m_Lat << " -> " << point << std::endl; m_Lon = point[0]; diff --git a/Modules/IO/Carto/include/otbMapFileProductWriter.hxx b/Modules/IO/Carto/include/otbMapFileProductWriter.hxx index ffe3b65e4af93f8d2b299aec8c7230dad78f335e..46ef1ad17c0c6ddaa45499b2e99408e3cfd84343 100644 --- a/Modules/IO/Carto/include/otbMapFileProductWriter.hxx +++ b/Modules/IO/Carto/include/otbMapFileProductWriter.hxx @@ -214,8 +214,8 @@ MapFileProductWriter<TInputImage> // Compute max depth unsigned int maxDepth = - static_cast<unsigned int>(std::max(vcl_ceil(vcl_log(static_cast<float>(sizeX) / static_cast<float>(m_TileSize)) / vcl_log(2.0)), - vcl_ceil(vcl_log(static_cast<float>(sizeY) / static_cast<float>(m_TileSize)) / vcl_log(2.0)))); + static_cast<unsigned int>(std::max(std::ceil(std::log(static_cast<float>(sizeX) / static_cast<float>(m_TileSize)) / std::log(2.0)), + std::ceil(std::log(static_cast<float>(sizeY) / static_cast<float>(m_TileSize)) / std::log(2.0)))); // Extract size & index SizeType extractSize; diff --git a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx index dd235496ad4177768d544ddb4b6e92b88da99911..ff4a42561d5c1b2da44c7f770643f48cacf33cba 100644 --- a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx @@ -875,8 +875,8 @@ void GDALImageIO::InternalReadImageInformation() } // Compute final spacing with the resolution factor - m_Spacing[0] *= vcl_pow(2.0, static_cast<double>(m_ResolutionFactor)); - m_Spacing[1] *= vcl_pow(2.0, static_cast<double>(m_ResolutionFactor)); + m_Spacing[0] *= std::pow(2.0, static_cast<double>(m_ResolutionFactor)); + m_Spacing[1] *= std::pow(2.0, static_cast<double>(m_ResolutionFactor)); // Now that the spacing is known, apply the half-pixel shift m_Origin[0] += 0.5*m_Spacing[0]; m_Origin[1] += 0.5*m_Spacing[1]; @@ -1421,10 +1421,10 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer) /* -------------------------------------------------------------------- */ const double Epsilon = 1E-10; if (projectionRef.empty() - && (vcl_abs(m_Origin[0] - 0.5) > Epsilon - || vcl_abs(m_Origin[1] - 0.5) > Epsilon - || vcl_abs(m_Spacing[0] * m_Direction[0][0] - 1.0) > Epsilon - || vcl_abs(m_Spacing[1] * m_Direction[1][1] - 1.0) > Epsilon) ) + && (std::abs(m_Origin[0] - 0.5) > Epsilon + || std::abs(m_Origin[1] - 0.5) > Epsilon + || std::abs(m_Spacing[0] * m_Direction[0][0] - 1.0) > Epsilon + || std::abs(m_Spacing[1] * m_Direction[1][1] - 1.0) > Epsilon) ) { // See issue #303 : // If there is no ProjectionRef, and the GeoTransform is not the identity, @@ -1503,10 +1503,10 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer) /* -------------------------------------------------------------------- */ /* Set the six coefficients of affine geoTransform */ /* -------------------------------------------------------------------- */ - if ( vcl_abs(m_Origin[0] - 0.5) > Epsilon - || vcl_abs(m_Origin[1] - 0.5) > Epsilon - || vcl_abs(m_Spacing[0] * m_Direction[0][0] - 1.0) > Epsilon - || vcl_abs(m_Spacing[1] * m_Direction[1][1] - 1.0) > Epsilon ) + if ( std::abs(m_Origin[0] - 0.5) > Epsilon + || std::abs(m_Origin[1] - 0.5) > Epsilon + || std::abs(m_Spacing[0] * m_Direction[0][0] - 1.0) > Epsilon + || std::abs(m_Spacing[1] * m_Direction[1][1] - 1.0) > Epsilon ) { // Only set the geotransform if it is not identity (it may erase GCP) itk::VariableLengthVector<double> geoTransform(6); diff --git a/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx b/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx index 6eaf94fbd8ae64e7cc2199ca4284248cf211cd0c..4ceec69aaed70346ad29d72eefaa7d8261691609 100644 --- a/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx +++ b/Modules/IO/IOTileMap/src/otbTileMapImageIO.cxx @@ -272,9 +272,9 @@ void TileMapImageIO::GenerateURL(double x, double y) { urlStream << m_ServerName; urlStream << "hl=en&x="; - urlStream << vcl_floor(x * (1 << m_Depth)); + urlStream << std::floor(x * (1 << m_Depth)); urlStream << "&y="; - urlStream << vcl_floor(y * (1 << m_Depth)); + urlStream << std::floor(y * (1 << m_Depth)); urlStream << "&z="; urlStream << m_Depth; urlStream << "&nml=Vert&s=Ga"; diff --git a/Modules/IO/ImageIO/include/otbImageFileReader.hxx b/Modules/IO/ImageIO/include/otbImageFileReader.hxx index da9350ff6ec96fd25a2966ead602b12d9a04566d..d611cc98fe58062309cd1d74991e0a593dc6c21d 100644 --- a/Modules/IO/ImageIO/include/otbImageFileReader.hxx +++ b/Modules/IO/ImageIO/include/otbImageFileReader.hxx @@ -372,7 +372,7 @@ ImageFileReader<TOutputImage, ConvertPixelTraits> { if ( m_FilenameHelper->GetResolutionFactor() != 0 ) { - spacing[i] = 1.0*vcl_pow((double)2, (double)m_FilenameHelper->GetResolutionFactor()); + spacing[i] = 1.0*std::pow((double)2, (double)m_FilenameHelper->GetResolutionFactor()); } else { @@ -460,19 +460,19 @@ ImageFileReader<TOutputImage, ConvertPixelTraits> resolution); double idSpacing = 1.0; if (resolution != 0) - idSpacing = 1.0 * vcl_pow((double)2.0, (double)resolution); + idSpacing = 1.0 * std::pow((double)2.0, (double)resolution); std::cout << "?" << std::endl; - std::cout << vcl_abs(origin[0] - 0.5 * spacing[0]) << std::endl; - std::cout << vcl_abs(origin[1] - 0.5 * spacing[1]) << std::endl; - std::cout << vcl_abs(spacing[0] - idSpacing) << std::endl; - std::cout << vcl_abs(spacing[1] - idSpacing) << std::endl; + std::cout << std::abs(origin[0] - 0.5 * spacing[0]) << std::endl; + std::cout << std::abs(origin[1] - 0.5 * spacing[1]) << std::endl; + std::cout << std::abs(spacing[0] - idSpacing) << std::endl; + std::cout << std::abs(spacing[1] - idSpacing) << std::endl; const double epsilon = 1.0E-12; if ( projRef.empty() - && vcl_abs(origin[0] - 0.5 * spacing[0]) > epsilon - && vcl_abs(origin[1] - 0.5 * spacing[1]) > epsilon - && (vcl_abs(spacing[0] - idSpacing) > epsilon - && vcl_abs(spacing[1] - idSpacing) > epsilon)) + && std::abs(origin[0] - 0.5 * spacing[0]) > epsilon + && std::abs(origin[1] - 0.5 * spacing[1]) > epsilon + && (std::abs(spacing[0] - idSpacing) > epsilon + && std::abs(spacing[1] - idSpacing) > epsilon)) { std::cout << "Force the projection ref" << std::endl; std::string wgs84ProjRef = diff --git a/Modules/IO/ImageIO/test/otbComplexImageManipulationTest.cxx b/Modules/IO/ImageIO/test/otbComplexImageManipulationTest.cxx index 974741aa0495c311b5ddc375784ac0099d2b9659..ad9d273c42297afcb7db47db2b01677a6310e2dd 100644 --- a/Modules/IO/ImageIO/test/otbComplexImageManipulationTest.cxx +++ b/Modules/IO/ImageIO/test/otbComplexImageManipulationTest.cxx @@ -37,7 +37,7 @@ bool IsEqual(TPixel output, TPixel expected) RealType outputReal = static_cast<RealType>(output); RealType expectedReal = static_cast<RealType>(expected); // avoid division by zero - return outputReal == expectedReal || (vcl_abs(expectedReal - outputReal) / vcl_abs(expectedReal) < Epsilon); + return outputReal == expectedReal || (std::abs(expectedReal - outputReal) / std::abs(expectedReal) < Epsilon); } template<class TPixel> @@ -50,7 +50,7 @@ bool IsEqual(std::complex<TPixel> output, std::complex<TPixel> expected) RealType expectedReal( static_cast<ScalarRealType>(expected.real()), static_cast<ScalarRealType>(expected.imag()) ); // avoid division by zero - return outputReal == expectedReal || (vcl_abs(expectedReal - outputReal) / vcl_abs(expectedReal) < Epsilon); + return outputReal == expectedReal || (std::abs(expectedReal - outputReal) / std::abs(expectedReal) < Epsilon); } template<class TInternalPixel> @@ -202,7 +202,7 @@ int otbMonobandComplexToImageScalarGeneric(int itkNotUsed(argc), char * argv[]) ComplexType expected = ComplexType(count, count+1); RealType expectedReal( static_cast<ScalarRealType>(expected.real()), static_cast<ScalarRealType>(expected.imag()) ); - if ( !TestCompare(it.GetIndex(), it.Get(), static_cast<InputType>(vcl_abs(expectedReal)) ) ) + if ( !TestCompare(it.GetIndex(), it.Get(), static_cast<InputType>(std::abs(expectedReal)) ) ) return EXIT_FAILURE; } diff --git a/Modules/IO/KMZWriter/include/otbKmzProductWriter.hxx b/Modules/IO/KMZWriter/include/otbKmzProductWriter.hxx index caa8e518b899bf5dcc7369c3af21d08347287c46..de52f10d3b909ac8634235cf5e83db958a8d8a73 100644 --- a/Modules/IO/KMZWriter/include/otbKmzProductWriter.hxx +++ b/Modules/IO/KMZWriter/include/otbKmzProductWriter.hxx @@ -288,8 +288,8 @@ KmzProductWriter<TInputImage> // Compute max depth unsigned int maxDepth = - static_cast<unsigned int>(std::max(vcl_ceil(vcl_log(static_cast<float>(sizeX) / static_cast<float>(m_TileSize)) / vcl_log(2.0)), - vcl_ceil(vcl_log(static_cast<float>(sizeY) / static_cast<float>(m_TileSize)) / vcl_log(2.0)))); + static_cast<unsigned int>(std::max(std::ceil(std::log(static_cast<float>(sizeX) / static_cast<float>(m_TileSize)) / std::log(2.0)), + std::ceil(std::log(static_cast<float>(sizeY) / static_cast<float>(m_TileSize)) / std::log(2.0)))); m_MaxDepth = maxDepth; m_CurIdx = 0; @@ -298,7 +298,7 @@ KmzProductWriter<TInputImage> for (unsigned int i = 0; i <= maxDepth; ++i) { - unsigned int ratio = static_cast<unsigned int>(vcl_pow(2.,static_cast<int>((static_cast<int>(maxDepth) - i)))); + unsigned int ratio = static_cast<unsigned int>(std::pow(2.,static_cast<int>((static_cast<int>(maxDepth) - i)))); nbTile += (((sizeX / ratio) / m_TileSize) + 1) * (((sizeY / ratio) / m_TileSize) + 1); } diff --git a/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx b/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx index a74038f9260d2dce660ecfa18d38d7c8504964fe..e4512b93103330537cb788cb63c61846bd141f6e 100644 --- a/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx +++ b/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx @@ -229,14 +229,14 @@ DifferenceImageFilter<TInputImage, TOutputImage> } //for complex and vector type. FIXME: module might be better -// ScalarRealType tMax=vcl_abs(t[0]); +// ScalarRealType tMax=std::abs(t[0]); ScalarRealType tMax = 0.01; //Avoiding the 0 case for neighborhood computing // NB: still more restrictive than before for small values. for (unsigned int j = 0; j < itk::NumericTraits<InputPixelType>::GetLength(t); ++j) { ScalarRealType tc = static_cast<ScalarRealType>( itk::DefaultConvertPixelTraits<InputPixelType>::GetNthComponent(j,t)); - if (vcl_abs(tc) > tMax) tMax = vcl_abs(tc); + if (std::abs(tc) > tMax) tMax = std::abs(tc); } // Check if difference is above threshold diff --git a/Modules/IO/TestKernel/src/otbTestHelper.cxx b/Modules/IO/TestKernel/src/otbTestHelper.cxx index df603c78aad651e9cb2aa42ff4b5bb0e9594ee22..e7f3c1b4b979bfb19108e46a377e65b0b875f1a7 100644 --- a/Modules/IO/TestKernel/src/otbTestHelper.cxx +++ b/Modules/IO/TestKernel/src/otbTestHelper.cxx @@ -864,9 +864,9 @@ int TestHelper::RegressionTestDiffFile(const char * testAsciiFileName, const cha if (isRefTokenNum && isTestTokenNum) { // test difference against epsilon - vNorm = (vcl_abs(vRef) + vcl_abs(vTest)) * 0.5; + vNorm = (std::abs(vRef) + std::abs(vTest)) * 0.5; if ((vNorm <= m_EpsilonBoundaryChecking) //make sure that either the test of the ref are non 0 - || (vcl_abs(vRef-vTest) <= epsilon * vNorm)) //epsilon as relative error + || (std::abs(vRef-vTest) <= epsilon * vNorm)) //epsilon as relative error { // these tokens are equivalent areTokensEquivalent = true; @@ -2357,16 +2357,16 @@ bool TestHelper::CompareLines(const std::string& strfileref, { float vRef = atof(strRef.c_str()); float vTest = atof(strTest.c_str()); - float vNorm = (vcl_abs(vRef) + vcl_abs(vTest))/2; + float vNorm = (std::abs(vRef) + std::abs(vTest))/2; //otbMsgDevMacro(<< "numerical comparison: " <<vRef << " vs " <<vTest << " -> " - // << "vNorm= " << vNorm << ", " << vcl_abs(vRef-vTest) << " > "<< epsilon * vNorm - // << "? -> " << (vcl_abs(vRef-vTest) > epsilon * vNorm )); + // << "vNorm= " << vNorm << ", " << std::abs(vRef-vTest) << " > "<< epsilon * vNorm + // << "? -> " << (std::abs(vRef-vTest) > epsilon * vNorm )); if ((vNorm > m_EpsilonBoundaryChecking) //make sure that either the test of the ref are non 0 - && (vcl_abs(vRef-vTest) > epsilon * vNorm)) //epsilon as relative error + && (std::abs(vRef-vTest) > epsilon * vNorm)) //epsilon as relative error { if (m_ReportErrors) { - fluxfilediff << "Diff at line " << numLine << " : vcl_abs ( (" << strRef << ") - (" << strTest + fluxfilediff << "Diff at line " << numLine << " : std::abs ( (" << strRef << ") - (" << strTest << ") ) > " << epsilon << std::endl; differenceFoundInCurrentLine = true; } @@ -2417,13 +2417,13 @@ bool TestHelper::CompareLines(const std::string& strfileref, else if ((etatCour == ETAT_CHAR) && (etatPrec == ETAT_NUM)) { - if ((strNumRef != strNumTest) && (vcl_abs(atof(strNumRef.c_str())) > m_EpsilonBoundaryChecking) - && (vcl_abs(atof(strNumRef.c_str()) - atof(strNumTest.c_str())) - > epsilon * vcl_abs(atof(strNumRef.c_str())))) //epsilon as relative error + if ((strNumRef != strNumTest) && (std::abs(atof(strNumRef.c_str())) > m_EpsilonBoundaryChecking) + && (std::abs(atof(strNumRef.c_str()) - atof(strNumTest.c_str())) + > epsilon * std::abs(atof(strNumRef.c_str())))) //epsilon as relative error { if (m_ReportErrors) { - fluxfilediff << "Diff at line " << numLine << " : vcl_abs ( (" << strNumRef << ") - (" + fluxfilediff << "Diff at line " << numLine << " : std::abs ( (" << strNumRef << ") - (" << strNumTest << ") ) > " << epsilon << std::endl; differenceFoundInCurrentLine = true; } @@ -2468,13 +2468,13 @@ bool TestHelper::CompareLines(const std::string& strfileref, } else { - if ((strNumRef != strNumTest) && (vcl_abs(atof(strNumRef.c_str())) > m_EpsilonBoundaryChecking) - && (vcl_abs(atof(strNumRef.c_str()) - atof(strNumTest.c_str())) - > epsilon * vcl_abs(atof(strNumRef.c_str())))) //epsilon as relative error + if ((strNumRef != strNumTest) && (std::abs(atof(strNumRef.c_str())) > m_EpsilonBoundaryChecking) + && (std::abs(atof(strNumRef.c_str()) - atof(strNumTest.c_str())) + > epsilon * std::abs(atof(strNumRef.c_str())))) //epsilon as relative error { if (m_ReportErrors) { - fluxfilediff << "Diff at line " << numLine << " : vcl_abs( (" << strNumRef << ") - (" << strNumTest + fluxfilediff << "Diff at line " << numLine << " : std::abs( (" << strNumRef << ") - (" << strNumTest << ") ) > " << epsilon << std::endl; differenceFoundInCurrentLine = true; } diff --git a/Modules/Learning/DempsterShafer/test/otbJointMassOfBeliefFilter.cxx b/Modules/Learning/DempsterShafer/test/otbJointMassOfBeliefFilter.cxx index a726dcac89e080bb909a977a28cf9d932e11c164..bdaea72f1a69633fd5cd80336a3490d05aa679eb 100644 --- a/Modules/Learning/DempsterShafer/test/otbJointMassOfBeliefFilter.cxx +++ b/Modules/Learning/DempsterShafer/test/otbJointMassOfBeliefFilter.cxx @@ -100,7 +100,7 @@ int otbJointMassOfBeliefFilter(int itkNotUsed(argc), char* itkNotUsed(argv)[]) for (unsigned int i=0; i<baseline.size(); ++i) { - if (vcl_abs(baseline[i] - results[i]) >= .000001) + if (std::abs(baseline[i] - results[i]) >= .000001) { std::cout << "Non-regression test [" << i << "] failed: " << "baseline[i](" << baseline[i] diff --git a/Modules/Learning/Markov/include/otbMRFEnergyFisherClassification.h b/Modules/Learning/Markov/include/otbMRFEnergyFisherClassification.h index 5950ad20463eb58a812258ebc738a72dcbe9235e..8c5c33ae3c868a9d4de64874e327989af76b8257 100644 --- a/Modules/Learning/Markov/include/otbMRFEnergyFisherClassification.h +++ b/Modules/Learning/Markov/include/otbMRFEnergyFisherClassification.h @@ -77,10 +77,10 @@ public: double l = this->m_Parameters[3*value2+1]; double m = this->m_Parameters[3*value2+2]; - double result = -vcl_log((boost::math::tgamma(l+m)/(boost::math::tgamma(l)*boost::math::tgamma(m))) - * (2/(mu)) * (vcl_sqrt(l/m)) * - ((vcl_pow((vcl_sqrt(l/m)*(val1/mu)), ((2*l)-1))) / - (vcl_pow(1+(vcl_sqrt(l/m)*(val1/mu)*vcl_sqrt(l/m)*(val1/mu)), (l+m))))); + double result = -std::log((boost::math::tgamma(l+m)/(boost::math::tgamma(l)*boost::math::tgamma(m))) + * (2/(mu)) * (std::sqrt(l/m)) * + ((std::pow((std::sqrt(l/m)*(val1/mu)), ((2*l)-1))) / + (std::pow(1+(std::sqrt(l/m)*(val1/mu)*std::sqrt(l/m)*(val1/mu)), (l+m))))); return result; } diff --git a/Modules/Learning/Markov/include/otbMRFEnergyGaussianClassification.h b/Modules/Learning/Markov/include/otbMRFEnergyGaussianClassification.h index 1864da2897112f894039ddb8213557012b2f1ef4..f2e160ec09b45655bb95017fbbee9bc38d0be439 100644 --- a/Modules/Learning/Markov/include/otbMRFEnergyGaussianClassification.h +++ b/Modules/Learning/Markov/include/otbMRFEnergyGaussianClassification.h @@ -81,7 +81,7 @@ public: double result = vnl_math_sqr(val1 - this->m_Parameters[2 * static_cast<int>(value2)]) / (2 * vnl_math_sqr(this->m_Parameters[2 * static_cast<int>(value2) + 1])) - + vcl_log(vcl_sqrt(CONST_2PI) * this->m_Parameters[2 * static_cast<int>(value2) + 1]); + + std::log(std::sqrt(CONST_2PI) * this->m_Parameters[2 * static_cast<int>(value2) + 1]); return static_cast<double>(result); } diff --git a/Modules/Learning/Markov/include/otbMRFOptimizerMetropolis.h b/Modules/Learning/Markov/include/otbMRFOptimizerMetropolis.h index f188046bedc75fa776186f26e54592409b402ae8..ecc753cc4a8b0c3f5aa75009e6a8eefafba0c64f 100644 --- a/Modules/Learning/Markov/include/otbMRFOptimizerMetropolis.h +++ b/Modules/Learning/Markov/include/otbMRFOptimizerMetropolis.h @@ -84,7 +84,7 @@ public: } else { - double proba = vcl_exp(-(deltaEnergy) / this->m_Parameters[0]); + double proba = std::exp(-(deltaEnergy) / this->m_Parameters[0]); if ((m_Generator->GetIntegerVariate() % 10000) < proba * 10000) { return true; diff --git a/Modules/Learning/Markov/include/otbMRFSamplerRandomMAP.h b/Modules/Learning/Markov/include/otbMRFSamplerRandomMAP.h index c2c94fa5e9855737696b3b9129acd6e20b8e9bc7..f24d6f03a9c482164335c6a042d14063375fccad 100644 --- a/Modules/Learning/Markov/include/otbMRFSamplerRandomMAP.h +++ b/Modules/Learning/Markov/include/otbMRFSamplerRandomMAP.h @@ -112,7 +112,7 @@ public: valueCurrent)); m_Energy[valueCurrent] = this->m_EnergyCurrent; - m_RepartitionFunction[valueCurrent] = vcl_exp(-this->m_EnergyCurrent) + totalProba; + m_RepartitionFunction[valueCurrent] = std::exp(-this->m_EnergyCurrent) + totalProba; totalProba = m_RepartitionFunction[valueCurrent]; } diff --git a/Modules/Learning/SOM/include/otbCzihoSOMLearningBehaviorFunctor.h b/Modules/Learning/SOM/include/otbCzihoSOMLearningBehaviorFunctor.h index 6530bf42c7798a8b101417aceae35a2ba25f0f1e..60243d8ab476b5f95dd6fb022161e42331713924 100644 --- a/Modules/Learning/SOM/include/otbCzihoSOMLearningBehaviorFunctor.h +++ b/Modules/Learning/SOM/include/otbCzihoSOMLearningBehaviorFunctor.h @@ -88,7 +88,7 @@ public: } m_IterationThreshold = static_cast<unsigned int>( - static_cast<double>(iterMax) * (1.0 - 1.0 / ::vcl_sqrt(V0))); + static_cast<double>(iterMax) * (1.0 - 1.0 / ::std::sqrt(V0))); } /** Functor */ diff --git a/Modules/Learning/SOM/include/otbCzihoSOMNeighborhoodBehaviorFunctor.h b/Modules/Learning/SOM/include/otbCzihoSOMNeighborhoodBehaviorFunctor.h index 038bce5ab7ca05730b0492d5ba9a381d9be41615..c1bf4ff4c1dda0e7ea4d5feea28a2f4156f91d83 100644 --- a/Modules/Learning/SOM/include/otbCzihoSOMNeighborhoodBehaviorFunctor.h +++ b/Modules/Learning/SOM/include/otbCzihoSOMNeighborhoodBehaviorFunctor.h @@ -67,7 +67,7 @@ public: const itk::Size<VDimension>& sizeInit) const { itk::Size<VDimension> theSize; - double weightening = ::vcl_pow(1.0 + double weightening = ::std::pow(1.0 - static_cast<double>(currentIteration) / static_cast<double>(numberOfIterations), 2.0); diff --git a/Modules/Learning/Sampling/src/otbSamplingRateCalculator.cxx b/Modules/Learning/Sampling/src/otbSamplingRateCalculator.cxx index 86de38dfb0c5d8c596a1b0f73576c49b1d4200d3..f3adfd2361c68238d8f4c457658038b6981124a3 100644 --- a/Modules/Learning/Sampling/src/otbSamplingRateCalculator.cxx +++ b/Modules/Learning/Sampling/src/otbSamplingRateCalculator.cxx @@ -136,7 +136,7 @@ void SamplingRateCalculator MapRateType::iterator it = m_RatesByClass.begin(); for (; it != m_RatesByClass.end() ; ++it) { - it->second.Required = static_cast<unsigned long>(vcl_floor(0.5+percent * it->second.Tot)); + it->second.Required = static_cast<unsigned long>(std::floor(0.5+percent * it->second.Tot)); it->second.Rate = percent; } } diff --git a/Modules/Learning/Sampling/src/otbSamplingRateCalculatorList.cxx b/Modules/Learning/Sampling/src/otbSamplingRateCalculatorList.cxx index eeba0c27361dc1834e54e5f4da1b467c2f8a7932..95866c121c4b0fa79bd86287cf22fde87df30ea2 100644 --- a/Modules/Learning/Sampling/src/otbSamplingRateCalculatorList.cxx +++ b/Modules/Learning/Sampling/src/otbSamplingRateCalculatorList.cxx @@ -155,7 +155,7 @@ SamplingRateCalculatorList it->second > 0UL) { unsigned long curTotal = (curIt->second).Tot; - needed[it->first] = static_cast<unsigned long>(vcl_floor( + needed[it->first] = static_cast<unsigned long>(std::floor( static_cast<double>(nb[0]) * static_cast<double>(curTotal) / static_cast<double>(it->second))); @@ -174,7 +174,7 @@ SamplingRateCalculatorList for (unsigned int i=0 ; i<this->Size() ; i++) { this->GetNthElement(i)->SetNbOfSamplesAllClasses( - static_cast<unsigned long>(vcl_floor( + static_cast<unsigned long>(std::floor( (double)nb[0] / (double)this->Size()))); } break; @@ -226,7 +226,7 @@ SamplingRateCalculatorList it->second > 0UL) { unsigned long curTotal = (curIt->second).Tot; - needed[it->first] = static_cast<unsigned long>(vcl_floor( + needed[it->first] = static_cast<unsigned long>(std::floor( static_cast<double>(inputIt->second) * static_cast<double>(curTotal) / static_cast<double>(it->second))); @@ -255,7 +255,7 @@ SamplingRateCalculatorList it->second > 0UL) { unsigned long curTotal = (curIt->second).Tot; - unsigned long curNeeded = static_cast<unsigned long>(vcl_floor( + unsigned long curNeeded = static_cast<unsigned long>(std::floor( static_cast<double>(inputIt->second) / static_cast<double>(this->Size()))); needed[it->first] = std::min(curTotal,curNeeded); @@ -315,7 +315,7 @@ SamplingRateCalculatorList needed.clear(); for (it = m_GlobalCountMap.begin(); it != m_GlobalCountMap.end() ; ++it) { - needed[it->first]=static_cast<unsigned long>(vcl_floor(0.5 + it->second * p[0] / (double)this->Size())); + needed[it->first]=static_cast<unsigned long>(std::floor(0.5 + it->second * p[0] / (double)this->Size())); } @@ -381,7 +381,7 @@ SamplingRateCalculatorList { if (total_nb_samples != 0) { - this->GetNthElement(i)->SetTotalNumberOfSamples(vcl_floor(0.5+tot[0]*nb_samples[i]/static_cast<double>(total_nb_samples))); + this->GetNthElement(i)->SetTotalNumberOfSamples(std::floor(0.5+tot[0]*nb_samples[i]/static_cast<double>(total_nb_samples))); } else { @@ -398,7 +398,7 @@ SamplingRateCalculatorList if (sampleListSize != 0) { - total_by_image = static_cast<unsigned long>(vcl_floor(tot[0]/static_cast<double>(sampleListSize))); + total_by_image = static_cast<unsigned long>(std::floor(tot[0]/static_cast<double>(sampleListSize))); } for (unsigned int i=0 ; i<sampleListSize ; i++) diff --git a/Modules/Learning/Supervised/include/otbConfusionMatrixMeasurements.hxx b/Modules/Learning/Supervised/include/otbConfusionMatrixMeasurements.hxx index 257cff8ab3f301d9ad518ddf77fdbbbc2ac2a959..9a697b507bbf5c70ae44cb3b84d05192002ffd7e 100644 --- a/Modules/Learning/Supervised/include/otbConfusionMatrixMeasurements.hxx +++ b/Modules/Learning/Supervised/include/otbConfusionMatrixMeasurements.hxx @@ -122,9 +122,9 @@ ConfusionMatrixMeasurements<TConfusionMatrix, TLabel> if (m_NumberOfSamples > 0) { this->m_OverallAccuracy /= static_cast<double>(m_NumberOfSamples); - luckyRate /= vcl_pow(m_NumberOfSamples, 2.0); + luckyRate /= std::pow(m_NumberOfSamples, 2.0); - if (vcl_abs(1 - luckyRate) > epsilon) + if (std::abs(1 - luckyRate) > epsilon) { m_KappaIndex = (m_OverallAccuracy - luckyRate) / (1 - luckyRate); } @@ -143,19 +143,19 @@ ConfusionMatrixMeasurements<TConfusionMatrix, TLabel> for (unsigned int i = 0; i < m_NumberOfClasses; ++i) { - if (vcl_abs(this->m_TruePositiveValues[i] + this->m_FalsePositiveValues[i]) > epsilon) + if (std::abs(this->m_TruePositiveValues[i] + this->m_FalsePositiveValues[i]) > epsilon) { this->m_Precisions[i] = this->m_TruePositiveValues[i] / (this->m_TruePositiveValues[i] + this->m_FalsePositiveValues[i]); } - if (vcl_abs(this->m_TruePositiveValues[i] + this->m_FalseNegativeValues[i]) > epsilon) + if (std::abs(this->m_TruePositiveValues[i] + this->m_FalseNegativeValues[i]) > epsilon) { this->m_Recalls[i] = this->m_TruePositiveValues[i] / (this->m_TruePositiveValues[i] + this->m_FalseNegativeValues[i]); } - if (vcl_abs(this->m_Recalls[i] + this->m_Precisions[i]) > epsilon) + if (std::abs(this->m_Recalls[i] + this->m_Precisions[i]) > epsilon) { this->m_FScores[i] = 2 * this->m_Recalls[i] * this->m_Precisions[i] / (this->m_Recalls[i] + this->m_Precisions[i]); @@ -165,15 +165,15 @@ ConfusionMatrixMeasurements<TConfusionMatrix, TLabel> if (m_NumberOfClasses == 2) { - if (vcl_abs(this->m_TruePositiveValue + this->m_FalsePositiveValue) > epsilon) + if (std::abs(this->m_TruePositiveValue + this->m_FalsePositiveValue) > epsilon) { this->m_Precision = this->m_TruePositiveValue / (this->m_TruePositiveValue + this->m_FalsePositiveValue); } - if (vcl_abs(this->m_TruePositiveValue + this->m_FalseNegativeValue) > epsilon) + if (std::abs(this->m_TruePositiveValue + this->m_FalseNegativeValue) > epsilon) { this->m_Recall = this->m_TruePositiveValue / (this->m_TruePositiveValue + this->m_FalseNegativeValue); } - if (vcl_abs(this->m_Recall + this->m_Precision) > epsilon) + if (std::abs(this->m_Recall + this->m_Precision) > epsilon) { this->m_FScore = 2 * this->m_Recall * this->m_Precision / (this->m_Recall + this->m_Precision); } diff --git a/Modules/Learning/Supervised/include/otbSVMMarginSampler.hxx b/Modules/Learning/Supervised/include/otbSVMMarginSampler.hxx index f7d28484bcacd7015e79b3faef71cdfe75b4f92f..2d3924a42b018f3a30471dc7a0f9630dad87a56f 100644 --- a/Modules/Learning/Supervised/include/otbSVMMarginSampler.hxx +++ b/Modules/Learning/Supervised/include/otbSVMMarginSampler.hxx @@ -100,14 +100,14 @@ SVMMarginSampler< TSample, TModel > // Get distances to the hyperplanes m_Model->Predict(modelMeasurement, &(hdistances[0])); - double minDistance = vcl_abs(hdistances[0]); + double minDistance = std::abs(hdistances[0]); // Compute th min distances for(unsigned int j = 1; j<hdistances.size(); ++j) { - if(vcl_abs(hdistances[j])<minDistance) + if(std::abs(hdistances[j])<minDistance) { - minDistance = vcl_abs(hdistances[j]); + minDistance = std::abs(hdistances[j]); } } // Keep index and min distance diff --git a/Modules/Learning/Supervised/src/otbExhaustiveExponentialOptimizer.cxx b/Modules/Learning/Supervised/src/otbExhaustiveExponentialOptimizer.cxx index 98ddb84c6f1cbd5959be91944c78f25a6e4edd9c..251512fbd5985e13316d04eefe6743875e89cef1 100644 --- a/Modules/Learning/Supervised/src/otbExhaustiveExponentialOptimizer.cxx +++ b/Modules/Learning/Supervised/src/otbExhaustiveExponentialOptimizer.cxx @@ -97,7 +97,7 @@ ExhaustiveExponentialOptimizer for (unsigned int i = 0; i < spaceDimension; ++i) { position[i] = this->GetInitialPosition()[i] * - vcl_pow(m_GeometricProgression, -static_cast<double>(m_NumberOfSteps[i]) * m_StepLength) * scales[i]; + std::pow(m_GeometricProgression, -static_cast<double>(m_NumberOfSteps[i]) * m_StepLength) * scales[i]; } this->SetCurrentPosition(position); @@ -208,7 +208,7 @@ ExhaustiveExponentialOptimizer { newPosition[i] = this->GetInitialPosition()[i] * this->GetScales()[i] - * vcl_pow(m_GeometricProgression, + * std::pow(m_GeometricProgression, static_cast<double>(m_CurrentIndex[i] - m_NumberOfSteps[i]) * m_StepLength); } } diff --git a/Modules/Learning/Supervised/test/0000209-SVMValidationLinearlySeparableProbEstimation.cxx b/Modules/Learning/Supervised/test/0000209-SVMValidationLinearlySeparableProbEstimation.cxx index 5394d793ed7b82d62cb7c3d7d231a5053c724c53..b3999e8fca63caf353c31a4da7e6dfab8bf417d0 100644 --- a/Modules/Learning/Supervised/test/0000209-SVMValidationLinearlySeparableProbEstimation.cxx +++ b/Modules/Learning/Supervised/test/0000209-SVMValidationLinearlySeparableProbEstimation.cxx @@ -104,8 +104,8 @@ int main(int argc, char* argv[]) double angle = random->GetVariateWithOpenUpperRange( otb::CONST_2PI ); double radius = random->GetUniformVariate(prmin, prmax); SampleType pSample(2); - pSample[0] = cpx+radius*vcl_sin(angle); - pSample[1] = cpy+radius*vcl_cos(angle); + pSample[0] = cpx+radius*std::sin(angle); + pSample[1] = cpy+radius*std::cos(angle); TrainingSampleType label; label[0]=1; trainingSamples->PushBack(pSample); @@ -117,8 +117,8 @@ int main(int argc, char* argv[]) angle = random->GetVariateWithOpenUpperRange( otb::CONST_2PI ); radius = random->GetUniformVariate(nrmin, nrmax); SampleType nSample(2); - nSample[0] = cnx+radius*vcl_sin(angle); - nSample[1] = cny+radius*vcl_cos(angle); + nSample[0] = cnx+radius*std::sin(angle); + nSample[1] = cny+radius*std::cos(angle); label[0]=2; trainingSamples->PushBack(nSample); trainingLabels->PushBack(label); @@ -137,8 +137,8 @@ int main(int argc, char* argv[]) double angle = random->GetVariateWithOpenUpperRange( otb::CONST_2PI ); double radius = random->GetUniformVariate(prmin, prmax); SampleType pSample(2); - pSample[0] = cpx+radius*vcl_sin(angle); - pSample[1] = cpy+radius*vcl_cos(angle); + pSample[0] = cpx+radius*std::sin(angle); + pSample[1] = cpy+radius*std::cos(angle); TrainingSampleType label; label[0]=1; validationSamples->PushBack(pSample); @@ -149,8 +149,8 @@ int main(int argc, char* argv[]) angle = random->GetVariateWithOpenUpperRange( otb::CONST_2PI ); radius = random->GetUniformVariate(nrmin, nrmax); SampleType nSample(2); - nSample[0] = cnx+radius*vcl_sin(angle); - nSample[1] = cny+radius*vcl_cos(angle); + nSample[0] = cnx+radius*std::sin(angle); + nSample[1] = cny+radius*std::cos(angle); label[0]=2; validationSamples->PushBack(nSample); validationLabels->PushBack(label); diff --git a/Modules/Learning/Supervised/test/otbConfusionMatrixCalculatorTest.cxx b/Modules/Learning/Supervised/test/otbConfusionMatrixCalculatorTest.cxx index 211eaf300b66c2ee2b5ecd02e94403f1f5ba58b4..3c1102d8bffe4ec042085107763adb45aaa2c843 100644 --- a/Modules/Learning/Supervised/test/otbConfusionMatrixCalculatorTest.cxx +++ b/Modules/Learning/Supervised/test/otbConfusionMatrixCalculatorTest.cxx @@ -270,7 +270,7 @@ int otbConfusionMatrixCalculatorCompute(int argc, char* argv[]) const double oa = 3 / static_cast<double>(nbSamples); - if (vcl_abs (calculator->GetOverallAccuracy() - oa) > 0.000001) + if (std::abs (calculator->GetOverallAccuracy() - oa) > 0.000001) { return EXIT_FAILURE; } diff --git a/Modules/Learning/Supervised/test/otbTrainMachineLearningModel.cxx b/Modules/Learning/Supervised/test/otbTrainMachineLearningModel.cxx index dd34b41b8b3a4f9711530f99892f5780515e2566..319169c79e0df7439712bf8c591d68a74e94f601 100644 --- a/Modules/Learning/Supervised/test/otbTrainMachineLearningModel.cxx +++ b/Modules/Learning/Supervised/test/otbTrainMachineLearningModel.cxx @@ -117,7 +117,7 @@ int otbLibSVMMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -206,7 +206,7 @@ int otbSVMMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -274,7 +274,7 @@ int otbSVMMachineLearningRegressionModel(int argc, char * argv[]) const float age = 15; - if ( vcl_abs(age - predicted->GetMeasurementVector(0)[0]) <= 0.3 ) + if ( std::abs(age - predicted->GetMeasurementVector(0)[0]) <= 0.3 ) { return EXIT_SUCCESS; } @@ -352,7 +352,7 @@ int otbKNearestNeighborsMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -438,7 +438,7 @@ int otbRandomForestsMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -524,7 +524,7 @@ int otbBoostMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -614,7 +614,7 @@ int otbANNMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -691,7 +691,7 @@ int otbNormalBayesMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -768,7 +768,7 @@ int otbDecisionTreeMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -846,7 +846,7 @@ int otbGradientBoostedTreeMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } @@ -958,7 +958,7 @@ int otbSharkRFMachineLearningModel(int argc, char * argv[]) std::cout<<"Overall Accuracy: "<<cmCalculatorLoad->GetOverallAccuracy()<<std::endl; - if ( vcl_abs(kappaIdxLoad - kappaIdx) < 0.00000001) + if ( std::abs(kappaIdxLoad - kappaIdx) < 0.00000001) { return EXIT_SUCCESS; } diff --git a/Modules/OBIA/RCC8/include/otbPolygonListToRCC8GraphFilter.hxx b/Modules/OBIA/RCC8/include/otbPolygonListToRCC8GraphFilter.hxx index b42cd634ab514fff1f2d045de9f1e362d7978ff2..3ce86462645e85de99aa354707628accc31b04eb 100644 --- a/Modules/OBIA/RCC8/include/otbPolygonListToRCC8GraphFilter.hxx +++ b/Modules/OBIA/RCC8/include/otbPolygonListToRCC8GraphFilter.hxx @@ -423,12 +423,12 @@ PolygonListToRCC8GraphFilter<TPolygonList, TOutputGraph> // Split the adjacency matrix in strip of equal dimension start = - static_cast<unsigned int>(vcl_floor(total * - vcl_sqrt(static_cast<double>(threadId) / + static_cast<unsigned int>(std::floor(total * + std::sqrt(static_cast<double>(threadId) / static_cast<double>(threadCount)) + 0.5)); stop = - static_cast<unsigned int>(vcl_floor(total * - vcl_sqrt(static_cast<double>(threadId + + static_cast<unsigned int>(std::floor(total * + std::sqrt(static_cast<double>(threadId + 1) / static_cast<double>(threadCount)) + 0.5)); if (stop > total) stop = total; diff --git a/Modules/Radiometry/Indices/include/otbSoilIndicesFunctor.h b/Modules/Radiometry/Indices/include/otbSoilIndicesFunctor.h index 6ed1b201c05e31eaab18124c409fb96e12584688..264ad063f1d5e7127aa875a811f1c86a07fb646a 100644 --- a/Modules/Radiometry/Indices/include/otbSoilIndicesFunctor.h +++ b/Modules/Radiometry/Indices/include/otbSoilIndicesFunctor.h @@ -302,7 +302,7 @@ protected: { double dGreen = static_cast<double>(pGreen); double dRed = static_cast<double>(pRed); - if (vcl_abs(dGreen) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(dGreen) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -345,7 +345,7 @@ protected: { double dGreen = static_cast<double>(pGreen); double dRed = static_cast<double>(pRed); - if (vcl_abs(dGreen + dRed) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(dGreen + dRed) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -385,7 +385,7 @@ protected: double dGreen = static_cast<double>(pGreen); double dRed = static_cast<double>(pRed); - return (static_cast<TOutput>(vcl_sqrt((dRed * dRed + dGreen * dGreen) / 2.))); + return (static_cast<TOutput>(std::sqrt((dRed * dRed + dGreen * dGreen) / 2.))); } }; @@ -421,7 +421,7 @@ protected: double dRed = static_cast<double>(pRed); double dNir = static_cast<double>(pNir); - return (static_cast<TOutput>(vcl_sqrt((dRed * dRed + dGreen * dGreen + dNir * dNir) / 3.))); + return (static_cast<TOutput>(std::sqrt((dRed * dRed + dGreen * dGreen + dNir * dNir) / 3.))); } }; diff --git a/Modules/Radiometry/Indices/include/otbVegetationIndicesFunctor.h b/Modules/Radiometry/Indices/include/otbVegetationIndicesFunctor.h index a83cc354d7278a46128f7e9e99f9081f0a62b999..ab264c0dfce4a634cffe4a31c5db3fccbaf47222 100644 --- a/Modules/Radiometry/Indices/include/otbVegetationIndicesFunctor.h +++ b/Modules/Radiometry/Indices/include/otbVegetationIndicesFunctor.h @@ -429,7 +429,7 @@ protected: { double dr = static_cast<double>(r); double dnir = static_cast<double>(nir); - if (vcl_abs(dnir + dr) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(dnir + dr) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -466,7 +466,7 @@ protected: { double dr = static_cast<double>(r); double dnir = static_cast<double>(nir); - if (vcl_abs(dr) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(dr) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -504,7 +504,7 @@ public: void SetA(const double A) { m_A = A; - m_Coeff = 1. / (vcl_sqrt(m_A * m_A + 1.)); + m_Coeff = 1. / (std::sqrt(m_A * m_A + 1.)); } double GetA(void) const { @@ -576,7 +576,7 @@ protected: double dnir = static_cast<double>(nir); double dr = static_cast<double>(r); double denominator = dnir + dr + m_L; - if (vcl_abs(denominator) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(denominator) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -647,7 +647,7 @@ protected: double dnir = static_cast<double>(nir); double dr = static_cast<double>(r); double denominator = m_A * dnir + dr + m_X * (1. + m_A * m_A); - if (vcl_abs(denominator) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(denominator) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -771,7 +771,7 @@ protected: double denominator = dnir + dr + dL; - if (vcl_abs(denominator) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(denominator) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -820,7 +820,7 @@ protected: { return static_cast<TOutput>(0.); } - return (static_cast<TOutput>((2 * dnir + 1 - vcl_sqrt(sqrt_value)) / 2.)); + return (static_cast<TOutput>((2 * dnir + 1 - std::sqrt(sqrt_value)) / 2.)); } }; @@ -857,7 +857,7 @@ protected: double dnu; double dnumerateur_nu; double ddenominateur_nu = dnir + dr + 0.5; - if (vcl_abs(ddenominateur_nu) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(ddenominateur_nu) < this->m_EpsilonToBeConsideredAsZero) { dnu = 0; } @@ -868,7 +868,7 @@ protected: } double ddenominateur_GEMI = 1 - dr; - if (vcl_abs(ddenominateur_GEMI) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(ddenominateur_GEMI) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -939,22 +939,22 @@ protected: double dfact2 = (m_LambdaR - m_LambdaG) / m_LambdaR; double dterm1; double dterm2; - if (vcl_abs(dnir - dr) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(dnir - dr) < this->m_EpsilonToBeConsideredAsZero) { dterm1 = 0; } else { - dterm1 = vcl_atan(dfact1 / (dnir - dr)); + dterm1 = std::atan(dfact1 / (dnir - dr)); } - if (vcl_abs(dg - dr) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(dg - dr) < this->m_EpsilonToBeConsideredAsZero) { dterm2 = 0; } else { - dterm2 = vcl_atan(dfact2 / (dg - dr)); + dterm2 = std::atan(dfact2 / (dg - dr)); } return static_cast<TOutput>(dterm1 + dterm2); @@ -1015,7 +1015,7 @@ protected: double dnir = static_cast<double>(nir); double RHOrb = dr - m_Gamma * (db - dr); double denominator = dnir + RHOrb; - if (vcl_abs(denominator) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(denominator) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -1095,7 +1095,7 @@ protected: double dnir = static_cast<double>(nir); double dRB = dr - m_Gamma * (db - dr); double denominator = dRB + m_A * dnir - m_A * m_B + m_X * (1. + m_A * m_A); - if (vcl_abs(denominator) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(denominator) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -1181,7 +1181,7 @@ protected: double db = static_cast<double>(b); double dnir = static_cast<double>(nir); double denominator = dnir + m_C1 * dr - m_C2 * db + m_L; - if (vcl_abs(denominator) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(denominator) < this->m_EpsilonToBeConsideredAsZero) { return (static_cast<TOutput>(0.)); } @@ -1231,7 +1231,7 @@ protected: { double dr = static_cast<double>(r); double dnir = static_cast<double>(nir); - if (vcl_abs(dnir + dr) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(dnir + dr) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } @@ -1281,7 +1281,7 @@ protected: } else { - return (static_cast<TOutput>(vcl_sqrt(dval))); + return (static_cast<TOutput>(std::sqrt(dval))); } } private: @@ -1361,7 +1361,7 @@ protected: else { return (static_cast<TOutput>( - -(1.0/m_ExtinctionCoefficient)*vcl_log((dval- m_NdviInf)/(m_NdviSoil-m_NdviInf)) + -(1.0/m_ExtinctionCoefficient)*std::log((dval- m_NdviInf)/(m_NdviSoil-m_NdviInf)) )); } } @@ -1483,12 +1483,12 @@ private: double dr = static_cast<double>(r); double dnir = static_cast<double>(nir); - if (vcl_abs(dnir + dr) < this->m_EpsilonToBeConsideredAsZero) + if (std::abs(dnir + dr) < this->m_EpsilonToBeConsideredAsZero) { return static_cast<TOutput>(0.); } - return static_cast<TOutput>(a*(vcl_exp(static_cast<double>(dnir-dr)/static_cast<double>(dr+dnir)*b)-vcl_exp(c*b))); + return static_cast<TOutput>(a*(std::exp(static_cast<double>(dnir-dr)/static_cast<double>(dr+dnir)*b)-std::exp(c*b))); }; diff --git a/Modules/Radiometry/Indices/test/otbLAIFromNDVILogarithmicFunctorTest.cxx b/Modules/Radiometry/Indices/test/otbLAIFromNDVILogarithmicFunctorTest.cxx index f0e3f1ef6bd449c13d7130f8e66164831f17829c..97d66778f5312d50d7816feee7b150ab81d34982 100644 --- a/Modules/Radiometry/Indices/test/otbLAIFromNDVILogarithmicFunctorTest.cxx +++ b/Modules/Radiometry/Indices/test/otbLAIFromNDVILogarithmicFunctorTest.cxx @@ -36,7 +36,7 @@ int otbLAIFromNDVILogarithmic(int itkNotUsed(argc), char * argv[]) double extCoef(::atof(argv[5])); double ndvi = (nirValue-redValue)/(nirValue+redValue); - double goodResult = -1/extCoef*vcl_log((ndvi-ndviInf)/(ndviSoil-ndviInf)); + double goodResult = -1/extCoef*std::log((ndvi-ndviInf)/(ndviSoil-ndviInf)); laiFunct.SetNdviInf(ndviInf); laiFunct.SetNdviSoil(ndviSoil); diff --git a/Modules/Radiometry/OpticalCalibration/include/otbImageToReflectanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbImageToReflectanceImageFilter.h index 8bca51abee384877da358abbf966502471f57767..25e537ff344f2b68434f3549c0566a2e8f31703f 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbImageToReflectanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbImageToReflectanceImageFilter.h @@ -316,7 +316,7 @@ protected: if (m_Day * m_Month != 0 && m_Day < 32 && m_Month < 13) { double dsol = VarSol::GetVarSol(m_Day, m_Month); - coefTemp = vcl_cos(m_ZenithalSolarAngle * CONST_PI_180) * dsol; + coefTemp = std::cos(m_ZenithalSolarAngle * CONST_PI_180) * dsol; } else { @@ -326,7 +326,7 @@ protected: else { coefTemp = - vcl_cos(m_ZenithalSolarAngle * + std::cos(m_ZenithalSolarAngle * CONST_PI_180) * m_FluxNormalizationCoefficient * m_FluxNormalizationCoefficient; } functor.SetIlluminationCorrectionCoefficient(1. / coefTemp); diff --git a/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h index 07c6de1dac81368360768ec97d057c8cb8638431..b14b7a6eb25cce0a7558a4dce77668e849230e97 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h @@ -297,7 +297,7 @@ protected: if (m_Day * m_Month != 0 && m_Day < 32 && m_Month < 13) { double dsol = VarSol::GetVarSol(m_Day, m_Month); - coefTemp = vcl_cos(m_ZenithalSolarAngle * CONST_PI_180) * dsol; + coefTemp = std::cos(m_ZenithalSolarAngle * CONST_PI_180) * dsol; } else { @@ -307,7 +307,7 @@ protected: else { coefTemp = - vcl_cos(m_ZenithalSolarAngle * + std::cos(m_ZenithalSolarAngle * CONST_PI_180) * m_FluxNormalizationCoefficient * m_FluxNormalizationCoefficient; } functor.SetIlluminationCorrectionCoefficient(1. / coefTemp); diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToImageImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToImageImageFilter.h index cba938f79dc85dbd76f1541a01dc3b8bd9422fdb..4d9aa384a8e707f56bb9f2d63f2cd9d0a32e03b8 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToImageImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToImageImageFilter.h @@ -301,7 +301,7 @@ protected: { if (m_Day * m_Month != 0 && m_Day < 32 && m_Month < 13) { - coefTemp = vcl_cos(m_ZenithalSolarAngle * CONST_PI_180) * VarSol::GetVarSol(m_Day,m_Month); + coefTemp = std::cos(m_ZenithalSolarAngle * CONST_PI_180) * VarSol::GetVarSol(m_Day,m_Month); } else { @@ -311,7 +311,7 @@ protected: else { coefTemp = - vcl_cos(m_ZenithalSolarAngle * + std::cos(m_ZenithalSolarAngle * CONST_PI_180) * m_FluxNormalizationCoefficient * m_FluxNormalizationCoefficient; } functor.SetIlluminationCorrectionCoefficient(coefTemp); diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h index 64e72fa0cdd714539a4f0abfa3857b265f8653d8..ce3ffed6cae927313536e564f487d2c50ef515d4 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h @@ -280,7 +280,7 @@ protected: { if (m_Day * m_Month != 0 && m_Day < 32 && m_Month < 13) { - coefTemp = vcl_cos(m_ZenithalSolarAngle * CONST_PI_180) * VarSol::GetVarSol(m_Day,m_Month); + coefTemp = std::cos(m_ZenithalSolarAngle * CONST_PI_180) * VarSol::GetVarSol(m_Day,m_Month); } else { @@ -290,7 +290,7 @@ protected: else { coefTemp = - vcl_cos(m_ZenithalSolarAngle * + std::cos(m_ZenithalSolarAngle * CONST_PI_180) * m_FluxNormalizationCoefficient * m_FluxNormalizationCoefficient; } functor.SetIlluminationCorrectionCoefficient(coefTemp); diff --git a/Modules/Radiometry/OpticalCalibration/include/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.hxx b/Modules/Radiometry/OpticalCalibration/include/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.hxx index ba1559b26c8cd4750c0e919b288634e290590f66..28e915a163764d9441bca4ef8456b0b7a54a6b44 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.hxx +++ b/Modules/Radiometry/OpticalCalibration/include/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.hxx @@ -167,7 +167,7 @@ SurfaceAdjacencyEffectCorrectionSchemeFilter<TInputImage, TOutputImage> { double id = static_cast<double>(i); double jd = static_cast<double>(j); - double currentRadius = m_PixelSpacingInKilometers * vcl_sqrt(vcl_pow(id - center, 2) + vcl_pow(jd - center, 2)); + double currentRadius = m_PixelSpacingInKilometers * std::sqrt(std::pow(id - center, 2) + std::pow(jd - center, 2)); radiusMatrix(i, j) = currentRadius; radiusMatrix(2 * m_WindowRadius - i, j) = currentRadius; radiusMatrix(2 * m_WindowRadius - i, 2 * m_WindowRadius - j) = currentRadius; @@ -194,7 +194,7 @@ SurfaceAdjacencyEffectCorrectionSchemeFilter<TInputImage, TOutputImage> aerosol, radiusMatrix(i,j), palt, - vcl_cos(m_ZenithalViewingAngle * CONST_PI_180), + std::cos(m_ZenithalViewingAngle * CONST_PI_180), notUsed1, notUsed2, factor); //Call to 6S diff --git a/Modules/Radiometry/OpticalCalibration/include/otbVarSol.h b/Modules/Radiometry/OpticalCalibration/include/otbVarSol.h index dd301b6cb16dfff41cd6fe7991fc96c36b9db1d5..9a8aa722a21827c2087c9d85a6525b3386311a57 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbVarSol.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbVarSol.h @@ -65,7 +65,7 @@ namespace otb om = (double) (j - 4) * .9856 * CONST_PI_180; /* Computing 2nd power */ - d__1 = 1. - vcl_cos(om) * .01673; + d__1 = 1. - std::cos(om) * .01673; return 1. / (d__1 * d__1); } }; diff --git a/Modules/Radiometry/OpticalCalibration/src/otbAeronetFileReader.cxx b/Modules/Radiometry/OpticalCalibration/src/otbAeronetFileReader.cxx index dd7fbb1ccce03171cdf7ace9399b5263eb6c2997..305e844fd5ec25c738707411850f9848d4d55b2c 100644 --- a/Modules/Radiometry/OpticalCalibration/src/otbAeronetFileReader.cxx +++ b/Modules/Radiometry/OpticalCalibration/src/otbAeronetFileReader.cxx @@ -165,7 +165,7 @@ AeronetFileReader internal::Date current_date = internal::ParseDate(line[col_date], line[col_time]); double dcurrent_date = GetJulian(current_date); // Check hour +/- epsilon - if (vcl_abs(dcurrent_date - ref_date) < epsilon) + if (std::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/Modules/Radiometry/OpticalCalibration/src/otbSIXSTraits.cxx b/Modules/Radiometry/OpticalCalibration/src/otbSIXSTraits.cxx index 5dc8fa34c324d7e1c86a59c370c83ec57d940ede..f7b21837b3e5b4580680928d09500d06e37156a2 100644 --- a/Modules/Radiometry/OpticalCalibration/src/otbSIXSTraits.cxx +++ b/Modules/Radiometry/OpticalCalibration/src/otbSIXSTraits.cxx @@ -178,7 +178,7 @@ SIXSTraits::ComputeWavelengthSpectralBandValuesFor6S( } // Generate WavelengthSpectralBand if the step is not the official 6S step value - if (vcl_abs(L_userStep - SIXSStepOfWavelengthSpectralBandValues) > epsilon) + if (std::abs(L_userStep - SIXSStepOfWavelengthSpectralBandValues) > epsilon) { ValuesVectorType values(1, FilterFunctionValues[0]); //vector size 1 with the value vect[0] diff --git a/Modules/Radiometry/SARCalibration/include/otbSarBrightnessFunctor.h b/Modules/Radiometry/SARCalibration/include/otbSarBrightnessFunctor.h index 18042f27b13326516579ac6355c1155a70a86fc3..434ef3a57bd7670171ff0a37e1b8c0aea9f34d69 100644 --- a/Modules/Radiometry/SARCalibration/include/otbSarBrightnessFunctor.h +++ b/Modules/Radiometry/SARCalibration/include/otbSarBrightnessFunctor.h @@ -59,7 +59,7 @@ public: inline TOutput operator ()(const TInput& value) const { - RealType digitalNumber = static_cast<RealType> (vcl_abs(value)); + RealType digitalNumber = static_cast<RealType> (std::abs(value)); RealType beta; beta = m_Scale * (digitalNumber * digitalNumber - m_Noise); diff --git a/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx b/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx index f460f0eab63d639202b6bfb95a7690a10c3c0518..d9de620dba6c6643f22426cb45f4ca74bed45232 100644 --- a/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx +++ b/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx @@ -48,11 +48,11 @@ SarDeburstImageFilter<TImage>::GenerateOutputInformation() ImageType * outputPtr = this->GetOutput(); // Check that azimuth spacing has not been modified - if(vcl_abs(inputPtr->GetSignedSpacing()[1]-1.)>=std::numeric_limits<double>::epsilon()) + if(std::abs(inputPtr->GetSignedSpacing()[1]-1.)>=std::numeric_limits<double>::epsilon()) itkExceptionMacro("Can not perform deburst if input image azimuth spacing is not 1."); // Check that the azimuth sampling grid has not been modified - if(vcl_abs(inputPtr->GetOrigin()[1]-static_cast<long>(inputPtr->GetOrigin()[1])-0.5)>=std::numeric_limits<double>::epsilon()) + if(std::abs(inputPtr->GetOrigin()[1]-static_cast<long>(inputPtr->GetOrigin()[1])-0.5)>=std::numeric_limits<double>::epsilon()) itkExceptionMacro("Can not perform deburst if input image azimuth origin is not N.5"); // Retrieve input image keywordlist diff --git a/Modules/Radiometry/SARCalibration/include/otbSarParametricMapFunction.hxx b/Modules/Radiometry/SARCalibration/include/otbSarParametricMapFunction.hxx index d196cf02557704b21d2bd1f31461be30c12f3bc4..b0efb7740fc5a3115e77e60a98e18bd57fa4674f 100644 --- a/Modules/Radiometry/SARCalibration/include/otbSarParametricMapFunction.hxx +++ b/Modules/Radiometry/SARCalibration/include/otbSarParametricMapFunction.hxx @@ -95,7 +95,7 @@ SarParametricMapFunction<TInputImage, TCoordRep> //std::cout << "m_Coeff(" << ycoeff-1 << "," << xcoeff-1 << ") = " << m_Coeff(ycoeff-1, xcoeff-1) << std::endl; intermediate = intermediate * point[0] + m_Coeff(ycoeff-1, xcoeff-1); } - result += vcl_pow( static_cast<double>(point[1]), static_cast<double>(ycoeff-1) ) * intermediate; + result += std::pow( static_cast<double>(point[1]), static_cast<double>(ycoeff-1) ) * intermediate; } return result; @@ -165,10 +165,10 @@ SarParametricMapFunction<TInputImage, TCoordRep> for (unsigned int xcoeff = 0; xcoeff < m_Coeff.Cols(); ++xcoeff) { - double xpart = vcl_pow( static_cast<double>(point[0]) / m_ProductWidth, static_cast<double>(xcoeff)); + double xpart = std::pow( static_cast<double>(point[0]) / m_ProductWidth, static_cast<double>(xcoeff)); for (unsigned int ycoeff = 0; ycoeff < m_Coeff.Rows(); ++ycoeff) { - double ypart = vcl_pow( static_cast<double>(point[1]) / m_ProductHeight, static_cast<double>(ycoeff)); + double ypart = std::pow( static_cast<double>(point[1]) / m_ProductHeight, static_cast<double>(ycoeff)); a(i, xcoeff * m_Coeff.Rows() + ycoeff) = xpart * ypart; //std::cout << "a(" << i << "," << xcoeff * m_Coeff.Rows() + ycoeff << ") = " << xpart * ypart << std::endl; } diff --git a/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationFunction.hxx b/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationFunction.hxx index 1b863819ff6fe0509827001e899558654d14e6f0..43d334adfe45632f93f4dbe947f441edea6bc8de 100644 --- a/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationFunction.hxx +++ b/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationFunction.hxx @@ -112,12 +112,12 @@ SarRadiometricCalibrationFunction<TInputImage, TCoordRep> this->GetInputImage()->TransformIndexToPhysicalPoint( index, point); /** digitalNumber: - * For complex pixel type, vcl_abs() returns the modulus. which is + * For complex pixel type, std::abs() returns the modulus. which is * sqrt((I*I) + (Q*Q)). Where I and Q are real and imaginary part of the * complex pixel. So to to get (I*I) + (Q*Q) in our calculation, the output - * of vcl_abs() is squared. See below (digitalNumber * digitalNumber) where - * digitalNumber is the output of vcl_abs() which is sqrt((I*I) + (Q*Q)). For - * non-complex pixel types, vcl_abs() simply returns absolute value. + * of std::abs() is squared. See below (digitalNumber * digitalNumber) where + * digitalNumber is the output of std::abs() which is sqrt((I*I) + (Q*Q)). For + * non-complex pixel types, std::abs() simply returns absolute value. */ const std::complex<float> pVal = this->GetInputImage()->GetPixel(index); @@ -134,7 +134,7 @@ SarRadiometricCalibrationFunction<TInputImage, TCoordRep> /** Apply incidence angle correction if needed */ if (m_ApplyIncidenceAngleCorrection) { - sigma *= vcl_sin(static_cast<RealType>(m_IncidenceAngle->Evaluate(point))); + sigma *= std::sin(static_cast<RealType>(m_IncidenceAngle->Evaluate(point))); } /** Apply old and new antenna pattern gain. */ diff --git a/Modules/Radiometry/SARCalibration/include/otbTerraSarBrightnessFunctor.hxx b/Modules/Radiometry/SARCalibration/include/otbTerraSarBrightnessFunctor.hxx index 709735a3e6b6b33edd35f38f88d03f4a0b731de1..08a5e08a758d69da5ce7138e6b2bb16d161358dc 100644 --- a/Modules/Radiometry/SARCalibration/include/otbTerraSarBrightnessFunctor.hxx +++ b/Modules/Radiometry/SARCalibration/include/otbTerraSarBrightnessFunctor.hxx @@ -47,7 +47,7 @@ TerraSarBrightnessFunctor<TInput, TOutput> // Formula: Beta^0 = Ks * |DN|^2 // First, square the input pixel - double squareInPix = vcl_pow(static_cast<double>(inPix), 2.); + double squareInPix = std::pow(static_cast<double>(inPix), 2.); // Then apply the calibration factor double beta = m_CalibrationFactor * squareInPix; @@ -57,7 +57,7 @@ TerraSarBrightnessFunctor<TInput, TOutput> // Results in decibels case if (m_ResultsInDecibels) { - beta = 10 * vcl_log10(beta); + beta = 10 * std::log10(beta); } return static_cast<TOutput>(beta); @@ -69,8 +69,8 @@ TerraSarBrightnessFunctor<TInput, TOutput> ::operator() (const std::complex<TInput> &inPix) { // First, extract modulus and phase - double modulus = vcl_sqrt(inPix.real() * inPix.real() + inPix.imag() * inPix.imag()); - double phase = vcl_atan2(inPix.imag(), inPix.real()); + double modulus = std::sqrt(inPix.real() * inPix.real() + inPix.imag() * inPix.imag()); + double phase = std::atan2(inPix.imag(), inPix.real()); // Then, calibrate the modulus double beta = this->operator() (modulus); diff --git a/Modules/Radiometry/SARCalibration/test/otbSarBrightnessFunctor.cxx b/Modules/Radiometry/SARCalibration/test/otbSarBrightnessFunctor.cxx index 3c528eb34004f5175585160101eb61052e7a84f3..8fac4e94632d43393bc09d73bf60e84a53b22da0 100644 --- a/Modules/Radiometry/SARCalibration/test/otbSarBrightnessFunctor.cxx +++ b/Modules/Radiometry/SARCalibration/test/otbSarBrightnessFunctor.cxx @@ -31,28 +31,28 @@ int otbSarBrightnessFunctor(int itkNotUsed(argc), char * itkNotUsed(argv)[]) FunctorType funct; funct.SetNoise( 10.0); - if( vcl_abs(funct.GetNoise() -10.0) > 0.0) + if( std::abs(funct.GetNoise() -10.0) > 0.0) { return false; } funct.SetScale( 10.0); - if( vcl_abs(funct.GetScale() -10.0) > 0.0) + if( std::abs(funct.GetScale() -10.0) > 0.0) { return false; } funct.SetAntennaPatternNewGain( 10.0); - if( vcl_abs(funct.GetAntennaPatternNewGain() -10.0) > 0.0) + if( std::abs(funct.GetAntennaPatternNewGain() -10.0) > 0.0) { return false; } funct.SetAntennaPatternOldGain( 10.0); - if( vcl_abs(funct.GetAntennaPatternOldGain() -10.0) > 0.0) + if( std::abs(funct.GetAntennaPatternOldGain() -10.0) > 0.0) { return false; } funct.SetRangeSpreadLoss( 10.0); - if( vcl_abs(funct.GetRangeSpreadLoss() -10.0) > 0.0) + if( std::abs(funct.GetRangeSpreadLoss() -10.0) > 0.0) { return false; } diff --git a/Modules/Radiometry/SARCalibration/test/otbSarBrightnessFunctorWithoutNoise.cxx b/Modules/Radiometry/SARCalibration/test/otbSarBrightnessFunctorWithoutNoise.cxx index 2cb480dce2221d6945ea344c2b3b83ffd83830e1..d6304674b445c96f1d68f29c7663330a6706a974 100644 --- a/Modules/Radiometry/SARCalibration/test/otbSarBrightnessFunctorWithoutNoise.cxx +++ b/Modules/Radiometry/SARCalibration/test/otbSarBrightnessFunctorWithoutNoise.cxx @@ -33,51 +33,51 @@ int otbSarBrightnessFunctorWithoutNoise(int itkNotUsed(argc), char * itkNotUsed( // With Noise functWithNoise.SetNoise( 0.0); - if( vcl_abs(functWithNoise.GetNoise() -0.0) > 0.0) + if( std::abs(functWithNoise.GetNoise() -0.0) > 0.0) { return false; } functWithNoise.SetScale( 10.0); - if( vcl_abs(functWithNoise.GetScale() -10.0) > 0.0) + if( std::abs(functWithNoise.GetScale() -10.0) > 0.0) { return false; } functWithNoise.SetAntennaPatternNewGain( 10.0); - if( vcl_abs(functWithNoise.GetAntennaPatternNewGain() -10.0) > 0.0) + if( std::abs(functWithNoise.GetAntennaPatternNewGain() -10.0) > 0.0) { return false; } functWithNoise.SetAntennaPatternOldGain( 10.0); - if( vcl_abs(functWithNoise.GetAntennaPatternOldGain() -10.0) > 0.0) + if( std::abs(functWithNoise.GetAntennaPatternOldGain() -10.0) > 0.0) { return false; } functWithNoise.SetRangeSpreadLoss( 10.0); - if( vcl_abs(functWithNoise.GetRangeSpreadLoss() -10.0) > 0.0) + if( std::abs(functWithNoise.GetRangeSpreadLoss() -10.0) > 0.0) { return false; } // Without Noise functWithoutNoise.SetScale(10.0); - if (vcl_abs(functWithoutNoise.GetScale() - 10.0) > 0.0) + if (std::abs(functWithoutNoise.GetScale() - 10.0) > 0.0) { return false; } functWithoutNoise.SetAntennaPatternNewGain(10.0); - if (vcl_abs(functWithoutNoise.GetAntennaPatternNewGain() - 10.0) > 0.0) + if (std::abs(functWithoutNoise.GetAntennaPatternNewGain() - 10.0) > 0.0) { return false; } functWithoutNoise.SetAntennaPatternOldGain(10.0); - if (vcl_abs(functWithoutNoise.GetAntennaPatternOldGain() - 10.0) > 0.0) + if (std::abs(functWithoutNoise.GetAntennaPatternOldGain() - 10.0) > 0.0) { return false; } functWithoutNoise.SetRangeSpreadLoss(10.0); - if (vcl_abs(functWithoutNoise.GetRangeSpreadLoss() - 10.0) > 0.0) + if (std::abs(functWithoutNoise.GetRangeSpreadLoss() - 10.0) > 0.0) { return false; } diff --git a/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.h b/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.h index daf37852b6b0f111ff77a48466d6d21a8252ad70..69e31b81ea025f3f26848b1d7c64eb3ac056ec46 100644 --- a/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.h +++ b/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.h @@ -121,7 +121,7 @@ public: // std::cout << "temp1 "<< temp1 << std::endl; temp2 += temp1*m_Coefficient*static_cast<double>(inPixel); // std::cout << "1-row*S "<< temp << std::endl; -// outPixel = vcl_fabs (static_cast<TOutput>(temp2)); +// outPixel = std::fabs (static_cast<TOutput>(temp2)); outPixel = static_cast<TOutput>(temp2); // std::cout << "in out "<< static_cast<double>(inPixel) << "; " << static_cast<double>(outPixel)<< std::endl; diff --git a/Modules/Radiometry/Simulation/src/otbProspectModel.cxx b/Modules/Radiometry/Simulation/src/otbProspectModel.cxx index a2907b34a13572918761889c6068dfca8f98cc2f..f124488920ccd14fc6015ecd55adfe74060906e4 100644 --- a/Modules/Radiometry/Simulation/src/otbProspectModel.cxx +++ b/Modules/Radiometry/Simulation/src/otbProspectModel.cxx @@ -178,16 +178,16 @@ ProspectModel delta = (t90*t90-r90*r90-1.)*(t90*t90-r90*r90-1.) - 4.*r90*r90; if(delta < 0) delta = EPSILON; - else delta=vcl_sqrt(delta); + else delta=std::sqrt(delta); beta = (1.+r90*r90-t90*t90-delta)/(2.*r90); va=(1.+r90*r90-t90*t90+delta)/(2.*r90); if ((beta-r90)<=0) - vb=vcl_sqrt(beta*(va-r90)/(va*EPSILON)); + vb=std::sqrt(beta*(va-r90)/(va*EPSILON)); else - vb=vcl_sqrt(beta*(va-r90)/(va*(beta-r90))); + vb=std::sqrt(beta*(va-r90)/(va*(beta-r90))); - vbNN = vcl_pow(vb, N-1.); + vbNN = std::pow(vb, N-1.); vbNNinv = 1./vbNN; vainv = 1./va; s1=ta*t90*(vbNN-vbNNinv); @@ -233,16 +233,16 @@ ProspectModel else { if(theta_rad==CONST_PI/2) b1=itk::NumericTraits<double>::ZeroValue(); - else b1=vcl_sqrt((ds*ds-rp/2)*(ds*ds-rp/2)+k); + else b1=std::sqrt((ds*ds-rp/2)*(ds*ds-rp/2)+k); b2=ds*ds-rp/2; b=b1-b2; - ts=(k2/(6*vcl_pow(b, 3))+k/b-b/2)-(k2/(6*vcl_pow(a, 3))+k/a-a/2); + ts=(k2/(6*std::pow(b, 3))+k/b-b/2)-(k2/(6*std::pow(a, 3))+k/a-a/2); tp1=-2*r2*(b-a)/(rp*rp); tp2=-2*r2*rp*log(b/a)/rm2; tp3=r2*(1./b-1./a)/2; - tp4=16*r2*r2*(r2*r2+1)*log((2*rp*b-rm2)/(2*rp*a-rm2))/(vcl_pow(rp, 3)*rm2); - tp5=16*vcl_pow(r2, 3)*(1./(2*rp*b-rm2)-1./(2*rp*a-rm2))/vcl_pow(rp, 3); + tp4=16*r2*r2*(r2*r2+1)*log((2*rp*b-rm2)/(2*rp*a-rm2))/(std::pow(rp, 3)*rm2); + tp5=16*std::pow(r2, 3)*(1./(2*rp*b-rm2)-1./(2*rp*a-rm2))/std::pow(rp, 3); tp=tp1+tp2+tp3+tp4+tp5; res=(ts+tp)/(2*ds*ds); } diff --git a/Modules/Radiometry/Simulation/src/otbSailModel.cxx b/Modules/Radiometry/Simulation/src/otbSailModel.cxx index b822fc061abc58b609c7d7f9dd6c33e9276bed03..208437df03204c632c853f4bbfa3c7f2fdfc76d2 100644 --- a/Modules/Radiometry/Simulation/src/otbSailModel.cxx +++ b/Modules/Radiometry/Simulation/src/otbSailModel.cxx @@ -217,13 +217,13 @@ SailModel this->Calc_LIDF(m_Angl, lidf); double cts, cto, ctscto, tants, tanto, cospsi, dso; - cts = vcl_cos(rd*m_TTS); - cto = vcl_cos(rd*m_TTO); + cts = std::cos(rd*m_TTS); + cto = std::cos(rd*m_TTO); ctscto = cts*cto; - tants = vcl_tan(rd*m_TTS); - tanto = vcl_tan(rd*m_TTO); - cospsi = vcl_cos(rd*m_PSI); - dso = vcl_sqrt(tants*tants+tanto*tanto-2.*tants*tanto*cospsi); + tants = std::tan(rd*m_TTS); + tanto = std::tan(rd*m_TTO); + cospsi = std::cos(rd*m_PSI); + dso = std::sqrt(tants*tants+tanto*tanto-2.*tants*tanto*cospsi); // angular distance, compensation of shadow length // Calculate geometric factors associated with extinction and scattering @@ -241,7 +241,7 @@ SailModel for(unsigned int i=0; i<lidf.size(); ++i) { ttl = 2.5+5*i; // leaf inclination discrete values - ctl = vcl_cos(rd*ttl); + ctl = std::cos(rd*ttl); // SAIL volume scattering phase function gives interception and portions to be // multiplied by rho and tau @@ -334,7 +334,7 @@ SailModel att = 1.-sigf; m2 = (att+sigb)*(att-sigb); if(m2<=0) m2 = 0; - m = vcl_sqrt(m2); + m = std::sqrt(m2); sb = sdb*rho+sdf*tau; @@ -422,7 +422,7 @@ SailModel else { // Outside the hotspot - fhot=m_LAI*vcl_sqrt(ko*ks); + fhot=m_LAI*std::sqrt(ko*ks); // Integrate by exponential Simpson method in 20 steps // the steps are arranged according to equal partitioning // of the slope of the joint probability function @@ -434,7 +434,7 @@ SailModel for(unsigned int j=1; j<=20; ++j) { - if (j<20) x2 = -vcl_log(1.-j*fint)/alf; + if (j<20) x2 = -std::log(1.-j*fint)/alf; else x2 = 1; y2 = -(ko+ks)*m_LAI*x2+fhot*(1.-exp(-alf*x2))/alf; f2 = exp(y2); @@ -500,7 +500,7 @@ SailModel ::Campbell(const double ala, VectorType &freq) const { unsigned int n=18; - double excent = exp(-1.6184e-5*vcl_pow(ala, 3)+2.1145e-3*ala*ala-1.2390e-1*ala+3.2491); + double excent = exp(-1.6184e-5*std::pow(ala, 3)+2.1145e-3*ala*ala-1.2390e-1*ala+3.2491); double sum=0; unsigned int tx2, tx1; double tl1, tl2, x1, x2, v, alpha, alpha2, x12, x22, alpx1, alpx2, dum, almx1, almx2; @@ -514,26 +514,26 @@ SailModel tl2 = tx2*CONST_PI/180; - x1 = excent/sqrt(1.+excent*excent*vcl_tan(tl1)*vcl_tan(tl1)); - x2 = excent/sqrt(1.+excent*excent*vcl_tan(tl2)*vcl_tan(tl2)); + x1 = excent/sqrt(1.+excent*excent*std::tan(tl1)*std::tan(tl1)); + x2 = excent/sqrt(1.+excent*excent*std::tan(tl2)*std::tan(tl2)); if(excent==1) { - v = vcl_abs(cos(tl1)-cos(tl2)); + v = std::abs(cos(tl1)-cos(tl2)); temp.push_back( v ); sum = sum + v; } else { - alpha = excent/vcl_sqrt(vcl_abs(1.-excent*excent)); + alpha = excent/std::sqrt(std::abs(1.-excent*excent)); alpha2 = alpha*alpha; x12 = x1*x1; x22 = x2*x2; if(excent>1) { - alpx1 = vcl_sqrt(alpha2+x12); - alpx2 = vcl_sqrt(alpha2+x22); + alpx1 = std::sqrt(alpha2+x12); + alpx2 = std::sqrt(alpha2+x22); dum = x1*alpx1+alpha2*log(x1+alpx1); - v = vcl_abs(dum-(x2*alpx2+alpha2*log(x2+alpx2))); + v = std::abs(dum-(x2*alpx2+alpha2*log(x2+alpx2))); temp.push_back( v ); sum = sum + v; } @@ -542,7 +542,7 @@ SailModel almx1 = sqrt(alpha2-x12); almx2 = sqrt(alpha2-x22); dum = x1*almx1+alpha2*asin(x1/alpha); - v = vcl_abs(dum-(x2*almx2+alpha2*asin(x2/alpha))); + v = std::abs(dum-(x2*almx2+alpha2*asin(x2/alpha))); temp.push_back( v ); sum = sum + v; } @@ -563,14 +563,14 @@ SailModel { double rd = CONST_PI/180; - double costs = vcl_cos(rd*tts); - double costo = vcl_cos(rd*tto); - double sints = vcl_sin(rd*tts); - double sinto = vcl_sin(rd*tto); - double cospsi = vcl_cos(rd*psi); + double costs = std::cos(rd*tts); + double costo = std::cos(rd*tto); + double sints = std::sin(rd*tts); + double sinto = std::sin(rd*tto); + double cospsi = std::cos(rd*psi); double psir = rd*psi; - double costl = vcl_cos(rd*ttl); - double sintl = vcl_sin(rd*ttl); + double costl = std::cos(rd*ttl); + double sintl = std::sin(rd*ttl); double cs = costl*costs; double co = costl*costo; double ss = sintl*sints; @@ -588,15 +588,15 @@ SailModel double btran1, btran2, bt1, bt2, bt3, t1, t2 , denom, frho, ftau; cosbts = 5; - if (vcl_abs(ss)>1e-6) cosbts = -cs/ss; + if (std::abs(ss)>1e-6) cosbts = -cs/ss; cosbto=5; - if (vcl_abs(so)>1e-6) cosbto = -co/so; + if (std::abs(so)>1e-6) cosbto = -co/so; - if (vcl_abs(cosbts)<1) + if (std::abs(cosbts)<1) { - bts = vcl_acos(cosbts); + bts = std::acos(cosbts); ds = ss; } else @@ -605,11 +605,11 @@ SailModel ds = cs; } - chi_s = 2./CONST_PI*((bts-CONST_PI*0.5)*cs+vcl_sin(bts)*ss); + chi_s = 2./CONST_PI*((bts-CONST_PI*0.5)*cs+std::sin(bts)*ss); - if (vcl_abs(cosbto)<1) + if (std::abs(cosbto)<1) { - bto = vcl_acos(cosbto); + bto = std::acos(cosbto); doo = so; } else if(tto<90) @@ -622,15 +622,15 @@ SailModel bto = 0; doo = -co; } - chi_o = 2./CONST_PI*((bto-CONST_PI*0.5)*co+vcl_sin(bto)*so); + chi_o = 2./CONST_PI*((bto-CONST_PI*0.5)*co+std::sin(bto)*so); // .............................................................................. // Computation of auxiliary azimut angles bt1, bt2, bt3 used // for the computation of the bidirectional scattering coefficient w // ............................................................................. - btran1 = vcl_abs(bts-bto); - btran2 = CONST_PI - vcl_abs(bts+bto-CONST_PI); + btran1 = std::abs(bts-bto); + btran2 = CONST_PI - std::abs(bts+bto-CONST_PI); if (psir<=btran1) { @@ -678,7 +678,7 @@ SailModel //J1 function with avoidance of singularity problem double v; double del=(k-l)*t; - if(vcl_abs(del)>1e-3) + if(std::abs(del)>1e-3) { v = (exp(-l*t)-exp(-k*t))/(k-l); return v; diff --git a/Modules/Registration/DisparityMap/include/otbDisparityMapTo3DFilter.hxx b/Modules/Registration/DisparityMap/include/otbDisparityMapTo3DFilter.hxx index 48e3df23b66d0ac0c64e1e9479821946470e9cc0..47881ffc62dc7294ccafd29a2c5e0221154c1e14 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityMapTo3DFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbDisparityMapTo3DFilter.hxx @@ -345,8 +345,8 @@ DisparityMapTo3DFilter<TDisparityImage,TOutputImage,TEpipolarGridImage,TMaskImag horizDisp->TransformIndexToPhysicalPoint(horizIt.GetIndex(),epiPoint); leftGrid->TransformPhysicalPointToContinuousIndex(epiPoint,gridIndexConti); - ulIndex[0] = static_cast<int>(vcl_floor(gridIndexConti[0])); - ulIndex[1] = static_cast<int>(vcl_floor(gridIndexConti[1])); + ulIndex[0] = static_cast<int>(std::floor(gridIndexConti[0])); + ulIndex[1] = static_cast<int>(std::floor(gridIndexConti[1])); if (ulIndex[0] < gridRegion.GetIndex(0)) ulIndex[0] = gridRegion.GetIndex(0); if (ulIndex[1] < gridRegion.GetIndex(1)) ulIndex[1] = gridRegion.GetIndex(1); if (ulIndex[0] > (gridRegion.GetIndex(0) + static_cast<int>(gridRegion.GetSize(0)) - 2)) @@ -401,8 +401,8 @@ DisparityMapTo3DFilter<TDisparityImage,TOutputImage,TEpipolarGridImage,TMaskImag horizDisp->TransformContinuousIndexToPhysicalPoint(rightIndexEstimate,epiPoint); rightGrid->TransformPhysicalPointToContinuousIndex(epiPoint,gridIndexConti); - ulIndex[0] = static_cast<int>(vcl_floor(gridIndexConti[0])); - ulIndex[1] = static_cast<int>(vcl_floor(gridIndexConti[1])); + ulIndex[0] = static_cast<int>(std::floor(gridIndexConti[0])); + ulIndex[1] = static_cast<int>(std::floor(gridIndexConti[1])); if (ulIndex[0] < gridRegion.GetIndex(0)) ulIndex[0] = gridRegion.GetIndex(0); if (ulIndex[1] < gridRegion.GetIndex(1)) ulIndex[1] = gridRegion.GetIndex(1); if (ulIndex[0] > (gridRegion.GetIndex(0) + static_cast<int>(gridRegion.GetSize(0)) - 2)) diff --git a/Modules/Registration/DisparityMap/include/otbDisparityMapToDEMFilter.hxx b/Modules/Registration/DisparityMap/include/otbDisparityMapToDEMFilter.hxx index 86a9ac5e4790a39d8b32a4f0a2f1576a8ee91454..17ff2fd876db850e7876a84246be62e926a4d2ac 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityMapToDEMFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbDisparityMapToDEMFilter.hxx @@ -337,7 +337,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri // Compute step : // TODO : use a clean RS transform instead typename TOutputDEMImage::SpacingType outSpacing; - outSpacing[0] = 57.295779513 * m_DEMGridStep / (6378137.0 * vcl_cos((box_ymin + box_ymax) * 0.5 * 0.01745329251)); + outSpacing[0] = 57.295779513 * m_DEMGridStep / (6378137.0 * std::cos((box_ymin + box_ymax) * 0.5 * 0.01745329251)); outSpacing[1] = -57.295779513 * m_DEMGridStep / 6378137.0; outputPtr->SetSignedSpacing(outSpacing); @@ -351,8 +351,8 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri typename DEMImageType::RegionType outRegion; outRegion.SetIndex(0,0); outRegion.SetIndex(1,0); - outRegion.SetSize(0, static_cast<unsigned int>((box_xmax - box_xmin) / vcl_abs(outSpacing[0]))); - outRegion.SetSize(1, static_cast<unsigned int>((box_ymax - box_ymin) / vcl_abs(outSpacing[1]))); + outRegion.SetSize(0, static_cast<unsigned int>((box_xmax - box_xmin) / std::abs(outSpacing[0]))); + outRegion.SetSize(1, static_cast<unsigned int>((box_ymax - box_ymin) / std::abs(outSpacing[1]))); outputPtr->SetLargestPossibleRegion(outRegion); outputPtr->SetNumberOfComponentsPerPixel(1); @@ -534,8 +534,8 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri else { // Shift the gridIndex - int a_grid_int = static_cast<int>(gridIndex[0]) + static_cast<int>(vcl_floor(a_grid)); - int b_grid_int = static_cast<int>(gridIndex[1]) + static_cast<int>(vcl_floor(b_grid)); + int a_grid_int = static_cast<int>(gridIndex[0]) + static_cast<int>(std::floor(a_grid)); + int b_grid_int = static_cast<int>(gridIndex[1]) + static_cast<int>(std::floor(b_grid)); if (a_grid_int < minGridIndex[0]) a_grid_int = minGridIndex[0]; if (a_grid_int > maxGridIndex[0]) a_grid_int = maxGridIndex[0]; @@ -565,10 +565,10 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri } typename DisparityMapType::RegionType inputDisparityRegion; - inputDisparityRegion.SetIndex(0, static_cast<int>(vcl_floor(epiIndexMin[0] + 0.5))); - inputDisparityRegion.SetIndex(1, static_cast<int>(vcl_floor(epiIndexMin[1] + 0.5))); - inputDisparityRegion.SetSize(0, 1 + static_cast<unsigned int>(vcl_floor(epiIndexMax[0] - epiIndexMin[0] + 0.5))); - inputDisparityRegion.SetSize(1, 1 + static_cast<unsigned int>(vcl_floor(epiIndexMax[1] - epiIndexMin[1] + 0.5))); + inputDisparityRegion.SetIndex(0, static_cast<int>(std::floor(epiIndexMin[0] + 0.5))); + inputDisparityRegion.SetIndex(1, static_cast<int>(std::floor(epiIndexMin[1] + 0.5))); + inputDisparityRegion.SetSize(0, 1 + static_cast<unsigned int>(std::floor(epiIndexMax[0] - epiIndexMin[0] + 0.5))); + inputDisparityRegion.SetSize(1, 1 + static_cast<unsigned int>(std::floor(epiIndexMax[1] - epiIndexMin[1] + 0.5))); // crop the disparity region at the largest possible region if ( inputDisparityRegion.Crop(horizDisp->GetLargestPossibleRegion())) @@ -759,8 +759,8 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri horizDisp->TransformIndexToPhysicalPoint(horizIt.GetIndex(),epiPoint); leftGrid->TransformPhysicalPointToContinuousIndex(epiPoint,gridIndexConti); - ulIndex[0] = static_cast<int>(vcl_floor(gridIndexConti[0])); - ulIndex[1] = static_cast<int>(vcl_floor(gridIndexConti[1])); + ulIndex[0] = static_cast<int>(std::floor(gridIndexConti[0])); + ulIndex[1] = static_cast<int>(std::floor(gridIndexConti[1])); if (ulIndex[0] < gridRegion.GetIndex(0)) ulIndex[0] = gridRegion.GetIndex(0); if (ulIndex[1] < gridRegion.GetIndex(1)) ulIndex[1] = gridRegion.GetIndex(1); if (ulIndex[0] > (gridRegion.GetIndex(0) + static_cast<int>(gridRegion.GetSize(0)) - 2)) @@ -812,8 +812,8 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri horizDisp->TransformContinuousIndexToPhysicalPoint(rightIndexEstimate,epiPoint); rightGrid->TransformPhysicalPointToContinuousIndex(epiPoint,gridIndexConti); - ulIndex[0] = static_cast<int>(vcl_floor(gridIndexConti[0])); - ulIndex[1] = static_cast<int>(vcl_floor(gridIndexConti[1])); + ulIndex[0] = static_cast<int>(std::floor(gridIndexConti[0])); + ulIndex[1] = static_cast<int>(std::floor(gridIndexConti[1])); if (ulIndex[0] < gridRegion.GetIndex(0)) ulIndex[0] = gridRegion.GetIndex(0); if (ulIndex[1] < gridRegion.GetIndex(1)) ulIndex[1] = gridRegion.GetIndex(1); if (ulIndex[0] > (gridRegion.GetIndex(0) + static_cast<int>(gridRegion.GetSize(0)) - 2)) @@ -897,8 +897,8 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri //TODO JGT check if cellIndex should be calculed from the center of the pixel // TransformContinuousIndexToPhysicalPoint with index [0,0] returns Origin of image // TransformContinuousIndexToPhysicalPoint with index [0.5,0.5] returns a slight difference from Origin of image - cellIndex[0] = static_cast<int>(vcl_floor(midIndex[0] + 0.5)); - cellIndex[1] = static_cast<int>(vcl_floor(midIndex[1] + 0.5)); + cellIndex[0] = static_cast<int>(std::floor(midIndex[0] + 0.5)); + cellIndex[1] = static_cast<int>(std::floor(midIndex[1] + 0.5)); if (outputRequestedRegion.IsInside(cellIndex)) { diff --git a/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx b/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx index 2ecbc873e28602b1c6070643664b82191f2fb02c..5fccbeca4d6f5c9a048584b97db9316afd629137 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx @@ -280,8 +280,8 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> itk::ContinuousIndex<double,2> indexGrid; leftGrid->TransformPhysicalPointToContinuousIndex(pointSensor,indexGrid); IndexType ul; - ul[0] = static_cast<long>(vcl_floor(indexGrid[0])); - ul[1] = static_cast<long>(vcl_floor(indexGrid[1])); + ul[0] = static_cast<long>(std::floor(indexGrid[0])); + ul[1] = static_cast<long>(std::floor(indexGrid[1])); if (ul[0] < gridLargest.GetIndex()[0]) ul[0] = gridLargest.GetIndex()[0]; if (ul[1] < gridLargest.GetIndex()[1]) ul[1] = gridLargest.GetIndex()[1]; if (ul[0] > static_cast<IndexValueType>(gridLargest.GetIndex()[0] + gridLargest.GetSize()[0]-2)) @@ -310,17 +310,17 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> horizIn->TransformPhysicalPointToContinuousIndex(pointEpi,indexEpi); if (k == 0) { - minIndex[0] = static_cast<long>(vcl_floor(indexEpi[0])); - minIndex[1] = static_cast<long>(vcl_floor(indexEpi[1])); - maxIndex[0] = static_cast<long>(vcl_ceil(indexEpi[0])); - maxIndex[1] = static_cast<long>(vcl_ceil(indexEpi[1])); + minIndex[0] = static_cast<long>(std::floor(indexEpi[0])); + minIndex[1] = static_cast<long>(std::floor(indexEpi[1])); + maxIndex[0] = static_cast<long>(std::ceil(indexEpi[0])); + maxIndex[1] = static_cast<long>(std::ceil(indexEpi[1])); } else { - if (minIndex[0]>static_cast<long>(vcl_floor(indexEpi[0]))) minIndex[0]=static_cast<long>(vcl_floor(indexEpi[0])); - if (minIndex[1]>static_cast<long>(vcl_floor(indexEpi[1]))) minIndex[1]=static_cast<long>(vcl_floor(indexEpi[1])); - if (maxIndex[0]<static_cast<long>(vcl_ceil(indexEpi[0]))) maxIndex[0]=static_cast<long>(vcl_ceil(indexEpi[0])); - if (maxIndex[1]<static_cast<long>(vcl_ceil(indexEpi[1]))) maxIndex[1]=static_cast<long>(vcl_ceil(indexEpi[1])); + if (minIndex[0]>static_cast<long>(std::floor(indexEpi[0]))) minIndex[0]=static_cast<long>(std::floor(indexEpi[0])); + if (minIndex[1]>static_cast<long>(std::floor(indexEpi[1]))) minIndex[1]=static_cast<long>(std::floor(indexEpi[1])); + if (maxIndex[0]<static_cast<long>(std::ceil(indexEpi[0]))) maxIndex[0]=static_cast<long>(std::ceil(indexEpi[0])); + if (maxIndex[1]<static_cast<long>(std::ceil(indexEpi[1]))) maxIndex[1]=static_cast<long>(std::ceil(indexEpi[1])); } } @@ -382,8 +382,8 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> // Interpolate in left grid IndexType ul; - ul[0] = static_cast<long> (vcl_floor(indexGrid[0])); - ul[1] = static_cast<long> (vcl_floor(indexGrid[1])); + ul[0] = static_cast<long> (std::floor(indexGrid[0])); + ul[1] = static_cast<long> (std::floor(indexGrid[1])); if (ul[0] < leftLargest.GetIndex()[0]) ul[0] = leftLargest.GetIndex()[0]; if (ul[1] < leftLargest.GetIndex()[1]) ul[1] = leftLargest.GetIndex()[1]; if (ul[0] > static_cast<IndexValueType>(leftLargest.GetIndex()[0] + leftLargest.GetSize()[0] - 2)) @@ -412,8 +412,8 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> horizIn->TransformPhysicalPointToContinuousIndex(pointEpi, indexEpi); // Interpolate in disparity map - ul[0] = static_cast<long> (vcl_floor(indexEpi[0])); - ul[1] = static_cast<long> (vcl_floor(indexEpi[1])); + ul[0] = static_cast<long> (std::floor(indexEpi[0])); + ul[1] = static_cast<long> (std::floor(indexEpi[1])); if (ul[0] < buffered.GetIndex()[0]) ul[0] = buffered.GetIndex()[0]; if (ul[1] < buffered.GetIndex()[1]) ul[1] = buffered.GetIndex()[1]; if (ul[0] > static_cast<IndexValueType>(buffered.GetIndex()[0] + buffered.GetSize()[0] - 2)) @@ -453,8 +453,8 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> rightGrid->TransformPhysicalPointToContinuousIndex(pointRight, indexGridRight); // Interpolate in right grid - ul[0] = static_cast<long> (vcl_floor(indexGridRight[0])); - ul[1] = static_cast<long> (vcl_floor(indexGridRight[1])); + ul[0] = static_cast<long> (std::floor(indexGridRight[0])); + ul[1] = static_cast<long> (std::floor(indexGridRight[1])); if (ul[0] < rightLargest.GetIndex()[0]) ul[0] = rightLargest.GetIndex()[0]; if (ul[1] < rightLargest.GetIndex()[1]) ul[1] = rightLargest.GetIndex()[1]; if (ul[0] > static_cast<IndexValueType>(rightLargest.GetIndex()[0] + rightLargest.GetSize()[0] - 2)) diff --git a/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.hxx b/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.hxx index b104a7d9e983047f9053e3211690f4262f814260..d5d44cde497b44868e11d61d689c75a9683377c6 100644 --- a/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.hxx +++ b/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.hxx @@ -238,13 +238,13 @@ NCCRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField> double updatenorm = 0.0; if ((sff * smm) != 0.0) { - double factor = 1.0 / vcl_sqrt(sff * smm); + double factor = 1.0 / std::sqrt(sff * smm); for (unsigned int i = 0; i < ImageDimension; ++i) { update[i] = factor * (derivativeF[i] - (sfm / smm) * derivativeM[i]); updatenorm += (update[i] * update[i]); } - updatenorm = vcl_sqrt(updatenorm); + updatenorm = std::sqrt(updatenorm); m_MetricTotal += sfm * factor; this->m_Energy += sfm * factor; } diff --git a/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.h b/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.h index bc48ccc2b80185b683ab56c15bcc7cfa8d94c92a..d4e2fe2db9568962bb1cdf934a25bff1ca5592e0 100644 --- a/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.h +++ b/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.h @@ -165,12 +165,12 @@ public: cov/=size-1; sigmaA/=size-1; sigmaB/=size-1; - sigmaA = vcl_sqrt(sigmaA); - sigmaB = vcl_sqrt(sigmaB); + sigmaA = std::sqrt(sigmaA); + sigmaB = std::sqrt(sigmaB); if(sigmaA > 1e-20 && sigmaB > 1e-20) { - ncc = vcl_abs(cov)/(sigmaA*sigmaB); + ncc = std::abs(cov)/(sigmaA*sigmaB); } else { @@ -223,7 +223,7 @@ public: // For some reason, iterators do not work on neighborhoods for(unsigned int i = 0; i<a.Size(); ++i) { - score += vcl_pow( vcl_abs(static_cast<double>(a.GetPixel(i)-b.GetPixel(i))) , m_P); + score += std::pow( std::abs(static_cast<double>(a.GetPixel(i)-b.GetPixel(i))) , m_P); } return score; diff --git a/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx b/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx index 32e1baf576f3527456de6de3d282c5f78c56c93b..ec833aded21bddd1c9cac05cba60a2d6611b7143 100644 --- a/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx @@ -436,8 +436,8 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> double ratioX = dispSpacing[0] / leftSpacing[0]; double ratioY = dispSpacing[1] / leftSpacing[1]; - int stepX = static_cast<int>(vcl_floor(ratioX + 0.5)); - int stepY = static_cast<int>(vcl_floor(ratioY + 0.5)); + int stepX = static_cast<int>(std::floor(ratioX + 0.5)); + int stepY = static_cast<int>(std::floor(ratioY + 0.5)); if (stepX < 1 || stepY < 1 || stepX != stepY) { itkExceptionMacro(<<"Incompatible spacing values between disparity map and input image. Left spacing: "<<leftSpacing<<", disparity spacing: "<< dispSpacing); @@ -446,8 +446,8 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> double shiftX = (dispOrigin[0] - leftOrigin[0]) / leftSpacing[0]; double shiftY = (dispOrigin[1] - leftOrigin[1]) / leftSpacing[1]; - this->m_GridIndex[0] = static_cast<typename IndexType::IndexValueType>(vcl_floor(shiftX + 0.5)); - this->m_GridIndex[1] = static_cast<typename IndexType::IndexValueType>(vcl_floor(shiftY + 0.5)); + this->m_GridIndex[0] = static_cast<typename IndexType::IndexValueType>(std::floor(shiftX + 0.5)); + this->m_GridIndex[1] = static_cast<typename IndexType::IndexValueType>(std::floor(shiftY + 0.5)); } template <class TInputImage, class TOutputMetricImage, @@ -731,7 +731,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> if (useHorizontalDisparity) { hDisp_f = static_cast<float>(inHDispIt.Get()) * stepDisparity; - hDisp_i = static_cast<int>(vcl_floor(hDisp_f + 0.5)); + hDisp_i = static_cast<int>(std::floor(hDisp_f + 0.5)); curRightPos[0] = curLeftPos[0] + hDisp_i; } else @@ -744,7 +744,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> if (useVerticalDisparity) { vDisp_f = static_cast<float>(inVDispIt.Get()) * stepDisparity; - vDisp_i = static_cast<int>(vcl_floor(vDisp_f + 0.5)); + vDisp_i = static_cast<int>(std::floor(vDisp_f + 0.5)); curRightPos[1] = curLeftPos[1] + vDisp_i; } else @@ -937,7 +937,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> double dyy = neighborsMetric[1][2] + neighborsMetric[1][0] - 2.0 * neighborsMetric[1][1]; double dxy = 0.25*(neighborsMetric[2][2] + neighborsMetric[0][0] - neighborsMetric[0][2] - neighborsMetric[2][0]); double det = dxx*dyy - dxy*dxy; - if (vcl_abs(det) < (1e-10)) + if (std::abs(det) < (1e-10)) { verticalInterpolation = false; horizontalInterpolation = false; @@ -1164,7 +1164,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> if (useHorizontalDisparity) { hDisp_f = static_cast<float>(inHDispIt.Get()) * stepDisparity; - hDisp_i = static_cast<int>(vcl_floor(hDisp_f + 0.5)); + hDisp_i = static_cast<int>(std::floor(hDisp_f + 0.5)); curRightPos[0] = curLeftPos[0] + hDisp_i; } else @@ -1177,7 +1177,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> if (useVerticalDisparity) { vDisp_f = static_cast<float>(inVDispIt.Get()) * stepDisparity; - vDisp_i = static_cast<int>(vcl_floor(vDisp_f + 0.5)); + vDisp_i = static_cast<int>(std::floor(vDisp_f + 0.5)); curRightPos[1] = curLeftPos[1] + vDisp_i; } else @@ -1650,7 +1650,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> if (useHorizontalDisparity) { hDisp_f = static_cast<float>(inHDispIt.Get()) * stepDisparity; - hDisp_i = static_cast<int>(vcl_floor(hDisp_f + 0.5)); + hDisp_i = static_cast<int>(std::floor(hDisp_f + 0.5)); curRightPos[0] = curLeftPos[0] + hDisp_i; } else @@ -1663,7 +1663,7 @@ TDisparityImage,TMaskImage,TBlockMatchingFunctor> if (useVerticalDisparity) { vDisp_f = static_cast<float>(inVDispIt.Get()) * stepDisparity; - vDisp_i = static_cast<int>(vcl_floor(vDisp_f + 0.5)); + vDisp_i = static_cast<int>(std::floor(vDisp_f + 0.5)); curRightPos[1] = curLeftPos[1] + vDisp_i; } else diff --git a/Modules/Registration/DisplacementField/include/otbBSplinesInterpolateDisplacementFieldGenerator.hxx b/Modules/Registration/DisplacementField/include/otbBSplinesInterpolateDisplacementFieldGenerator.hxx index f5bf50acc4942f247c790ac6251788bb218b5d97..490f65b074342b66c3f77dc00e4476598c3dc1b2 100644 --- a/Modules/Registration/DisplacementField/include/otbBSplinesInterpolateDisplacementFieldGenerator.hxx +++ b/Modules/Registration/DisplacementField/include/otbBSplinesInterpolateDisplacementFieldGenerator.hxx @@ -70,7 +70,7 @@ BSplinesInterpolateDisplacementFieldGenerator<TPointSet, TDisplacementField> { typename PointDataContainer::Element valueAndDisplacements = pointDataIterator.Value(); - if (vcl_abs(valueAndDisplacements[0]) >= this->GetMetricThreshold()) + if (std::abs(valueAndDisplacements[0]) >= this->GetMetricThreshold()) { typename PointSetType::PointType p = pointIterator.Value(); // access the point sourcePoint[0] = p[0]; diff --git a/Modules/Registration/DisplacementField/include/otbBSplinesInterpolateTransformDisplacementFieldGenerator.hxx b/Modules/Registration/DisplacementField/include/otbBSplinesInterpolateTransformDisplacementFieldGenerator.hxx index 7a86cebee0e33f766ceb8831bf549fe43cc50a8e..f73902792cf949e2676afe93bb8a9ecddae854a0 100644 --- a/Modules/Registration/DisplacementField/include/otbBSplinesInterpolateTransformDisplacementFieldGenerator.hxx +++ b/Modules/Registration/DisplacementField/include/otbBSplinesInterpolateTransformDisplacementFieldGenerator.hxx @@ -78,7 +78,7 @@ BSplinesInterpolateTransformDisplacementFieldGenerator<TPointSet, TDisplacementF it != this->GetPointSet()->GetPoints()->End(); ++it) { - if (vcl_abs(this->GetPointSet()->GetPointData()->GetElement(pointDataCounter)[0]) >= this->GetMetricThreshold()) + if (std::abs(this->GetPointSet()->GetPointData()->GetElement(pointDataCounter)[0]) >= this->GetMetricThreshold()) { typename InternalPointSetType::PixelType V(0.0); @@ -90,10 +90,10 @@ BSplinesInterpolateTransformDisplacementFieldGenerator<TPointSet, TDisplacementF else { V[0] = - static_cast<ValueType>(vcl_cos(this->GetPointSet()->GetPointData()->GetElement(pointDataCounter)[paramIndex + static_cast<ValueType>(std::cos(this->GetPointSet()->GetPointData()->GetElement(pointDataCounter)[paramIndex + 3])); V[1] = - static_cast<ValueType>(vcl_sin(this->GetPointSet()->GetPointData()->GetElement(pointDataCounter)[paramIndex + static_cast<ValueType>(std::sin(this->GetPointSet()->GetPointData()->GetElement(pointDataCounter)[paramIndex + 3])); } unsigned long nbPoints = tmpPointSet->GetNumberOfPoints(); @@ -154,7 +154,7 @@ BSplinesInterpolateTransformDisplacementFieldGenerator<TPointSet, TDisplacementF else { V = splineIntList->GetNthElement(paramIndex)->EvaluateAtParametricPoint(p); - params[paramIndex] = vcl_atan2(V[1], V[0]); + params[paramIndex] = std::atan2(V[1], V[0]); } // We then compute the target point using the transform this->GetTransform()->SetParameters(params); diff --git a/Modules/Registration/DisplacementField/include/otbPointSetToDisplacementFieldGenerator.hxx b/Modules/Registration/DisplacementField/include/otbPointSetToDisplacementFieldGenerator.hxx index 28e73fb6f7d0f10521d1dd8371c29384d7bc299c..20f0d551bf28043f6f7c94bc153bd902385cd445 100644 --- a/Modules/Registration/DisplacementField/include/otbPointSetToDisplacementFieldGenerator.hxx +++ b/Modules/Registration/DisplacementField/include/otbPointSetToDisplacementFieldGenerator.hxx @@ -108,7 +108,7 @@ PointSetToDisplacementFieldGenerator<TPointSet, TDisplacementField> PointType p; p[0] = it.Value()[0]; p[1] = it.Value()[1]; - if (vcl_abs(this->GetPointSet()->GetPointData()->GetElement(j)[0]) >= m_MetricThreshold) + if (std::abs(this->GetPointSet()->GetPointData()->GetElement(j)[0]) >= m_MetricThreshold) { distanceVector.push_back(EuclideanDistanceMetric(index, p)); @@ -141,7 +141,7 @@ PointSetToDisplacementFieldGenerator<TPointSet, TDisplacementField> PointType pprime; // our point are expressed in index and not in physical coordinates //this->GetOutput()->TransformIndexToPhysicalPoint(index, pprime); - return vcl_sqrt(vcl_pow(index[0] - p[0], 2) + vcl_pow(index[1] - p[1], 2)); + return std::sqrt(std::pow(index[0] - p[0], 2) + std::pow(index[1] - p[1], 2)); } /** * PrintSelf Method diff --git a/Modules/Registration/Stereo/include/otbAdhesionCorrectionFilter.hxx b/Modules/Registration/Stereo/include/otbAdhesionCorrectionFilter.hxx index 5397853bb2bb2f19da9681676dbd9477c604883d..27c0992a9fb320ae9c1a4285fc8d9eca286f74c1 100644 --- a/Modules/Registration/Stereo/include/otbAdhesionCorrectionFilter.hxx +++ b/Modules/Registration/Stereo/include/otbAdhesionCorrectionFilter.hxx @@ -489,7 +489,7 @@ AdhesionCorrectionFilter<TImage, TMask> index[0]=index_pos[0]-1; index2[0]=index_pos[0]+i; index2[1]=index_pos[1]; - if (vcl_abs(old_disparityPtr->GetPixel(index) - old_disparityPtr->GetPixel(index2)) > m_Tolerance) + if (std::abs(old_disparityPtr->GetPixel(index) - old_disparityPtr->GetPixel(index2)) > m_Tolerance) { if (old_disparityPtr->GetPixel(index) < old_disparityPtr->GetPixel(index2)) { @@ -583,7 +583,7 @@ AdhesionCorrectionFilter<TImage, TMask> old_maskIt.SetIndex(index_pos); if (old_maskIt.Get() != 0 && old_maskPtr->GetPixel(index) != 0) { - if (vcl_abs(old_disparityPtr->GetPixel(index_pos) - old_disparityPtr->GetPixel(index)) > m_Tolerance) + if (std::abs(old_disparityPtr->GetPixel(index_pos) - old_disparityPtr->GetPixel(index)) > m_Tolerance) { if (old_disparityPtr->GetPixel(index) > old_disparityPtr->GetPixel(index_pos) && disparity_jump->GetPixel(index_pos) == 0) @@ -853,7 +853,7 @@ AdhesionCorrectionFilter<TImage, TMask> l++; } } - dif = (int) vcl_abs(pix[0]-pix[1]); + dif = (int) std::abs(pix[0]-pix[1]); risk_edgesIt.SetIndex(index_pos); if (dif==1 || dif==7) risk_edgesIt.Set(2); } @@ -896,7 +896,7 @@ AdhesionCorrectionFilter<TImage, TMask> // The extend the border, it has to be as prevalent as before // canny_edgesIt.SetIndex(index_pos_actual); if (canny_edgesIt.Get()>m_DiscontinuityHighThreshold && - vcl_abs(canny_edgesIt.Get() - canny_edges->GetPixel(index_pos_old)) < m_MaxEdgeGap) + std::abs(canny_edgesIt.Get() - canny_edges->GetPixel(index_pos_old)) < m_MaxEdgeGap) { if (outputriskedgesPtr->GetPixel(index_pos_actual) ==0 && canny_edges->GetPixel(index_pos_actual) > m_max) { @@ -1459,7 +1459,7 @@ AdhesionCorrectionFilter<TImage, TMask> if (old_maskIt.Get() == 0) k++; else { - if (vcl_abs(old_disparityPtr->GetPixel(index_pos)-disp)>m_Tolerance && k<=win) + if (std::abs(old_disparityPtr->GetPixel(index_pos)-disp)>m_Tolerance && k<=win) {//only small holes disparity_jump2It.SetIndex(index_pos); if (old_disparityPtr->GetPixel(index_pos)>disp) disparity_jump2It.Set(5); @@ -1503,7 +1503,7 @@ AdhesionCorrectionFilter<TImage, TMask> if (old_maskPtr->GetPixel(index_pos0)==0) k++; else { - if (vcl_abs(old_disparityPtr->GetPixel(index_pos0)-disp)>m_Tolerance/2 && k<=win) + if (std::abs(old_disparityPtr->GetPixel(index_pos0)-disp)>m_Tolerance/2 && k<=win) {//only small holes disparity_jump2It.SetIndex(index_pos0); if (old_disparityPtr->GetPixel(index_pos0)>disp) disparity_jump2It.Set(8); @@ -1583,7 +1583,7 @@ AdhesionCorrectionFilter<TImage, TMask> index_pos = new_disparityIt.GetIndex(); if (outputriskedgesPtr->GetPixel(index_pos) != 0) { - int l = 0 - vcl_min(big_dist,static_cast<int>(index_pos[1])); //out of bound checking + int l = 0 - std::min(big_dist,static_cast<int>(index_pos[1])); //out of bound checking index[0] = index_pos[0]; index[1] = index_pos[1] + l; @@ -1607,7 +1607,7 @@ AdhesionCorrectionFilter<TImage, TMask> } int maxSize=static_cast<int>(disparity_jump2->GetRequestedRegion().GetSize()[1]); - l = vcl_min(static_cast<int>((maxSize-1)- index_pos[1]),big_dist); //out of bound checking + l = std::min(static_cast<int>((maxSize-1)- index_pos[1]),big_dist); //out of bound checking index[0] = index_pos[0]; index[1] = index_pos[1] + l; while (l >= 0 && disparity_jump2->GetPixel(index) != 6) @@ -1626,7 +1626,7 @@ AdhesionCorrectionFilter<TImage, TMask> new_disparityIt.Set(0); new_maskIt.Set(0); } - l = 0 - vcl_min(big_dist,static_cast<int>(index_pos[1])); + l = 0 - std::min(big_dist,static_cast<int>(index_pos[1])); index[0] = index_pos[0]; index[1] = index_pos[1]+l; @@ -1648,7 +1648,7 @@ AdhesionCorrectionFilter<TImage, TMask> new_maskIt.Set(0); } - l = vcl_min(static_cast<int>((maxSize-1)- index_pos[1]),big_dist); + l = std::min(static_cast<int>((maxSize-1)- index_pos[1]),big_dist); index[0] = index_pos[0]; index[1] = index_pos[1] + l; diff --git a/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx b/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx index 201273cfe25332fef72caeb063601870e53a1775..c4e54e624a35faa4bfffbb989b5d497d41f6eccf 100644 --- a/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx +++ b/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx @@ -256,8 +256,8 @@ BijectionCoherencyFilter<TDisparityImage,TOutputImage> // Interpolate in reverse disparity map typedef typename IndexType::IndexValueType IndexValueType; IndexType ul,ur,ll,lr; - ul[0] = static_cast<long>(vcl_floor(tmpIndex[0])); - ul[1] = static_cast<long>(vcl_floor(tmpIndex[1])); + ul[0] = static_cast<long>(std::floor(tmpIndex[0])); + ul[1] = static_cast<long>(std::floor(tmpIndex[1])); if (ul[0] < buffered.GetIndex()[0]) ul[0] = buffered.GetIndex()[0]; if (ul[1] < buffered.GetIndex()[1]) @@ -293,8 +293,8 @@ BijectionCoherencyFilter<TDisparityImage,TOutputImage> ry * ((1. - rx) * reverseVmap->GetPixel(ll) + rx * reverseVmap->GetPixel(lr)); } - if (vcl_abs(backIndex[0] - static_cast<double>(startIndex[0]))< this->m_Tolerance && - vcl_abs(backIndex[1] - static_cast<double>(startIndex[1]))< this->m_Tolerance) + if (std::abs(backIndex[0] - static_cast<double>(startIndex[0]))< this->m_Tolerance && + std::abs(backIndex[1] - static_cast<double>(startIndex[1]))< this->m_Tolerance) { outIter.Set(255); } diff --git a/Modules/Registration/Stereo/include/otbLineOfSightOptimizer.hxx b/Modules/Registration/Stereo/include/otbLineOfSightOptimizer.hxx index bf20e358db9c5e5f1fc0cd9ea5a057c8963c7257..4fa59ad329a9c2c0ce49946f24d939b8a43139ff 100644 --- a/Modules/Registration/Stereo/include/otbLineOfSightOptimizer.hxx +++ b/Modules/Registration/Stereo/include/otbLineOfSightOptimizer.hxx @@ -80,7 +80,7 @@ LineOfSightOptimizer<TPrecision,TLabel> vi(1,0) = itPointB.Value()[1] - itPointA.Value()[1]; vi(2,0) = itPointB.Value()[2] - itPointA.Value()[2]; - PrecisionType norm_inv = 1. / vcl_sqrt(vi(0,0)*vi(0,0)+vi(1,0)*vi(1,0)+vi(2,0)*vi(2,0)); + PrecisionType norm_inv = 1. / std::sqrt(vi(0,0)*vi(0,0)+vi(1,0)*vi(1,0)+vi(2,0)*vi(2,0)); vi(0,0) *= norm_inv; vi(1,0) *= norm_inv; @@ -126,14 +126,14 @@ LineOfSightOptimizer<TPrecision,TLabel> res2 = std::max(0.0,dot_product(AC,AC) - (dot_product(AB,AC) * dot_product(AB,AC)) / (dot_product(AB,AB))); - m_Residues.push_back( vcl_sqrt( res2 ) ); + m_Residues.push_back( std::sqrt( res2 ) ); m_GlobalResidue += res2; ++itPointA; ++itPointB; } - m_GlobalResidue = vcl_sqrt(m_GlobalResidue); + m_GlobalResidue = std::sqrt(m_GlobalResidue); return result; } diff --git a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx index fd58e1a132283fbf7172eb89b070574f51b2eeea..9a262547080a105af269cc63253f31d3e285411a 100644 --- a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx +++ b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx @@ -240,7 +240,7 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::SetOutputPara // TODO : use a clean RS transform instead typename TOutputDEMImage::SpacingType outSpacing; //std::cout<<" GrisStep "<<m_DEMGridStep<<std::endl; - outSpacing[0] = 57.295779513 * m_DEMGridStep / (6378137.0 * vcl_cos((box_ymin + box_ymax) * 0.5 * 0.01745329251)); + outSpacing[0] = 57.295779513 * m_DEMGridStep / (6378137.0 * std::cos((box_ymin + box_ymax) * 0.5 * 0.01745329251)); outSpacing[1] = -57.295779513 * m_DEMGridStep / 6378137.0; outputPtr->SetSignedSpacing(outSpacing); @@ -254,8 +254,8 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::SetOutputPara typename TOutputDEMImage::RegionType outRegion; outRegion.SetIndex(0, 0); outRegion.SetIndex(1, 0); - outRegion.SetSize(0, static_cast<unsigned int>(vcl_floor((box_xmax - box_xmin) / vcl_abs(outSpacing[0]) + 0.5))); - outRegion.SetSize(1, static_cast<unsigned int>(vcl_floor((box_ymax - box_ymin) / vcl_abs(outSpacing[1]) + 0.5))); + outRegion.SetSize(0, static_cast<unsigned int>(std::floor((box_xmax - box_xmin) / std::abs(outSpacing[0]) + 0.5))); + outRegion.SetSize(1, static_cast<unsigned int>(std::floor((box_ymax - box_ymin) / std::abs(outSpacing[1]) + 0.5))); outputPtr->SetLargestPossibleRegion(outRegion); outputPtr->SetNumberOfComponentsPerPixel(1); @@ -287,7 +287,7 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::SetOutputPara outRegion2.SetIndex(1, 0); outRegion2.SetSize(0, genericRSEstimator->GetOutputSize()[0]); //TODO JGT check the size - //outRegion.SetSize(1, static_cast<unsigned int> ((box_ymax - box_ymin) / vcl_abs(outSpacing[1])+1)); + //outRegion.SetSize(1, static_cast<unsigned int> ((box_ymax - box_ymin) / std::abs(outSpacing[1])+1)); outRegion2.SetSize(1, genericRSEstimator->GetOutputSize()[1]); outputPtr->SetLargestPossibleRegion(outRegion2); outputPtr->SetNumberOfComponentsPerPixel(1); @@ -669,8 +669,8 @@ void Multi3DMapToDEMFilter<T3DImage, TMaskImage, TOutputDEMImage>::ThreadedGener // The DEM cell at index 'n' contains continuous indexes from 'n-0.5' to 'n+0.5' outputPtr->TransformPhysicalPointToContinuousIndex(point2D, continuousIndex); typename OutputImageType::IndexType cellIndex; - cellIndex[0] = static_cast<int> (vcl_floor(continuousIndex[0] + 0.5)); - cellIndex[1] = static_cast<int> (vcl_floor(continuousIndex[1] + 0.5)); + cellIndex[0] = static_cast<int> (std::floor(continuousIndex[0] + 0.5)); + cellIndex[1] = static_cast<int> (std::floor(continuousIndex[1] + 0.5)); //std::cout<<"cellindex "<<cellIndex<<std::endl; //index from physical /** -Wunused-variable diff --git a/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.hxx b/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.hxx index b847999ea8ae12a2d7688b1e575a44e7eb585b37..ddd083de1775306547773f5451b6417c98b2433f 100644 --- a/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.hxx +++ b/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.hxx @@ -551,7 +551,7 @@ StereoSensorModelToElevationFilter<TInputImage, TOutputHeight> squareSumMaster += (master[i]-meanMaster) * (master[i]-meanMaster); } - correlationValue = vcl_abs(crossProd/(vcl_sqrt(squareSumSlave)*vcl_sqrt(squareSumMaster))); + correlationValue = std::abs(crossProd/(std::sqrt(squareSumSlave)*std::sqrt(squareSumMaster))); return correlationValue; } diff --git a/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.hxx b/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.hxx index a3fedbf970720ca5a4ef2de3782a51b73b3e75ba..4881129ebb7686f338f76fd95ea4d199541832cd 100644 --- a/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.hxx +++ b/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.hxx @@ -159,9 +159,9 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> // First, spacing : choose a square spacing, SpacingType outputSpacing; outputSpacing.Fill(m_Scale * m_GridStep); - double mean_spacing=0.5*(vcl_abs(m_LeftImage->GetSignedSpacing()[0])+vcl_abs(m_LeftImage->GetSignedSpacing()[1])); - //double ratio_x = mean_spacing / vcl_abs(m_LeftImage->GetSignedSpacing()[0]); - //double ratio_y = mean_spacing / vcl_abs(m_LeftImage->GetSignedSpacing()[1]); + double mean_spacing=0.5*(std::abs(m_LeftImage->GetSignedSpacing()[0])+std::abs(m_LeftImage->GetSignedSpacing()[1])); + //double ratio_x = mean_spacing / std::abs(m_LeftImage->GetSignedSpacing()[0]); + //double ratio_y = mean_spacing / std::abs(m_LeftImage->GetSignedSpacing()[1]); outputSpacing[0]*=mean_spacing; outputSpacing[1]*=mean_spacing; @@ -218,11 +218,11 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> / (leftEpiLineEnd[0] - leftEpiLineStart[0]); if (leftEpiLineEnd[0] > leftEpiLineStart[0]) { - alpha = vcl_atan(a); + alpha = std::atan(a); } else { - alpha = otb::CONST_PI + vcl_atan(a); + alpha = otb::CONST_PI + std::atan(a); } } @@ -230,10 +230,10 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> // And compute the unitary vectors of the new axis (equivalent to // the column of the rotation matrix) // TODO: Check if we need to use the input image spacing here - double ux = vcl_cos(alpha); - double uy = vcl_sin(alpha); - double vx = - vcl_sin(alpha); - double vy = vcl_cos(alpha); + double ux = std::cos(alpha); + double uy = std::sin(alpha); + double vx = - std::sin(alpha); + double vy = std::cos(alpha); // Now, we will compute the bounding box of the left input image in // this rotated geometry @@ -333,7 +333,7 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> double localElevation = otb::DEMHandler::Instance()->GetDefaultHeightAboveEllipsoid(); // Use the mean spacing as before - double mean_spacing=0.5*(vcl_abs(m_LeftImage->GetSignedSpacing()[0])+vcl_abs(m_LeftImage->GetSignedSpacing()[1])); + double mean_spacing=0.5*(std::abs(m_LeftImage->GetSignedSpacing()[0])+std::abs(m_LeftImage->GetSignedSpacing()[1])); // Initialize currentPoint1 = m_OutputOriginInLeftImage; @@ -420,7 +420,7 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> endLine1 = m_RightToLeftTransform->TransformPoint(epiPoint2); // Estimate the local baseline ratio - double localBaselineRatio = vcl_sqrt((endLine1[0] - startLine1[0]) + double localBaselineRatio = std::sqrt((endLine1[0] - startLine1[0]) * (endLine1[0] - startLine1[0]) + (endLine1[1] - startLine1[1]) * (endLine1[1] - startLine1[1])) @@ -447,11 +447,11 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> a1 = (endLine1[1] - startLine1[1]) / (endLine1[0] - startLine1[0]); if (endLine1[0] > startLine1[0]) { - alpha1 = vcl_atan(a1); + alpha1 = std::atan(a1); } else { - alpha1 = otb::CONST_PI + vcl_atan(a1); + alpha1 = otb::CONST_PI + std::atan(a1); } } @@ -470,9 +470,9 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> // We want to move m_Scale pixels away in the epipolar line of the // first image // Take into account height direction - //double alpha1 = otb::CONST_PI - vcl_atan(a1); - double deltax1 = m_Scale * m_GridStep * mean_spacing * vcl_cos(alpha1); - double deltay1 = m_Scale * m_GridStep * mean_spacing * vcl_sin(alpha1); + //double alpha1 = otb::CONST_PI - std::atan(a1); + double deltax1 = m_Scale * m_GridStep * mean_spacing * std::cos(alpha1); + double deltay1 = m_Scale * m_GridStep * mean_spacing * std::sin(alpha1); // Now we move currentPoint1 currentPoint1[0]+=deltax1; @@ -496,8 +496,8 @@ StereorectificationDisplacementFieldSource<TInputImage, TOutputImage> { // We want to move 1 pixel away in the direction orthogonal to // epipolar line - double nextdeltax1 = -m_Scale * mean_spacing * m_GridStep * vcl_sin(alpha1); - double nextdeltay1 = m_Scale * mean_spacing * m_GridStep * vcl_cos(alpha1); + double nextdeltax1 = -m_Scale * mean_spacing * m_GridStep * std::sin(alpha1); + double nextdeltay1 = m_Scale * mean_spacing * m_GridStep * std::cos(alpha1); // We can then update nextLineStart1 nextLineStart1[0] = currentPoint1[0] - deltax1 + nextdeltax1; diff --git a/Modules/Segmentation/CCOBIA/include/otbConnectedComponentMuParserFunctor.h b/Modules/Segmentation/CCOBIA/include/otbConnectedComponentMuParserFunctor.h index 0483498764931fa533aeb3bdc9594bd844525534..d871f98870411c30a94a88938ba9326395453eab 100644 --- a/Modules/Segmentation/CCOBIA/include/otbConnectedComponentMuParserFunctor.h +++ b/Modules/Segmentation/CCOBIA/include/otbConnectedComponentMuParserFunctor.h @@ -113,7 +113,7 @@ public: m_IntensityP1 = m_IntensityP1 / (static_cast<double> (m_NbOfBands)); m_IntensityP2 = m_IntensityP2 / (static_cast<double> (m_NbOfBands)); - m_Distance = vcl_sqrt(m_Distance); + m_Distance = std::sqrt(m_Distance); //compute spectralAngle double scalarProd = 0.0; @@ -135,7 +135,7 @@ public: } else { - m_SpectralAngle = vcl_acos(scalarProd / vcl_sqrt(normProd)); + m_SpectralAngle = std::acos(scalarProd / std::sqrt(normProd)); } // diff --git a/Modules/Segmentation/Conversion/include/otbLabelImageRegionMergingFilter.hxx b/Modules/Segmentation/Conversion/include/otbLabelImageRegionMergingFilter.hxx index 23180bc7986007b8b309e712c4cdd508484ef17d..f20fe9d3078828a0af779e997ebee1f9724e6d62 100644 --- a/Modules/Segmentation/Conversion/include/otbLabelImageRegionMergingFilter.hxx +++ b/Modules/Segmentation/Conversion/include/otbLabelImageRegionMergingFilter.hxx @@ -446,7 +446,7 @@ LabelImageRegionMergingFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe while(!it.IsAtEnd()) { LabelType label = it.Get(); - maxLabel = vcl_max(maxLabel, label); + maxLabel = std::max(maxLabel, label); ++it; } diff --git a/Modules/Segmentation/Conversion/include/otbLabelImageRegionPruningFilter.hxx b/Modules/Segmentation/Conversion/include/otbLabelImageRegionPruningFilter.hxx index 06af2e415b7022011fa441dcd535527b47bf4980..c43423198977f0836a147c875797b5c6d9bbe3d3 100644 --- a/Modules/Segmentation/Conversion/include/otbLabelImageRegionPruningFilter.hxx +++ b/Modules/Segmentation/Conversion/include/otbLabelImageRegionPruningFilter.hxx @@ -468,7 +468,7 @@ LabelImageRegionPruningFilter<TInputLabelImage, TInputSpectralImage, TOutputLabe while(!it.IsAtEnd()) { LabelType label = it.Get(); - maxLabel = vcl_max(maxLabel, label); + maxLabel = std::max(maxLabel, label); ++it; } diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.hxx b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.hxx index 8aa57fe51e901f89b90d0963810d295cc49146b3..7e19592c3166968f193925ee54fc357a1ba6e4f7 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.hxx +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.hxx @@ -157,7 +157,7 @@ void VectorDataToLabelMapWithAttributesFilter<TVectorData, TLabelMap> origin[i] += m_VectorDataProperties->GetBoundingRegion().GetSize(i); } origin[i] += (0.5 - m_StartIndex[i]) * spacing[i]; - size[i] = static_cast<unsigned long>(vcl_ceil(vcl_abs( + size[i] = static_cast<unsigned long>(std::ceil(std::abs( m_VectorDataProperties->GetBoundingRegion().GetSize(i)/spacing[i]))); } diff --git a/Modules/Segmentation/OGRProcessing/include/otbStreamingImageToOGRLayerSegmentationFilter.hxx b/Modules/Segmentation/OGRProcessing/include/otbStreamingImageToOGRLayerSegmentationFilter.hxx index 26b08df09e6c89983107413650b0692a4e33dc0a..966953cac11cce12e5fdba39c36a278faf075932 100644 --- a/Modules/Segmentation/OGRProcessing/include/otbStreamingImageToOGRLayerSegmentationFilter.hxx +++ b/Modules/Segmentation/OGRProcessing/include/otbStreamingImageToOGRLayerSegmentationFilter.hxx @@ -127,7 +127,7 @@ PersistentImageToOGRLayerSegmentationFilter<TImageType, TSegmentationFilter> OGRLayerType tmpLayer = tmpDS->GetLayer(0); const typename InputImageType::SpacingType inSpacing = this->GetInput()->GetSignedSpacing(); - const double tol = m_SimplificationTolerance * std::max(vcl_abs(inSpacing[0]),vcl_abs(inSpacing[1])); + const double tol = m_SimplificationTolerance * std::max(std::abs(inSpacing[0]),std::abs(inSpacing[1])); typename OGRLayerType::iterator featIt = tmpLayer.begin(); for(featIt = tmpLayer.begin(); featIt!=tmpLayer.end(); ++featIt) @@ -154,7 +154,7 @@ PersistentImageToOGRLayerSegmentationFilter<TImageType, TSegmentationFilter> double area = static_cast<const OGRPolygon *>((*featIt).GetGeometry())->get_Area(); //convert into pixel coordinates typename InputImageType::SpacingType spacing = this->GetInput()->GetSignedSpacing(); - double pixelsArea = area / (vcl_abs(spacing[0]*spacing[1])); + double pixelsArea = area / (std::abs(spacing[0]*spacing[1])); otbMsgDebugMacro(<<"DN = "<<field.GetValue<int>()<<", area = "<<pixelsArea); if( pixelsArea < m_MinimumObjectSize ) { diff --git a/Modules/Visualization/Ice/include/otbGlImageActor.h b/Modules/Visualization/Ice/include/otbGlImageActor.h index dcc3a6aeb8149a19dddfb6069c1f0c72dba8c012..d155ce9f46f4de1098a80092990688962b63b290 100644 --- a/Modules/Visualization/Ice/include/otbGlImageActor.h +++ b/Modules/Visualization/Ice/include/otbGlImageActor.h @@ -144,7 +144,7 @@ public: { if ( this->m_RedIdx != idx ) { - this->m_RedIdx = vcl_min(this->GetNumberOfComponents(),idx); + this->m_RedIdx = std::min(this->GetNumberOfComponents(),idx); this->Modified(); } } @@ -153,7 +153,7 @@ public: { if ( this->m_GreenIdx != idx ) { - this->m_GreenIdx = vcl_min(this->GetNumberOfComponents(),idx); + this->m_GreenIdx = std::min(this->GetNumberOfComponents(),idx); this->Modified(); } } @@ -162,7 +162,7 @@ public: { if ( this->m_BlueIdx != idx ) { - this->m_BlueIdx = vcl_min(this->GetNumberOfComponents(),idx); + this->m_BlueIdx = std::min(this->GetNumberOfComponents(),idx); this->Modified(); } } diff --git a/Modules/Visualization/Ice/include/otbGlView.h b/Modules/Visualization/Ice/include/otbGlView.h index a3c0bd9983d7841bc9d62878a0cfb5e1785029e2..2bc15b22021f62cbd82855654c2e4bb68a5e4899 100644 --- a/Modules/Visualization/Ice/include/otbGlView.h +++ b/Modules/Visualization/Ice/include/otbGlView.h @@ -390,8 +390,8 @@ GlView y[ 0 ] -= center[ 0 ]; y[ 1 ] -= center[ 1 ]; - spacing[ 0 ] = vcl_sqrt( x[ 0 ] * x[ 0 ] + x[ 1 ] * x[ 1 ] ) / norm; - spacing[ 1 ] = vcl_sqrt( y[ 0 ] * y[ 0 ] + y[ 1 ] * y[ 1 ] ) / norm; + spacing[ 0 ] = std::sqrt( x[ 0 ] * x[ 0 ] + x[ 1 ] * x[ 1 ] ) / norm; + spacing[ 1 ] = std::sqrt( y[ 0 ] * y[ 0 ] + y[ 1 ] * y[ 1 ] ) / norm; // New spacing signs should match signs of the reference image spacing @@ -676,8 +676,8 @@ GlView // MANTIS-1203: absolute value of native spacing should be // considered (to avoid flipping effects). spacing[ 0 ] = - vcl_abs( n_spacing[ 0 ] ) * units * spacing[ 0 ] / - vcl_sqrt( e[ 0 ] * e[ 0 ] + e[ 1 ] * e[ 1 ] ); + std::abs( n_spacing[ 0 ] ) * units * spacing[ 0 ] / + std::sqrt( e[ 0 ] * e[ 0 ] + e[ 1 ] * e[ 1 ] ); // // Consider arbitrary point on the Y-axis. @@ -700,8 +700,8 @@ GlView // MANTIS-1203: absolute value of native spacing should be // considered (to avoid flipping effects). spacing[ 1 ] = - vcl_abs( n_spacing[ 1 ] ) * units * spacing[ 1 ] / - vcl_sqrt( e[ 0 ] * e[ 0 ] + e[ 1 ] * e[ 1 ] ); + std::abs( n_spacing[ 1 ] ) * units * spacing[ 1 ] / + std::sqrt( e[ 0 ] * e[ 0 ] + e[ 1 ] * e[ 1 ] ); // std::cout << "-> spacing: " << spacing[ 0 ] << ", " << spacing[ 1 ] << std::endl; @@ -713,10 +713,10 @@ GlView // // MANTIS-1203: restore sign of axis when applying isotrop spacing. // { - if( vcl_abs( spacing[ 0 ] ) < vcl_abs( spacing[ 1 ] ) ) - spacing[ 1 ] = ( spacing[ 1 ]<0.0 ? -1 : +1 ) * vcl_abs( spacing[ 0 ] ); + if( std::abs( spacing[ 0 ] ) < std::abs( spacing[ 1 ] ) ) + spacing[ 1 ] = ( spacing[ 1 ]<0.0 ? -1 : +1 ) * std::abs( spacing[ 0 ] ); else - spacing[ 0 ] = ( spacing[ 0 ]<0.0 ? -1 : +1 ) * vcl_abs( spacing[ 1 ] ); + spacing[ 0 ] = ( spacing[ 0 ]<0.0 ? -1 : +1 ) * std::abs( spacing[ 1 ] ); // } // MANTIS-1202 diff --git a/Modules/Visualization/Ice/src/otbGlImageActor.cxx b/Modules/Visualization/Ice/src/otbGlImageActor.cxx index dc14f9542b6c25e53ca7d55ceaa54c4c9256e0f3..09393e67d5a4111ce350a25a20fdca42729f4bc5 100644 --- a/Modules/Visualization/Ice/src/otbGlImageActor.cxx +++ b/Modules/Visualization/Ice/src/otbGlImageActor.cxx @@ -257,9 +257,9 @@ void GlImageActor::UpdateData() // corresponding tiles // First compute needed tiles - unsigned int nbTilesX = vcl_ceil(static_cast<double>(requested.GetIndex()[0] + requested.GetSize()[0])/m_TileSize) -vcl_floor(static_cast<double>(requested.GetIndex()[0])/m_TileSize); - unsigned int nbTilesY = vcl_ceil(static_cast<double>(requested.GetIndex()[1] + requested.GetSize()[1])/m_TileSize) -vcl_floor(static_cast<double>(requested.GetIndex()[1])/m_TileSize); - //unsigned int nbTilesY = vcl_ceil(static_cast<double>(requested.GetSize()[1])/m_TileSize); + unsigned int nbTilesX = std::ceil(static_cast<double>(requested.GetIndex()[0] + requested.GetSize()[0])/m_TileSize) -std::floor(static_cast<double>(requested.GetIndex()[0])/m_TileSize); + unsigned int nbTilesY = std::ceil(static_cast<double>(requested.GetIndex()[1] + requested.GetSize()[1])/m_TileSize) -std::floor(static_cast<double>(requested.GetIndex()[1])/m_TileSize); + //unsigned int nbTilesY = std::ceil(static_cast<double>(requested.GetSize()[1])/m_TileSize); unsigned int tileStartX = m_TileSize*(requested.GetIndex()[0]/m_TileSize); unsigned int tileStartY = m_TileSize*(requested.GetIndex()[1]/m_TileSize); @@ -976,8 +976,8 @@ void GlImageActor::UpdateResolution() pointC[0] = (pointC[0] - m_Origin[0])/m_Spacing[0]; pointC[1] = (pointC[1] - m_Origin[1])/m_Spacing[1]; - double distAB = vcl_sqrt((pointA[0]-pointB[0])*(pointA[0]-pointB[0])+(pointA[1]-pointB[1])*(pointA[1]-pointB[1])); - double distAC = vcl_sqrt((pointA[0]-pointC[0])*(pointA[0]-pointC[0])+(pointA[1]-pointC[1])*(pointA[1]-pointC[1])); + double distAB = std::sqrt((pointA[0]-pointB[0])*(pointA[0]-pointB[0])+(pointA[1]-pointB[1])*(pointA[1]-pointB[1])); + double distAC = std::sqrt((pointA[0]-pointC[0])*(pointA[0]-pointC[0])+(pointA[1]-pointC[1])*(pointA[1]-pointC[1])); double resolution = std::min(100/distAB,100/distAC); @@ -1013,11 +1013,11 @@ void GlImageActor::UpdateResolution() || ( m_ResolutionAlgorithm == ResolutionAlgorithm::Nearest ) ) && - vcl_abs(diff) < minDist ) + std::abs(diff) < minDist ) { isFound = true; - minDist = vcl_abs(diff); + minDist = std::abs(diff); newResolution = std::distance(m_AvailableResolutions.begin(),it); // std::cout << "found: " << newResolution << std::endl; diff --git a/Modules/Visualization/Ice/src/otbGlVectorActor.cxx b/Modules/Visualization/Ice/src/otbGlVectorActor.cxx index e270d01c6461a10a05b372a0863b01449a75ceb4..98d441c4c553a764255c494912aa76f8f78f6330 100644 --- a/Modules/Visualization/Ice/src/otbGlVectorActor.cxx +++ b/Modules/Visualization/Ice/src/otbGlVectorActor.cxx @@ -339,7 +339,7 @@ void GlVectorActor::UpdateData() m_ExtentLRX = lrx; m_ExtentLRY = lry; - double areaOfScreenPixel = vcl_abs(lrx-ulx)*vcl_abs(lry-uly) + double areaOfScreenPixel = std::abs(lrx-ulx)*std::abs(lry-uly) /(settings->GetViewportSize()[0]*settings->GetViewportSize()[1]); OGRPolygon spatialFilter; @@ -386,7 +386,7 @@ void GlVectorActor::UpdateData() newInternalFeature.m_SourceFeature = srcFeature.Clone(); if(m_OptimizedRenderingActive) { - newInternalFeature.m_SourceFeature.SetGeometry(srcFeature.GetGeometry()->SimplifyPreserveTopology(vcl_sqrt(areaOfScreenPixel))); + newInternalFeature.m_SourceFeature.SetGeometry(srcFeature.GetGeometry()->SimplifyPreserveTopology(std::sqrt(areaOfScreenPixel))); } m_InternalFeatures.push_back(newInternalFeature); } diff --git a/Modules/Visualization/Ice/src/otbNonOptGlImageActor.cxx b/Modules/Visualization/Ice/src/otbNonOptGlImageActor.cxx index b1ba5e1274fe6c7cf32730fb2e78c42702601d46..69fdacd94a4043cdd22f3ed6e6d2c13f96d799c1 100644 --- a/Modules/Visualization/Ice/src/otbNonOptGlImageActor.cxx +++ b/Modules/Visualization/Ice/src/otbNonOptGlImageActor.cxx @@ -176,9 +176,9 @@ void NonOptGlImageActor::UpdateData() // corresponding tiles // First compute needed tiles - unsigned int nbTilesX = vcl_ceil(static_cast<double>(requested.GetIndex()[0] + requested.GetSize()[0])/m_TileSize) -vcl_floor(static_cast<double>(requested.GetIndex()[0])/m_TileSize); - unsigned int nbTilesY = vcl_ceil(static_cast<double>(requested.GetIndex()[1] + requested.GetSize()[1])/m_TileSize) -vcl_floor(static_cast<double>(requested.GetIndex()[1])/m_TileSize); - //unsigned int nbTilesY = vcl_ceil(static_cast<double>(requested.GetSize()[1])/m_TileSize); + unsigned int nbTilesX = std::ceil(static_cast<double>(requested.GetIndex()[0] + requested.GetSize()[0])/m_TileSize) -std::floor(static_cast<double>(requested.GetIndex()[0])/m_TileSize); + unsigned int nbTilesY = std::ceil(static_cast<double>(requested.GetIndex()[1] + requested.GetSize()[1])/m_TileSize) -std::floor(static_cast<double>(requested.GetIndex()[1])/m_TileSize); + //unsigned int nbTilesY = std::ceil(static_cast<double>(requested.GetSize()[1])/m_TileSize); unsigned int tileStartX = m_TileSize*(requested.GetIndex()[0]/m_TileSize); unsigned int tileStartY = m_TileSize*(requested.GetIndex()[1]/m_TileSize); @@ -671,8 +671,8 @@ void NonOptGlImageActor::UpdateResolution() // std::cout<<"Estimated spacing: "<<outSpacing<<std::endl; // Last, divide by image spacing to get the resolution - double resolution = std::min(vcl_abs(m_Spacing[0]/outSpacing[0]), - vcl_abs(m_Spacing[1]/outSpacing[1])); + double resolution = std::min(std::abs(m_Spacing[0]/outSpacing[0]), + std::abs(m_Spacing[1]/outSpacing[1])); // std::cout<<"Resolution: "<<resolution<<std::endl; @@ -685,7 +685,7 @@ void NonOptGlImageActor::UpdateResolution() it != m_AvailableResolutions.end(); ++it) { // std::cout<<(*it)<<" "<<(1/((double)(1<<(*it))))<<std::endl; - double diff = vcl_abs(1/((double)(1<<(*it))) - resolution); + double diff = std::abs(1/((double)(1<<(*it))) - resolution); if (diff < minDist) { diff --git a/Modules/Visualization/Ice/src/otbViewSettings.cxx b/Modules/Visualization/Ice/src/otbViewSettings.cxx index 9947ab4b4297414f19afe61deeac0d3f63a2d7d0..977c4daf89a5a30e79c94e7deca31e26a7cae027 100644 --- a/Modules/Visualization/Ice/src/otbViewSettings.cxx +++ b/Modules/Visualization/Ice/src/otbViewSettings.cxx @@ -110,7 +110,7 @@ void ViewSettings::UpdateRotation(const PointType & newCenter, double newAngle) m_RotationAngle = -std::arg(theta1*theta2); - if(vcl_abs(m_RotationAngle) > 1e-9) + if(std::abs(m_RotationAngle) > 1e-9) { // Compute new center std::complex<double> c1(m_RotationCenter[0],m_RotationCenter[1]); @@ -153,7 +153,7 @@ void ViewSettings::SetPersepectiveAngle() RSTransformType::InputPointType centerPoint3d2 = inverseTransform->TransformPoint(groundPoint3d1); - double angle = -vcl_atan2(centerPoint3d2[1]-centerPoint3d[1],centerPoint3d2[0]-centerPoint3d[0]); + double angle = -std::atan2(centerPoint3d2[1]-centerPoint3d[1],centerPoint3d2[0]-centerPoint3d[0]); this->UpdateRotation(centerPoint,M_PI/2 - angle); } @@ -187,7 +187,7 @@ void ViewSettings::SetNorthUpAngle() RSTransformType::InputPointType centerPoint3d2 = inverseTransform->TransformPoint(groundPoint3d1); - double angle = -vcl_atan2(centerPoint3d2[1]-centerPoint3d[1],centerPoint3d2[0]-centerPoint3d[0]); + double angle = -std::atan2(centerPoint3d2[1]-centerPoint3d[1],centerPoint3d2[0]-centerPoint3d[0]); this->UpdateRotation(centerPoint, M_PI/2 - angle); @@ -208,8 +208,8 @@ ViewSettings SpacingType scale( spacing ); - scale[ 0 ] = vcl_abs( scale[ 0 ] ); - scale[ 1 ] = vcl_abs( scale[ 1 ] ); + scale[ 0 ] = std::abs( scale[ 0 ] ); + scale[ 1 ] = std::abs( scale[ 1 ] ); if( scale[ 0 ]>scale[ 1 ] ) return diff --git a/Modules/Visualization/IceViewer/src/otbIceViewer.cxx b/Modules/Visualization/IceViewer/src/otbIceViewer.cxx index 00bcc7a481ee3b231cb3826337e04473294dde05..ef2069d5439c200e6071fb95a5c99d51d594cd5d 100644 --- a/Modules/Visualization/IceViewer/src/otbIceViewer.cxx +++ b/Modules/Visualization/IceViewer/src/otbIceViewer.cxx @@ -348,7 +348,7 @@ void IceViewer::Start() double spacingy = (lry-uly)/m_View->GetSettings()->GetViewportSize()[1]; otb::ViewSettings::SpacingType spacing; - spacing.Fill(std::min(vcl_abs(spacingx),vcl_abs(spacingy))); + spacing.Fill(std::min(std::abs(spacingx),std::abs(spacingy))); if(shouldHaveNegativeSpacing) { @@ -1013,8 +1013,8 @@ void IceViewer::cursor_pos_callback(GLFWwindow * window, double, double) double startx, starty; m_View->GetSettings()->ScreenToViewPortTransform(m_StartDrag[0],m_StartDrag[1],startx,starty); - double angle1 = vcl_atan2(vpy - m_View->GetSettings()->GetViewportCenter()[1],vpx - m_View->GetSettings()->GetViewportCenter()[0]); - double angle2 = vcl_atan2(starty - m_View->GetSettings()->GetViewportCenter()[1], startx - m_View->GetSettings()->GetViewportCenter()[0]); + double angle1 = std::atan2(vpy - m_View->GetSettings()->GetViewportCenter()[1],vpx - m_View->GetSettings()->GetViewportCenter()[0]); + double angle2 = std::atan2(starty - m_View->GetSettings()->GetViewportCenter()[1], startx - m_View->GetSettings()->GetViewportCenter()[0]); m_View->GetSettings()->UpdateRotation(m_View->GetSettings()->GetViewportCenter(),m_StartAngle+angle2-angle1); } @@ -1280,8 +1280,8 @@ void IceViewer::key_callback(GLFWwindow* window, int key, int scancode, int acti GlImageActor::SpacingType spacing; - spacing[0]=vcl_sqrt((tmpImPtX[0]-imCenter[0])*(tmpImPtX[0]-imCenter[0])+(tmpImPtX[1]-imCenter[1])*(tmpImPtX[1]-imCenter[1]))/1000; - spacing[1]=vcl_sqrt((tmpImPtY[0]-imCenter[0])*(tmpImPtY[0]-imCenter[0])+(tmpImPtY[1]-imCenter[1])*(tmpImPtY[1]-imCenter[1]))/1000; + spacing[0]=std::sqrt((tmpImPtX[0]-imCenter[0])*(tmpImPtX[0]-imCenter[0])+(tmpImPtX[1]-imCenter[1])*(tmpImPtX[1]-imCenter[1]))/1000; + spacing[1]=std::sqrt((tmpImPtY[0]-imCenter[0])*(tmpImPtY[0]-imCenter[0])+(tmpImPtY[1]-imCenter[1])*(tmpImPtY[1]-imCenter[1]))/1000; m_View->GetSettings()->SetSpacing(spacing); m_View->GetSettings()->UseProjectionOn(); @@ -1538,7 +1538,7 @@ if(key == GLFW_KEY_M && action == GLFW_PRESS) vpCenter[0]+=1000*m_View->GetSettings()->GetSpacing()[0]; GlImageActor::PointType imCenter2 = actor->ViewportToImageTransform(vpCenter,false); - double length = vcl_sqrt((imCenter[0]-imCenter2[0])*(imCenter[0]-imCenter2[0])+(imCenter[1]-imCenter2[1])*(imCenter[1]-imCenter2[1])); + double length = std::sqrt((imCenter[0]-imCenter2[0])*(imCenter[0]-imCenter2[0])+(imCenter[1]-imCenter2[1])*(imCenter[1]-imCenter2[1])); GlImageActor::SpacingType spacing = m_View->GetSettings()->GetSpacing(); @@ -1554,7 +1554,7 @@ if(key == GLFW_KEY_M && action == GLFW_PRESS) vpCenter[1]+=1000*m_View->GetSettings()->GetSpacing()[1]; imCenter2 = actor->ViewportToImageTransform(vpCenter,false); - length = vcl_sqrt((imCenter[0]-imCenter2[0])*(imCenter[0]-imCenter2[0])+(imCenter[1]-imCenter2[1])*(imCenter[1]-imCenter2[1])); + length = std::sqrt((imCenter[0]-imCenter2[0])*(imCenter[0]-imCenter2[0])+(imCenter[1]-imCenter2[1])*(imCenter[1]-imCenter2[1])); std::cout << "vp:" << vpCenter[ 0 ] << ", " << vpCenter[ 1 ] << std::endl; std::cout << "im-1:" << imCenter[ 0 ] << ", " << imCenter[ 1 ] << std::endl; diff --git a/Modules/Visualization/MonteverdiCore/include/mvdHistogramModel.h b/Modules/Visualization/MonteverdiCore/include/mvdHistogramModel.h index c395dcb1f8f5d1c80d23f404b8bf8b32b02267cb..f8695b4c3202f311f7051b2cd4f55d4e12bd3734 100644 --- a/Modules/Visualization/MonteverdiCore/include/mvdHistogramModel.h +++ b/Modules/Visualization/MonteverdiCore/include/mvdHistogramModel.h @@ -618,7 +618,7 @@ HistogramModel // make sure the epsilon is not hidden when using large values if( boost::is_floating_point< DefaultImageType::PixelType::ValueType >::value ) { - double absValue = vcl_abs(minPixel[i]); + double absValue = std::abs(minPixel[i]); // compute smallest epsilon for absolute pixel value (1.5 factor is for safety) double limitEpsilon = absValue * (double)std::numeric_limits<DefaultImageType::PixelType::ValueType>::epsilon() diff --git a/Modules/Visualization/MonteverdiCore/src/mvdHistogramModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdHistogramModel.cxx index 244f3fbd232168b89b9e47b7a31fa27c311de631..a431db3c52e3ace7d63986c54cb1fb68fd6d398e 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdHistogramModel.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdHistogramModel.cxx @@ -197,7 +197,7 @@ HistogramModel assert( minI <= maxI ); - MeasurementType rangeI = vcl_abs( maxI - minI ); + MeasurementType rangeI = std::abs( maxI - minI ); // Frequency of current bin Histogram::AbsoluteFrequencyType frequency( diff --git a/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx index 558450de9c80b6d2f2ca2fafab6eaf32e3bcc9fc..5a04ac0ac216be1f0524e552cc2f9a1f851a60d9 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx @@ -489,7 +489,7 @@ VectorImageModel::Closest( double invZoomfactor, // Compute the diff and keep the index that minimize the distance for (unsigned int idx = 0; idx < lodCount; idx++) { - double diff = vcl_abs( static_cast< double >( 1 << idx ) - invZoomfactor ); + double diff = std::abs( static_cast< double >( 1 << idx ) - invZoomfactor ); if( diff < minDist ) { diff --git a/Modules/Visualization/MonteverdiGui/src/mvdColorDynamicsWidget.cxx b/Modules/Visualization/MonteverdiGui/src/mvdColorDynamicsWidget.cxx index 6a534904d67f885ec8d17668de561ada55ef9335..a4ad1f85421e2fe068b42566a263df3706722bc9 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdColorDynamicsWidget.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdColorDynamicsWidget.cxx @@ -201,7 +201,7 @@ ColorDynamicsWidget { int gamma = itk::Math::Round< int, double >( - vcl_log( value ) / (GAMMA_FACTOR * vcl_log( GAMMA_POWER ) ) + std::log( value ) / (GAMMA_FACTOR * std::log( GAMMA_POWER ) ) ); int min = GetMinGamma(); @@ -226,13 +226,13 @@ ColorDynamicsWidget { // qDebug() << // "::GetGamma(" << GetGammaCursorPosition() << "): " << - // vcl_pow( + // std::pow( // GAMMA_POWER, // GAMMA_FACTOR * static_cast< double >( GetGammaCursorPosition() ) // ); return - vcl_pow( + std::pow( GAMMA_POWER, GAMMA_FACTOR * static_cast< double >( GetGammaCursorPosition() ) );