From 3ed1e6ab9d5c122427e0a7308bd5b5a2d49d7557 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 6 Oct 2016 15:23:28 +0000 Subject: Fix cpplint git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1661 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 880ca1a8686938b8ce5f0498848583fa258df4a0 --- src/Subsampling/include/gudhi/sparsify_point_set.h | 28 ++++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'src/Subsampling/include/gudhi') diff --git a/src/Subsampling/include/gudhi/sparsify_point_set.h b/src/Subsampling/include/gudhi/sparsify_point_set.h index 607555b4..edb9869b 100644 --- a/src/Subsampling/include/gudhi/sparsify_point_set.h +++ b/src/Subsampling/include/gudhi/sparsify_point_set.h @@ -20,8 +20,8 @@ * along with this program. If not, see . */ -#ifndef GUDHI_SPARSIFY_POINT_SET_H -#define GUDHI_SPARSIFY_POINT_SET_H +#ifndef SPARSIFY_POINT_SET_H_ +#define SPARSIFY_POINT_SET_H_ #include #ifdef GUDHI_SUBSAMPLING_PROFILING @@ -60,8 +60,7 @@ void sparsify_point_set( const Kernel &k, Point_range const& input_pts, typename Kernel::FT min_squared_dist, - OutputIterator output_it) -{ + OutputIterator output_it) { typedef typename Gudhi::spatial_searching::Kd_tree_search< Kernel, Point_range> Points_ds; @@ -80,8 +79,7 @@ sparsify_point_set( std::size_t pt_idx = 0; for (typename Point_range::const_iterator it_pt = input_pts.begin() ; it_pt != input_pts.end(); - ++it_pt, ++pt_idx) - { + ++it_pt, ++pt_idx) { if (dropped_points[pt_idx]) continue; @@ -90,19 +88,17 @@ sparsify_point_set( auto ins_range = points_ds.query_incremental_nearest_neighbors(*it_pt); // If another point Q is closer that min_squared_dist, mark Q to be dropped - for (auto const& neighbor : ins_range) - { + for (auto const& neighbor : ins_range) { std::size_t neighbor_point_idx = neighbor.first; // If the neighbor is too close, we drop the neighbor - if (neighbor.second < min_squared_dist) - { - // N.B.: If neighbor_point_idx < pt_idx, + if (neighbor.second < min_squared_dist) { + // N.B.: If neighbor_point_idx < pt_idx, // dropped_points[neighbor_point_idx] is already true but adding a // test doesn't make things faster, so why bother? dropped_points[neighbor_point_idx] = true; - } - else + } else { break; + } } } @@ -113,7 +109,7 @@ sparsify_point_set( #endif } -} // namespace subsampling -} // namespace Gudhi +} // namespace subsampling +} // namespace Gudhi -#endif // GUDHI_POINT_CLOUD_H +#endif // SPARSIFY_POINT_SET_H_ -- cgit v1.2.3