diff options
Diffstat (limited to 'src/Subsampling')
-rw-r--r-- | src/Subsampling/doc/Intro_subsampling.h | 2 | ||||
-rw-r--r-- | src/Subsampling/include/gudhi/choose_n_farthest_points.h | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/Subsampling/doc/Intro_subsampling.h b/src/Subsampling/doc/Intro_subsampling.h index c84616dd..ab9cdc37 100644 --- a/src/Subsampling/doc/Intro_subsampling.h +++ b/src/Subsampling/doc/Intro_subsampling.h @@ -58,8 +58,6 @@ namespace subsampling { * This example outputs a subset of 100 points picked randomly. * * \include Subsampling/example_pick_n_random_points.cpp - * \copyright GNU General Public License v3. - * \verbatim Contact: gudhi-users@lists.gforge.inria.fr \endverbatim */ /** @} */ // end defgroup subsampling diff --git a/src/Subsampling/include/gudhi/choose_n_farthest_points.h b/src/Subsampling/include/gudhi/choose_n_farthest_points.h index 86500b28..8390b4c9 100644 --- a/src/Subsampling/include/gudhi/choose_n_farthest_points.h +++ b/src/Subsampling/include/gudhi/choose_n_farthest_points.h @@ -93,7 +93,7 @@ void choose_n_farthest_points(Kernel const &k, // Choose randomly the first landmark std::random_device rd; std::mt19937 gen(rd()); - std::uniform_int_distribution<std::size_t> dis(0, (input_pts.size() - 1)); + std::uniform_int_distribution<std::size_t> dis(0, nb_points - 1); starting_point = dis(gen); } @@ -110,7 +110,7 @@ void choose_n_farthest_points(Kernel const &k, *output_it++ = input_pts[curr_max_w]; *dist_it++ = dist_to_L[curr_max_w]; std::size_t i = 0; - for (auto& p : input_pts) { + for (auto&& p : input_pts) { double curr_dist = sqdist(p, *(std::begin(input_pts) + curr_max_w)); if (curr_dist < dist_to_L[i]) dist_to_L[i] = curr_dist; |