Commit fcbf830b authored by Laurentiu Nicola's avatar Laurentiu Nicola

ENH: Use math functions in std:: instead of vcl

find \( -name "*.hxx" -or -name "*.h" -or -name "*.cxx" \) -not -path "*ThirdParty*" -print0 | xargs -0 sed -sri "s/([^<])vcl_(adjacent_find|and|binary|binary_search|copy|copy_|count|count_if|equal|equal_range|fill|fill_n|find|find_end|find_first_of|find_if|for_each|generate|generate_n|generators_|heap|includes|inplace_merge|iter_swap|lexicographical_compare|lower_bound|make_heap|max|min|max_element|merge|merge_|min_element|mismatch|next_permutation|nth_element|partial_sort|partial_sort_copy|partition|stable_partition|partitions_|pop_heap|prev_permutation|push_heap|random_shuffle|remove|remove_copy|remove_copy_if|remove_if|replace|replace_copy|replace_copy_if|replace_if|reverse|reverse_copy|rotate|rotate_copy|search|search_n|set_difference|set_intersection|set_symmetric_difference|set_union|sort|sort_|sort_heap|stable_sort|swap|swap_|swap_ranges|transform|unique|unique_copy|upper_bound|bitset|abs|acos|asin|atan|atan2|ceil|cos|cosh|exp|fabs|floor|fmod|frexp|ldexp|log|log10|modf|pow|sin|sinh|sqrt|tan|tanh|complex|real|imag|arg|norm|conj|polar|jmp_buf|longjmp|sig_atomic_t|raise|signal|va_list|ptrdiff_t|size_t|FILE|fpos_t|fopen|fclose|feof|ferror|fflush|fgetc|fgetpos|fgets|fwrite|fread|fseek|ftell|perror|clearerr|rename|fputc|fputs|freopen|fsetpos|getc|getchar|gets|putc|putchar|puts|rewind|setbuf|setvbuf|tmpfile|tmpnam|ungetc|printf|sprintf|fprintf|vprintf|vsprintf|vfprintf)/\1std::\2/g"

find \( -name "*.hxx" -or -name "*.h" -or -name "*.cxx" \) -not -path "*ThirdParty*" -print0 | xargs -0 sed -sri "s/<<vcl_log/<<std::log/g"
parent 40038c7d
......@@ -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
//
......
......@@ -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
......
......@@ -150,7 +150,7 @@ if(argc!=8)
fail = true;
}
double error = vcl_abs(height-target);
double error = std::abs(height-target);
if(error>tolerance)
{
......
......@@ -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;
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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" ) )
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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 );
......
......@@ -49,7 +49,7 @@ public:
~LogFunctor(){};
TScalar operator() (const TScalar& v) const
{
return vcl_log(v);
return std::log(v);
}
};
} // end namespace Functor
......
......@@ -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();
}
......
......@@ -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: ");
......
......@@ -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, "
......
......@@ -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");
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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");
......
......@@ -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);
......
......@@ -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();
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
......
......@@ -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;