From d3f85fc88a8ff1a942a9661fefc783cb4b4851c4 Mon Sep 17 00:00:00 2001 From: Heiko Thiel Date: Fri, 9 Aug 2019 12:37:14 +0200 Subject: [PATCH] Prefer C++ method std::ceil over C method ceil --- common/include/pcl/pcl_macros.h | 4 +-- common/src/range_image.cpp | 4 +-- cuda/common/include/pcl/cuda/common/eigen.h | 4 +-- cuda/nn/organized_neighbor_search.hpp | 4 +-- .../vfh_recognition/nearest_neighbors.cpp | 2 +- .../include/pcl/features/impl/brisk_2d.hpp | 4 +-- features/include/pcl/features/impl/esf.hpp | 36 +++++++++---------- gpu/kinfu_large_scale/src/kinfu.cpp | 4 +-- gpu/people/src/cuda/nvidia/NPP_staging.cu | 8 ++--- gpu/people/src/cuda/shs.cu | 4 +-- gpu/people/src/people_detector.cpp | 4 +-- .../compression/impl/entropy_range_coder.hpp | 2 +- .../pcl/octree/impl/octree_pointcloud.hpp | 6 ++-- .../pcl/people/impl/person_classifier.hpp | 4 +-- .../impl/ransac_based/simple_octree.hpp | 2 +- recognition/src/cg/hough_3d.cpp | 2 +- recognition/src/ransac_based/orr_octree.cpp | 2 +- .../impl/pyramid_feature_matching.hpp | 4 +-- .../pcl/sample_consensus/impl/mlesac.hpp | 2 +- .../pcl/sample_consensus/impl/msac.hpp | 2 +- .../pcl/sample_consensus/impl/prosac.hpp | 6 ++-- .../pcl/sample_consensus/impl/rmsac.hpp | 2 +- .../pcl/sample_consensus/impl/rransac.hpp | 2 +- .../segmentation/impl/unary_classifier.hpp | 2 +- simulation/src/range_likelihood.cpp | 10 +++--- simulation/tools/sim_viewer.cpp | 4 +-- tools/pcd_viewer.cpp | 2 +- 27 files changed, 66 insertions(+), 66 deletions(-) diff --git a/common/include/pcl/pcl_macros.h b/common/include/pcl/pcl_macros.h index 0203ae5a136..852a7e307f6 100644 --- a/common/include/pcl/pcl_macros.h +++ b/common/include/pcl/pcl_macros.h @@ -138,12 +138,12 @@ namespace pcl __inline double pcl_round (double number) { - return (number < 0.0 ? ceil (number - 0.5) : floor (number + 0.5)); + return (number < 0.0 ? std::ceil (number - 0.5) : floor (number + 0.5)); } __inline float pcl_round (float number) { - return (number < 0.0f ? ceilf (number - 0.5f) : floorf (number + 0.5f)); + return (number < 0.0f ? std::ceil (number - 0.5f) : floorf (number + 0.5f)); } #ifdef __GNUC__ diff --git a/common/src/range_image.cpp b/common/src/range_image.cpp index 0f152427c3c..2ea94f55408 100644 --- a/common/src/range_image.cpp +++ b/common/src/range_image.cpp @@ -543,10 +543,10 @@ RangeImage::getInterpolatedSurfaceProjection (const Eigen::Affine3f& pose, int p cell3_y = world2cell_factor*point3[1] + world2cell_offset, cell3_z = point3[2]; - int min_cell_x = (std::max) (0, int (pcl_lrint (ceil ( (std::min) (cell1_x, (std::min) (cell2_x, cell3_x)))))), + int min_cell_x = (std::max) (0, int (pcl_lrint (std::ceil ( (std::min) (cell1_x, (std::min) (cell2_x, cell3_x)))))), max_cell_x = (std::min) (pixel_size-1, int (pcl_lrint (floor ( (std::max) (cell1_x, (std::max) (cell2_x, cell3_x)))))), - min_cell_y = (std::max) (0, int (pcl_lrint (ceil ( (std::min) (cell1_y, (std::min) (cell2_y, cell3_y)))))), + min_cell_y = (std::max) (0, int (pcl_lrint (std::ceil ( (std::min) (cell1_y, (std::min) (cell2_y, cell3_y)))))), max_cell_y = (std::min) (pixel_size-1, int (pcl_lrint (floor ( (std::max) (cell1_y, (std::max) (cell2_y, cell3_y)))))); if (max_cell_xwidth / 2 + (x1 / focalLength_)); - maxX_arg = (int)ceil((double)input_->width / 2 + (x2 / focalLength_)); + maxX_arg = (int)std::ceil((double)input_->width / 2 + (x2 / focalLength_)); minY_arg = (int)floor((double)input_->height / 2 + (y1 / focalLength_)); - maxY_arg = (int)ceil((double)input_->height / 2 + (y2 / focalLength_)); + maxY_arg = (int)std::ceil((double)input_->height / 2 + (y2 / focalLength_)); // make sure the coordinates fit to point cloud resolution minX_arg = std::max (0, minX_arg); diff --git a/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp b/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp index e699174f1a7..97f93ae3a6c 100644 --- a/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp +++ b/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp @@ -187,7 +187,7 @@ main (int argc, char** argv) // Load the results pcl::visualization::PCLVisualizer p (argc, argv, "VFH Cluster Classifier"); int y_s = (int)floor (sqrt ((double)k)); - int x_s = y_s + (int)ceil ((k / (double)y_s) - y_s); + int x_s = y_s + (int)std::ceil ((k / (double)y_s) - y_s); double x_step = (double)(1 / (double)x_s); double y_step = (double)(1 / (double)y_s); pcl::console::print_highlight ("Preparing to load "); diff --git a/features/include/pcl/features/impl/brisk_2d.hpp b/features/include/pcl/features/impl/brisk_2d.hpp index 5eda6d19b0e..9380bebfe17 100644 --- a/features/include/pcl/features/impl/brisk_2d.hpp +++ b/features/include/pcl/features/impl/brisk_2d.hpp @@ -150,7 +150,7 @@ pcl::BRISK2DEstimation::generateKern pattern_iterator->sigma = static_cast (sigma_scale * scale_list_[scale] * (double (radius_list[ring])) * sin (M_PI / double (number_list[ring]))); // adapt the sizeList if necessary - const unsigned int size = static_cast (ceil (((scale_list_[scale] * radius_list[ring]) + pattern_iterator->sigma)) + 1); + const unsigned int size = static_cast (std::ceil (((scale_list_[scale] * radius_list[ring]) + pattern_iterator->sigma)) + 1); if (size_list_[scale] < size) size_list_[scale] = size; @@ -211,7 +211,7 @@ pcl::BRISK2DEstimation::generateKern } // no bits: - strings_ = int (ceil ((float (no_short_pairs_)) / 128.0)) * 4 * 4; + strings_ = int (std::ceil ((float (no_short_pairs_)) / 128.0)) * 4 * 4; } /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/features/include/pcl/features/impl/esf.hpp b/features/include/pcl/features/impl/esf.hpp index 45cf9427ac4..eb7ce3bfec1 100644 --- a/features/include/pcl/features/impl/esf.hpp +++ b/features/include/pcl/features/impl/esf.hpp @@ -146,12 +146,12 @@ pcl::ESFEstimation::computeESF ( int p_cnt = 0; // IN, OUT, MIXED, Ratio line tracing, index1->index2 { - const int xs = p1[0] < 0.0? static_cast(floor(p1[0])+GRIDSIZE_H): static_cast(ceil(p1[0])+GRIDSIZE_H-1); - const int ys = p1[1] < 0.0? static_cast(floor(p1[1])+GRIDSIZE_H): static_cast(ceil(p1[1])+GRIDSIZE_H-1); - const int zs = p1[2] < 0.0? static_cast(floor(p1[2])+GRIDSIZE_H): static_cast(ceil(p1[2])+GRIDSIZE_H-1); - const int xt = p2[0] < 0.0? static_cast(floor(p2[0])+GRIDSIZE_H): static_cast(ceil(p2[0])+GRIDSIZE_H-1); - const int yt = p2[1] < 0.0? static_cast(floor(p2[1])+GRIDSIZE_H): static_cast(ceil(p2[1])+GRIDSIZE_H-1); - const int zt = p2[2] < 0.0? static_cast(floor(p2[2])+GRIDSIZE_H): static_cast(ceil(p2[2])+GRIDSIZE_H-1); + const int xs = p1[0] < 0.0? static_cast(floor(p1[0])+GRIDSIZE_H): static_cast(std::ceil(p1[0])+GRIDSIZE_H-1); + const int ys = p1[1] < 0.0? static_cast(floor(p1[1])+GRIDSIZE_H): static_cast(std::ceil(p1[1])+GRIDSIZE_H-1); + const int zs = p1[2] < 0.0? static_cast(floor(p1[2])+GRIDSIZE_H): static_cast(std::ceil(p1[2])+GRIDSIZE_H-1); + const int xt = p2[0] < 0.0? static_cast(floor(p2[0])+GRIDSIZE_H): static_cast(std::ceil(p2[0])+GRIDSIZE_H-1); + const int yt = p2[1] < 0.0? static_cast(floor(p2[1])+GRIDSIZE_H): static_cast(std::ceil(p2[1])+GRIDSIZE_H-1); + const int zt = p2[2] < 0.0? static_cast(floor(p2[2])+GRIDSIZE_H): static_cast(std::ceil(p2[2])+GRIDSIZE_H-1); wt_d2.push_back (this->lci (xs, ys, zs, xt, yt, zt, ratio, vxlcnt, pcnt1)); if (wt_d2.back () == 2) h_mix_ratio[static_cast (pcl_round (ratio * (binsize-1)))]++; @@ -160,12 +160,12 @@ pcl::ESFEstimation::computeESF ( } // IN, OUT, MIXED, Ratio line tracing, index1->index3 { - const int xs = p1[0] < 0.0? static_cast(floor(p1[0])+GRIDSIZE_H): static_cast(ceil(p1[0])+GRIDSIZE_H-1); - const int ys = p1[1] < 0.0? static_cast(floor(p1[1])+GRIDSIZE_H): static_cast(ceil(p1[1])+GRIDSIZE_H-1); - const int zs = p1[2] < 0.0? static_cast(floor(p1[2])+GRIDSIZE_H): static_cast(ceil(p1[2])+GRIDSIZE_H-1); - const int xt = p3[0] < 0.0? static_cast(floor(p3[0])+GRIDSIZE_H): static_cast(ceil(p3[0])+GRIDSIZE_H-1); - const int yt = p3[1] < 0.0? static_cast(floor(p3[1])+GRIDSIZE_H): static_cast(ceil(p3[1])+GRIDSIZE_H-1); - const int zt = p3[2] < 0.0? static_cast(floor(p3[2])+GRIDSIZE_H): static_cast(ceil(p3[2])+GRIDSIZE_H-1); + const int xs = p1[0] < 0.0? static_cast(floor(p1[0])+GRIDSIZE_H): static_cast(std::ceil(p1[0])+GRIDSIZE_H-1); + const int ys = p1[1] < 0.0? static_cast(floor(p1[1])+GRIDSIZE_H): static_cast(std::ceil(p1[1])+GRIDSIZE_H-1); + const int zs = p1[2] < 0.0? static_cast(floor(p1[2])+GRIDSIZE_H): static_cast(std::ceil(p1[2])+GRIDSIZE_H-1); + const int xt = p3[0] < 0.0? static_cast(floor(p3[0])+GRIDSIZE_H): static_cast(std::ceil(p3[0])+GRIDSIZE_H-1); + const int yt = p3[1] < 0.0? static_cast(floor(p3[1])+GRIDSIZE_H): static_cast(std::ceil(p3[1])+GRIDSIZE_H-1); + const int zt = p3[2] < 0.0? static_cast(floor(p3[2])+GRIDSIZE_H): static_cast(std::ceil(p3[2])+GRIDSIZE_H-1); wt_d2.push_back (this->lci (xs, ys, zs, xt, yt, zt, ratio, vxlcnt, pcnt2)); if (wt_d2.back () == 2) h_mix_ratio[static_cast(pcl_round (ratio * (binsize-1)))]++; @@ -174,12 +174,12 @@ pcl::ESFEstimation::computeESF ( } // IN, OUT, MIXED, Ratio line tracing, index2->index3 { - const int xs = p2[0] < 0.0? static_cast(floor(p2[0])+GRIDSIZE_H): static_cast(ceil(p2[0])+GRIDSIZE_H-1); - const int ys = p2[1] < 0.0? static_cast(floor(p2[1])+GRIDSIZE_H): static_cast(ceil(p2[1])+GRIDSIZE_H-1); - const int zs = p2[2] < 0.0? static_cast(floor(p2[2])+GRIDSIZE_H): static_cast(ceil(p2[2])+GRIDSIZE_H-1); - const int xt = p3[0] < 0.0? static_cast(floor(p3[0])+GRIDSIZE_H): static_cast(ceil(p3[0])+GRIDSIZE_H-1); - const int yt = p3[1] < 0.0? static_cast(floor(p3[1])+GRIDSIZE_H): static_cast(ceil(p3[1])+GRIDSIZE_H-1); - const int zt = p3[2] < 0.0? static_cast(floor(p3[2])+GRIDSIZE_H): static_cast(ceil(p3[2])+GRIDSIZE_H-1); + const int xs = p2[0] < 0.0? static_cast(floor(p2[0])+GRIDSIZE_H): static_cast(std::ceil(p2[0])+GRIDSIZE_H-1); + const int ys = p2[1] < 0.0? static_cast(floor(p2[1])+GRIDSIZE_H): static_cast(std::ceil(p2[1])+GRIDSIZE_H-1); + const int zs = p2[2] < 0.0? static_cast(floor(p2[2])+GRIDSIZE_H): static_cast(std::ceil(p2[2])+GRIDSIZE_H-1); + const int xt = p3[0] < 0.0? static_cast(floor(p3[0])+GRIDSIZE_H): static_cast(std::ceil(p3[0])+GRIDSIZE_H-1); + const int yt = p3[1] < 0.0? static_cast(floor(p3[1])+GRIDSIZE_H): static_cast(std::ceil(p3[1])+GRIDSIZE_H-1); + const int zt = p3[2] < 0.0? static_cast(floor(p3[2])+GRIDSIZE_H): static_cast(std::ceil(p3[2])+GRIDSIZE_H-1); wt_d2.push_back (this->lci (xs,ys,zs,xt,yt,zt,ratio,vxlcnt,pcnt3)); if (wt_d2.back () == 2) h_mix_ratio[static_cast(pcl_round(ratio * (binsize-1)))]++; diff --git a/gpu/kinfu_large_scale/src/kinfu.cpp b/gpu/kinfu_large_scale/src/kinfu.cpp index 87195495b8b..2676311f07d 100644 --- a/gpu/kinfu_large_scale/src/kinfu.cpp +++ b/gpu/kinfu_large_scale/src/kinfu.cpp @@ -291,8 +291,8 @@ pcl::gpu::kinfuLS::KinfuTracker::allocateBufffers (int rows, int cols) } depthRawScaled_.create (rows, cols); // see estimate transform for the magic numbers - int r = (int)ceil ( ((float)rows) / ESTIMATE_COMBINED_CUDA_GRID_Y ); - int c = (int)ceil ( ((float)cols) / ESTIMATE_COMBINED_CUDA_GRID_X ); + int r = (int)std::ceil ( ((float)rows) / ESTIMATE_COMBINED_CUDA_GRID_Y ); + int c = (int)std::ceil ( ((float)cols) / ESTIMATE_COMBINED_CUDA_GRID_X ); gbuf_.create (27, r * c); sumbuf_.create (27); } diff --git a/gpu/people/src/cuda/nvidia/NPP_staging.cu b/gpu/people/src/cuda/nvidia/NPP_staging.cu index 7326cafdbb6..d85b666d8c1 100644 --- a/gpu/people/src/cuda/nvidia/NPP_staging.cu +++ b/gpu/people/src/cuda/nvidia/NPP_staging.cu @@ -2366,12 +2366,12 @@ __global__ void resizeSuperSample_32f(NcvSize32u srcSize, float yEnd = fmin (y + scaleY, rh - 1.0f); // x range of source samples float floorXBegin = floorf (xBegin); - float ceilXEnd = ceilf (xEnd); + float ceilXEnd = std::ceil (xEnd); int iXBegin = srcROI.x + (int) floorXBegin; int iXEnd = srcROI.x + (int) ceilXEnd; // y range of source samples float floorYBegin = floorf (yBegin); - float ceilYEnd = ceilf (yEnd); + float ceilYEnd = std::ceil (yEnd); int iYBegin = srcROI.y + (int) floorYBegin; int iYEnd = srcROI.y + (int) ceilYEnd; @@ -2451,10 +2451,10 @@ __global__ void resizeBicubic(NcvSize32u srcSize, // sampling range // border mode is clamp - float xmin = fmax (ceilf (x - 2.0f), 0.0f); + float xmin = fmax (std::ceil (x - 2.0f), 0.0f); float xmax = fmin (floorf (x + 2.0f), rw - 1.0f); - float ymin = fmax (ceilf (y - 2.0f), 0.0f); + float ymin = fmax (std::ceil (y - 2.0f), 0.0f); float ymax = fmin (floorf (y + 2.0f), rh - 1.0f); // shift data window to match ROI diff --git a/gpu/people/src/cuda/shs.cu b/gpu/people/src/cuda/shs.cu index 5775abfba4b..96e19c36e3c 100644 --- a/gpu/people/src/cuda/shs.cu +++ b/gpu/people/src/cuda/shs.cu @@ -92,7 +92,7 @@ namespace pcl float y2 = (b + sqrt (det)) / a; min = std::min (static_cast (floor (y1)), static_cast (floor (y2))); - max = std::max (static_cast (ceil (y1)), static_cast (ceil (y2))); + max = std::max (static_cast (std::ceil (y1)), static_cast (std::ceil (y2))); minY = std::min (rows - 1, std::max (0, min)); maxY = std::max (std::min (rows - 1, max), 0); } @@ -112,7 +112,7 @@ namespace pcl float x2 = (b + sqrt (det)) / a; min = std::min (static_cast (floor (x1)), static_cast (floor (x2))); - max = std::max (static_cast (ceil (x1)), static_cast (ceil (x2))); + max = std::max (static_cast (std::ceil (x1)), static_cast (std::ceil (x2))); minX = std::min (cols- 1, std::max (0, min)); maxX = std::max (std::min (cols - 1, max), 0); } diff --git a/gpu/people/src/people_detector.cpp b/gpu/people/src/people_detector.cpp index 8d764f64865..4894e415115 100644 --- a/gpu/people/src/people_detector.cpp +++ b/gpu/people/src/people_detector.cpp @@ -437,7 +437,7 @@ namespace float y2 = (b + sqrt (det)) / a; min = (int)std::min(floor(y1), floor(y2)); - max = (int)std::max( ceil(y1), ceil(y2)); + max = (int)std::max( std::ceil(y1), std::ceil(y2)); minY = std::min (rows - 1, std::max (0, min)); maxY = std::max (std::min (rows - 1, max), 0); } @@ -457,7 +457,7 @@ namespace float x2 = (b + sqrt (det)) / a; min = (int)std::min (floor(x1), floor(x2)); - max = (int)std::max ( ceil(x1), ceil(x2)); + max = (int)std::max ( std::ceil(x1), std::ceil(x2)); minX = std::min (cols- 1, std::max (0, min)); maxX = std::max (std::min (cols - 1, max), 0); } diff --git a/io/include/pcl/compression/impl/entropy_range_coder.hpp b/io/include/pcl/compression/impl/entropy_range_coder.hpp index 1c43a427f46..d504ab270c6 100644 --- a/io/include/pcl/compression/impl/entropy_range_coder.hpp +++ b/io/include/pcl/compression/impl/entropy_range_coder.hpp @@ -293,7 +293,7 @@ pcl::StaticRangeCoder::encodeIntVectorToStream (std::vector& input } // calculate amount of bytes per frequency table entry - uint8_t frequencyTableByteSize = static_cast (ceil ( + uint8_t frequencyTableByteSize = static_cast (std::ceil ( std::log2 (static_cast (cFreqTable_[static_cast (frequencyTableSize - 1)])) / 8.0)); // write size of frequency table to output stream diff --git a/octree/include/pcl/octree/impl/octree_pointcloud.hpp b/octree/include/pcl/octree/impl/octree_pointcloud.hpp index 43999a74c89..f6bfdf4c15a 100644 --- a/octree/include/pcl/octree/impl/octree_pointcloud.hpp +++ b/octree/include/pcl/octree/impl/octree_pointcloud.hpp @@ -626,9 +626,9 @@ pcl::octree::OctreePointCloud const float minValue = std::numeric_limits::epsilon(); // find maximum key values for x, y, z - max_key_x = static_cast (ceil ((max_x_ - min_x_ - minValue) / resolution_)); - max_key_y = static_cast (ceil ((max_y_ - min_y_ - minValue) / resolution_)); - max_key_z = static_cast (ceil ((max_z_ - min_z_ - minValue) / resolution_)); + max_key_x = static_cast (std::ceil ((max_x_ - min_x_ - minValue) / resolution_)); + max_key_y = static_cast (std::ceil ((max_y_ - min_y_ - minValue) / resolution_)); + max_key_z = static_cast (std::ceil ((max_z_ - min_z_ - minValue) / resolution_)); // find maximum amount of keys max_voxels = std::max (std::max (std::max (max_key_x, max_key_y), max_key_z), static_cast (2)); diff --git a/people/include/pcl/people/impl/person_classifier.hpp b/people/include/pcl/people/impl/person_classifier.hpp index 5ae050622fb..952a677f99a 100644 --- a/people/include/pcl/people/impl/person_classifier.hpp +++ b/people/include/pcl/people/impl/person_classifier.hpp @@ -140,9 +140,9 @@ pcl::people::PersonClassifier::resize (PointCloudPtr& input_image, for (int j = 0; j < width; j++) // for every column { A = T_inv * Eigen::Vector3f(i, j, 1); - c1 = ceil(A(0)); + c1 = std::ceil(A(0)); f1 = floor(A(0)); - c2 = ceil(A(1)); + c2 = std::ceil(A(1)); f2 = floor(A(1)); if ( (f1 < 0) || diff --git a/recognition/include/pcl/recognition/impl/ransac_based/simple_octree.hpp b/recognition/include/pcl/recognition/impl/ransac_based/simple_octree.hpp index b2b279a08cb..55692dc9624 100644 --- a/recognition/include/pcl/recognition/impl/ransac_based/simple_octree.hpp +++ b/recognition/include/pcl/recognition/impl/ransac_based/simple_octree.hpp @@ -239,7 +239,7 @@ pcl::recognition::SimpleOctree::build (const // Compute the number of tree levels if ( arg > 1 ) - tree_levels_ = static_cast (ceil (std::log (arg)/std::log (2.0)) + 0.5); + tree_levels_ = static_cast (std::ceil (std::log (arg)/std::log (2.0)) + 0.5); else tree_levels_ = 0; diff --git a/recognition/src/cg/hough_3d.cpp b/recognition/src/cg/hough_3d.cpp index 5a6085b4a12..7e542ce5269 100644 --- a/recognition/src/cg/hough_3d.cpp +++ b/recognition/src/cg/hough_3d.cpp @@ -54,7 +54,7 @@ pcl::recognition::HoughSpace3D::HoughSpace3D (const Eigen::Vector3d &min_coord, for (int i = 0; i < 3; ++i) { - bin_count_[i] = static_cast (ceil ((max_coord[i] - min_coord_[i]) / bin_size_[i])); + bin_count_[i] = static_cast (std::ceil ((max_coord[i] - min_coord_[i]) / bin_size_[i])); } partial_bin_products_[0] = 1; diff --git a/recognition/src/ransac_based/orr_octree.cpp b/recognition/src/ransac_based/orr_octree.cpp index c640d173754..0d6755b683e 100644 --- a/recognition/src/ransac_based/orr_octree.cpp +++ b/recognition/src/ransac_based/orr_octree.cpp @@ -87,7 +87,7 @@ pcl::recognition::ORROctree::build (const float* bounds, float voxel_size) // Compute the number of tree levels if ( arg > 1.0f ) - tree_levels_ = static_cast (ceil (std::log (arg)/std::log (2.0)) + 0.5); + tree_levels_ = static_cast (std::ceil (std::log (arg)/std::log (2.0)) + 0.5); else tree_levels_ = 0; diff --git a/registration/include/pcl/registration/impl/pyramid_feature_matching.hpp b/registration/include/pcl/registration/impl/pyramid_feature_matching.hpp index c64cb59923e..87d302ed78e 100644 --- a/registration/include/pcl/registration/impl/pyramid_feature_matching.hpp +++ b/registration/include/pcl/registration/impl/pyramid_feature_matching.hpp @@ -175,7 +175,7 @@ pcl::PyramidFeatureHistogram::initializeHistogram () D += aux * aux; } D = std::sqrt (D); - nr_levels = static_cast (ceilf (std::log2(D))); + nr_levels = static_cast (std::ceil (std::log2(D))); PCL_DEBUG ("[pcl::PyramidFeatureHistogram::initializeHistogram] Pyramid will have %u levels with a hyper-parallelepiped diagonal size of %f\n", nr_levels, D); @@ -187,7 +187,7 @@ pcl::PyramidFeatureHistogram::initializeHistogram () for (size_t dim_i = 0; dim_i < nr_dimensions; ++dim_i) { bins_per_dimension[dim_i] = - static_cast (ceilf ((dimension_range_target_[dim_i].second - dimension_range_target_[dim_i].first) / (powf (2.0f, static_cast (level_i)) * std::sqrt (static_cast (nr_dimensions))))); + static_cast (std::ceil ((dimension_range_target_[dim_i].second - dimension_range_target_[dim_i].first) / (powf (2.0f, static_cast (level_i)) * std::sqrt (static_cast (nr_dimensions))))); bin_step[dim_i] = powf (2.0f, static_cast (level_i)) * std::sqrt (static_cast (nr_dimensions)); } hist_levels[level_i] = PyramidFeatureHistogramLevel (bins_per_dimension, bin_step); diff --git a/sample_consensus/include/pcl/sample_consensus/impl/mlesac.hpp b/sample_consensus/include/pcl/sample_consensus/impl/mlesac.hpp index 7bb48e36a76..e15892f2c4b 100644 --- a/sample_consensus/include/pcl/sample_consensus/impl/mlesac.hpp +++ b/sample_consensus/include/pcl/sample_consensus/impl/mlesac.hpp @@ -161,7 +161,7 @@ pcl::MaximumLikelihoodSampleConsensus::computeModel (int debug_verbosity ++iterations_; if (debug_verbosity_level > 1) - PCL_DEBUG ("[pcl::MaximumLikelihoodSampleConsensus::computeModel] Trial %d out of %d. Best penalty is %f.\n", iterations_, static_cast (ceil (k)), d_best_penalty); + PCL_DEBUG ("[pcl::MaximumLikelihoodSampleConsensus::computeModel] Trial %d out of %d. Best penalty is %f.\n", iterations_, static_cast (std::ceil (k)), d_best_penalty); if (iterations_ > max_iterations_) { if (debug_verbosity_level > 0) diff --git a/sample_consensus/include/pcl/sample_consensus/impl/msac.hpp b/sample_consensus/include/pcl/sample_consensus/impl/msac.hpp index e0fba67e5dc..59ce1b3e71b 100644 --- a/sample_consensus/include/pcl/sample_consensus/impl/msac.hpp +++ b/sample_consensus/include/pcl/sample_consensus/impl/msac.hpp @@ -119,7 +119,7 @@ pcl::MEstimatorSampleConsensus::computeModel (int debug_verbosity_level) ++iterations_; if (debug_verbosity_level > 1) - PCL_DEBUG ("[pcl::MEstimatorSampleConsensus::computeModel] Trial %d out of %d. Best penalty is %f.\n", iterations_, static_cast (ceil (k)), d_best_penalty); + PCL_DEBUG ("[pcl::MEstimatorSampleConsensus::computeModel] Trial %d out of %d. Best penalty is %f.\n", iterations_, static_cast (std::ceil (k)), d_best_penalty); if (iterations_ > max_iterations_) { if (debug_verbosity_level > 0) diff --git a/sample_consensus/include/pcl/sample_consensus/impl/prosac.hpp b/sample_consensus/include/pcl/sample_consensus/impl/prosac.hpp index c3bf2299253..9974d38e88f 100644 --- a/sample_consensus/include/pcl/sample_consensus/impl/prosac.hpp +++ b/sample_consensus/include/pcl/sample_consensus/impl/prosac.hpp @@ -109,7 +109,7 @@ pcl::ProgressiveSampleConsensus::computeModel (int debug_verbosity_level // Update other variables float T_n_minus_1 = T_n; T_n *= (static_cast(n) + 1.0f) / (static_cast(n) + 1.0f - static_cast(m)); - T_prime_n += ceilf (T_n - T_n_minus_1); + T_prime_n += std::ceil (T_n - T_n_minus_1); } // Step 2 @@ -181,7 +181,7 @@ pcl::ProgressiveSampleConsensus::computeModel (int debug_verbosity_level { // Typo in Equation 7, not (n-m choose i-m) but (n choose i-m) size_t I_possible_n_star_min = m - + static_cast (ceil (boost::math::quantile (boost::math::complement (boost::math::binomial_distribution(static_cast (possible_n_star), 0.1f), 0.05)))); + + static_cast (std::ceil (boost::math::quantile (boost::math::complement (boost::math::binomial_distribution(static_cast (possible_n_star), 0.1f), 0.05)))); // If Equation 9 is not verified, exit if (I_possible_n_star < I_possible_n_star_min) break; @@ -205,7 +205,7 @@ pcl::ProgressiveSampleConsensus::computeModel (int debug_verbosity_level else if (bottom_log == 1) k_n_star = T_N; else - k_n_star = static_cast (ceil (std::log (0.05) / std::log (bottom_log))); + k_n_star = static_cast (std::ceil (std::log (0.05) / std::log (bottom_log))); // It seems weird to have very few iterations, so do have a few (totally empirical) k_n_star = (std::max)(k_n_star, 2 * m); } diff --git a/sample_consensus/include/pcl/sample_consensus/impl/rmsac.hpp b/sample_consensus/include/pcl/sample_consensus/impl/rmsac.hpp index 2e51bd9136c..c750b393964 100644 --- a/sample_consensus/include/pcl/sample_consensus/impl/rmsac.hpp +++ b/sample_consensus/include/pcl/sample_consensus/impl/rmsac.hpp @@ -137,7 +137,7 @@ pcl::RandomizedMEstimatorSampleConsensus::computeModel (int debug_verbos ++iterations_; if (debug_verbosity_level > 1) - PCL_DEBUG ("[pcl::RandomizedMEstimatorSampleConsensus::computeModel] Trial %d out of %d. Best penalty is %f.\n", iterations_, static_cast (ceil (k)), d_best_penalty); + PCL_DEBUG ("[pcl::RandomizedMEstimatorSampleConsensus::computeModel] Trial %d out of %d. Best penalty is %f.\n", iterations_, static_cast (std::ceil (k)), d_best_penalty); if (iterations_ > max_iterations_) { if (debug_verbosity_level > 0) diff --git a/sample_consensus/include/pcl/sample_consensus/impl/rransac.hpp b/sample_consensus/include/pcl/sample_consensus/impl/rransac.hpp index c09488adc7b..fb8bc782652 100644 --- a/sample_consensus/include/pcl/sample_consensus/impl/rransac.hpp +++ b/sample_consensus/include/pcl/sample_consensus/impl/rransac.hpp @@ -122,7 +122,7 @@ pcl::RandomizedRandomSampleConsensus::computeModel (int debug_verbosity_ ++iterations_; if (debug_verbosity_level > 1) - PCL_DEBUG ("[pcl::RandomizedRandomSampleConsensus::computeModel] Trial %d out of %d: %d inliers (best is: %d so far).\n", iterations_, static_cast (ceil (k)), n_inliers_count, n_best_inliers_count); + PCL_DEBUG ("[pcl::RandomizedRandomSampleConsensus::computeModel] Trial %d out of %d: %d inliers (best is: %d so far).\n", iterations_, static_cast (std::ceil (k)), n_inliers_count, n_best_inliers_count); if (iterations_ > max_iterations_) { if (debug_verbosity_level > 0) diff --git a/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp b/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp index ca237e29355..4dd3073d2d9 100644 --- a/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp +++ b/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp @@ -340,7 +340,7 @@ pcl::UnaryClassifier::assignLabels (std::vector &indi, { float l = static_cast (indi[i]) / nfm; float intpart; - //float fractpart = modf (l , &intpart); + //float fractpart = std::modf (l , &intpart); std::modf (l , &intpart); int label = static_cast (intpart); diff --git a/simulation/src/range_likelihood.cpp b/simulation/src/range_likelihood.cpp index 970c07e9447..4cbc35e5eb9 100644 --- a/simulation/src/range_likelihood.cpp +++ b/simulation/src/range_likelihood.cpp @@ -458,7 +458,7 @@ float costFunction2 (float ref_val, float depth_val) { float min_dist = std::abs(ref_val - 1/(1.4285f - (depth_val)*1.3788f)); - int lup = static_cast (ceil (min_dist*100)); // has resolution of 0.01m + int lup = static_cast (std::ceil (min_dist*100)); // has resolution of 0.01m if (lup > 300) { // implicitly this caps the cost if there is a hole in the model @@ -507,7 +507,7 @@ costFunction3 (float ref_val,float depth_val) { // working range float min_dist = std::abs (ref_val - 0.7253f/(1.0360f - (depth_val))); - int lup = static_cast (ceil (min_dist*100)); // has resolution of 0.01m + int lup = static_cast (std::ceil (min_dist*100)); // has resolution of 0.01m if (lup > 300) { // implicitly this caps the cost if there is a hole in the model lup = 300; @@ -522,7 +522,7 @@ costFunction4(float ref_val,float depth_val) { float disparity_diff = std::abs( ( -0.7253f/ref_val +1.0360f ) - depth_val ); - int top_lup = static_cast (ceil (disparity_diff*300)); // has resolution of 0.001m + int top_lup = static_cast (std::ceil (disparity_diff*300)); // has resolution of 0.001m if (top_lup > 300) { top_lup =300; @@ -531,7 +531,7 @@ costFunction4(float ref_val,float depth_val) // bottom: //bottom = bottom_lookup( round(mu*1000+1)); - int bottom_lup = static_cast (ceil( (depth_val) * 300)); // has resolution of 0.001m + int bottom_lup = static_cast (std::ceil( (depth_val) * 300)); // has resolution of 0.001m if (bottom_lup > 300) { bottom_lup =300; @@ -808,7 +808,7 @@ pcl::simulation::RangeLikelihood::addNoise () float bins = 470; for (int i = 0; i < camera_width_*camera_height_ ; i++) { - depth_buffer_[i] = ceil (depth_buffer_[i]*bins)/bins; + depth_buffer_[i] = std::ceil (depth_buffer_[i]*bins)/bins; } cout << "in add noise\n"; } diff --git a/simulation/tools/sim_viewer.cpp b/simulation/tools/sim_viewer.cpp index c277d3102bc..75d88bd5797 100644 --- a/simulation/tools/sim_viewer.cpp +++ b/simulation/tools/sim_viewer.cpp @@ -491,13 +491,13 @@ main (int argc, char** argv) if (!p_file_indices.empty ()) { y_s = static_cast(floor (sqrt (static_cast(p_file_indices.size ())))); - x_s = y_s + static_cast(ceil ((p_file_indices.size () / static_cast(y_s)) - y_s)); + x_s = y_s + static_cast(std::ceil ((p_file_indices.size () / static_cast(y_s)) - y_s)); print_highlight ("Preparing to load "); print_value ("%d", p_file_indices.size ()); } else if (!vtk_file_indices.empty ()) { y_s = static_cast(floor (sqrt (static_cast(vtk_file_indices.size ())))); - x_s = y_s + static_cast(ceil ((vtk_file_indices.size () / static_cast(y_s)) - y_s)); + x_s = y_s + static_cast(std::ceil ((vtk_file_indices.size () / static_cast(y_s)) - y_s)); print_highlight ("Preparing to load "); print_value ("%d", vtk_file_indices.size ()); } diff --git a/tools/pcd_viewer.cpp b/tools/pcd_viewer.cpp index fbca56df1c8..33072aaaa12 100644 --- a/tools/pcd_viewer.cpp +++ b/tools/pcd_viewer.cpp @@ -304,7 +304,7 @@ main (int argc, char** argv) print_highlight ("Multi-viewport rendering enabled.\n"); int y_s = static_cast(floor (sqrt (static_cast(p_file_indices.size () + vtk_file_indices.size ())))); - x_s = y_s + static_cast(ceil (double (p_file_indices.size () + vtk_file_indices.size ()) / double (y_s) - y_s)); + x_s = y_s + static_cast(std::ceil (double (p_file_indices.size () + vtk_file_indices.size ()) / double (y_s) - y_s)); if (!p_file_indices.empty ()) {