summaryrefslogtreecommitdiff
path: root/src/Subsampling
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-10-06 15:23:28 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-10-06 15:23:28 +0000
commit3ed1e6ab9d5c122427e0a7308bd5b5a2d49d7557 (patch)
treee051bda478c97e7ab1d6ed1ae2115830bb618f34 /src/Subsampling
parentad4a82843c8268a9e9d12e607a13ee323831b597 (diff)
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
Diffstat (limited to 'src/Subsampling')
-rw-r--r--src/Subsampling/include/gudhi/sparsify_point_set.h28
1 files changed, 12 insertions, 16 deletions
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 <http://www.gnu.org/licenses/>.
*/
-#ifndef GUDHI_SPARSIFY_POINT_SET_H
-#define GUDHI_SPARSIFY_POINT_SET_H
+#ifndef SPARSIFY_POINT_SET_H_
+#define SPARSIFY_POINT_SET_H_
#include <gudhi/Kd_tree_search.h>
#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_