diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-10-10 11:34:43 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-10-10 11:34:43 +0000 |
commit | ed75f1b32ee06bacbc547bab36ccd0915275421f (patch) | |
tree | e466450aac155714d544dac6e544ba4dd8b91923 /src/Subsampling | |
parent | d1ec002edb5b3e1d72770418e55665cca58131c9 (diff) | |
parent | 6c9380e336455169a93cd384168f00c737a5ec27 (diff) |
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1683 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: d4af11158b5de9422f9c9820176ff10f41f89cbe
Diffstat (limited to 'src/Subsampling')
-rw-r--r-- | src/Subsampling/doc/Intro_subsampling.h | 2 | ||||
-rw-r--r-- | src/Subsampling/example/CMakeLists.txt | 22 | ||||
-rw-r--r-- | src/Subsampling/example/example_choose_n_farthest_points.cpp | 16 | ||||
-rw-r--r-- | src/Subsampling/example/example_pick_n_random_points.cpp | 16 | ||||
-rw-r--r-- | src/Subsampling/example/example_sparsify_point_set.cpp | 16 | ||||
-rw-r--r-- | src/Subsampling/include/gudhi/choose_n_farthest_points.h | 149 | ||||
-rw-r--r-- | src/Subsampling/include/gudhi/pick_n_random_points.h | 74 | ||||
-rw-r--r-- | src/Subsampling/include/gudhi/sparsify_point_set.h | 42 | ||||
-rw-r--r-- | src/Subsampling/test/CMakeLists.txt | 20 | ||||
-rw-r--r-- | src/Subsampling/test/test_choose_n_farthest_points.cpp | 9 | ||||
-rw-r--r-- | src/Subsampling/test/test_sparsify_point_set.cpp | 4 |
11 files changed, 179 insertions, 191 deletions
diff --git a/src/Subsampling/doc/Intro_subsampling.h b/src/Subsampling/doc/Intro_subsampling.h index f8eb2fdd..c84616dd 100644 --- a/src/Subsampling/doc/Intro_subsampling.h +++ b/src/Subsampling/doc/Intro_subsampling.h @@ -34,7 +34,7 @@ namespace subsampling { * * @{ * - * \section introduction Introduction + * \section subsamplingintroduction Introduction * * This Gudhi component offers methods to subsample a set of points. * diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index 81b39d6e..54349f0c 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -3,20 +3,18 @@ project(Subsampling_examples) if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - if (EIGEN3_FOUND) + add_executable(Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp) + add_executable(Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp) + add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) + target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY}) - add_executable(Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp) - add_executable(Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp) - add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) - target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY}) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") + add_test(Subsampling_example_pick_n_random_points + ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_example_pick_n_random_points) + add_test(Subsampling_example_choose_n_farthest_points + ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_example_choose_n_farthest_points) + add_test(Subsampling_example_sparsify_point_set + ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_example_sparsify_point_set) endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling examples. Version 4.8.1 is required.") endif () -else() - message(WARNING "CGAL not found. It is required for the Subsampling examples.") endif() diff --git a/src/Subsampling/example/example_choose_n_farthest_points.cpp b/src/Subsampling/example/example_choose_n_farthest_points.cpp index 9955d0ec..533aba74 100644 --- a/src/Subsampling/example/example_choose_n_farthest_points.cpp +++ b/src/Subsampling/example/example_choose_n_farthest_points.cpp @@ -3,21 +3,19 @@ #include <CGAL/Epick_d.h> #include <CGAL/Random.h> -#include <array> #include <vector> #include <iterator> -int main (void) -{ - typedef CGAL::Epick_d<CGAL::Dimension_tag<4> > K; - typedef typename K::FT FT; - typedef typename K::Point_d Point_d; - +int main(void) { + typedef CGAL::Epick_d<CGAL::Dimension_tag<4> > K; + typedef typename K::Point_d Point_d; + CGAL::Random rd; std::vector<Point_d> points; - for (int i = 0 ; i < 500 ; ++i) - points.push_back(Point_d(std::array<FT,4>({rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1)}))); + for (int i = 0; i < 500; ++i) + points.push_back(Point_d(rd.get_double(-1., 1), rd.get_double(-1., 1), + rd.get_double(-1., 1), rd.get_double(-1., 1))); K k; std::vector<Point_d> results; diff --git a/src/Subsampling/example/example_pick_n_random_points.cpp b/src/Subsampling/example/example_pick_n_random_points.cpp index d2f063ba..1e38e405 100644 --- a/src/Subsampling/example/example_pick_n_random_points.cpp +++ b/src/Subsampling/example/example_pick_n_random_points.cpp @@ -3,21 +3,19 @@ #include <CGAL/Epick_d.h> #include <CGAL/Random.h> -#include <array> #include <vector> #include <iterator> -int main (void) -{ - typedef CGAL::Epick_d<CGAL::Dimension_tag<4> > K; - typedef typename K::FT FT; - typedef typename K::Point_d Point_d; - +int main(void) { + typedef CGAL::Epick_d<CGAL::Dimension_tag<4> > K; + typedef typename K::Point_d Point_d; + CGAL::Random rd; std::vector<Point_d> points; - for (int i = 0 ; i < 500 ; ++i) - points.push_back(Point_d(std::array<FT,4>({rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1)}))); + for (int i = 0; i < 500; ++i) + points.push_back(Point_d(rd.get_double(-1., 1), rd.get_double(-1., 1), + rd.get_double(-1., 1), rd.get_double(-1., 1))); K k; std::vector<Point_d> results; diff --git a/src/Subsampling/example/example_sparsify_point_set.cpp b/src/Subsampling/example/example_sparsify_point_set.cpp index cb5ccf0b..b35a18d9 100644 --- a/src/Subsampling/example/example_sparsify_point_set.cpp +++ b/src/Subsampling/example/example_sparsify_point_set.cpp @@ -3,21 +3,19 @@ #include <CGAL/Epick_d.h> #include <CGAL/Random.h> -#include <array> #include <vector> #include <iterator> -int main (void) -{ - typedef CGAL::Epick_d<CGAL::Dimension_tag<4> > K; - typedef typename K::FT FT; - typedef typename K::Point_d Point_d; - +int main(void) { + typedef CGAL::Epick_d<CGAL::Dimension_tag<4> > K; + typedef typename K::Point_d Point_d; + CGAL::Random rd; std::vector<Point_d> points; - for (int i = 0 ; i < 500 ; ++i) - points.push_back(Point_d(std::array<FT,4>({rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1)}))); + for (int i = 0; i < 500; ++i) + points.push_back(Point_d(rd.get_double(-1., 1), rd.get_double(-1., 1), + rd.get_double(-1., 1), rd.get_double(-1., 1))); K k; std::vector<Point_d> results; diff --git a/src/Subsampling/include/gudhi/choose_n_farthest_points.h b/src/Subsampling/include/gudhi/choose_n_farthest_points.h index 8bfb38a4..40c7808d 100644 --- a/src/Subsampling/include/gudhi/choose_n_farthest_points.h +++ b/src/Subsampling/include/gudhi/choose_n_farthest_points.h @@ -37,89 +37,86 @@ #include <algorithm> // for sort #include <vector> #include <random> +#include <limits> // for numeric_limits<> namespace Gudhi { namespace subsampling { - /** - * \ingroup subsampling - * \brief Subsample by a greedy strategy of iteratively adding the farthest point from the - * current chosen point set to the subsampling. - * The iteration starts with the landmark `starting point`. - * \details It chooses `final_size` points from a random access range `input_pts` and - * outputs it in the output iterator `output_it`. - * - */ - - template < typename Kernel, - typename Point_container, - typename OutputIterator> - void choose_n_farthest_points( Kernel const &k, - Point_container const &input_pts, - unsigned final_size, - unsigned starting_point, - OutputIterator output_it) - { - typename Kernel::Squared_distance_d sqdist = k.squared_distance_d_object(); - - int nb_points = boost::size(input_pts); - assert(nb_points >= final_size); - - unsigned current_number_of_landmarks = 0; // counter for landmarks + +/** + * \ingroup subsampling + * \brief Subsample by a greedy strategy of iteratively adding the farthest point from the + * current chosen point set to the subsampling. + * The iteration starts with the landmark `starting point`. + * \details It chooses `final_size` points from a random access range `input_pts` and + * outputs it in the output iterator `output_it`. + * + */ +template < typename Kernel, +typename Point_container, +typename OutputIterator> +void choose_n_farthest_points(Kernel const &k, + Point_container const &input_pts, + std::size_t final_size, + std::size_t starting_point, + OutputIterator output_it) { + typename Kernel::Squared_distance_d sqdist = k.squared_distance_d_object(); + + std::size_t nb_points = boost::size(input_pts); + assert(nb_points >= final_size); + + std::size_t current_number_of_landmarks = 0; // counter for landmarks + const double infty = std::numeric_limits<double>::infinity(); // infinity (see next entry) + std::vector< double > dist_to_L(nb_points, infty); // vector of current distances to L from input_pts + + std::size_t curr_max_w = starting_point; + + for (current_number_of_landmarks = 0; current_number_of_landmarks != final_size; current_number_of_landmarks++) { + // curr_max_w at this point is the next landmark + *output_it++ = input_pts[curr_max_w]; + std::size_t i = 0; + 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; + ++i; + } + // choose the next curr_max_w double curr_max_dist = 0; // used for defining the furhest point from L - const double infty = std::numeric_limits<double>::infinity(); // infinity (see next entry) - std::vector< double > dist_to_L(nb_points, infty); // vector of current distances to L from input_pts - - int curr_max_w = starting_point; - - for (current_number_of_landmarks = 0; current_number_of_landmarks != final_size; current_number_of_landmarks++) { - // curr_max_w at this point is the next landmark - *output_it++ = input_pts[curr_max_w]; - // std::cout << curr_max_w << "\n"; - unsigned i = 0; - 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; - ++i; + for (i = 0; i < dist_to_L.size(); i++) + if (dist_to_L[i] > curr_max_dist) { + curr_max_dist = dist_to_L[i]; + curr_max_w = i; } - // choose the next curr_max_w - curr_max_dist = 0; - for (i = 0; i < dist_to_L.size(); i++) - if (dist_to_L[i] > curr_max_dist) { - curr_max_dist = dist_to_L[i]; - curr_max_w = i; - } - } - } - - /** - * \ingroup subsampling - * \brief Subsample by a greedy strategy of iteratively adding the farthest point from the - * current chosen point set to the subsampling. - * The iteration starts with a random landmark. - * \details It chooses `final_size` points from a random access range `input_pts` and - * outputs it in the output iterator `output_it`. - * - */ - template < typename Kernel, - typename Point_container, - typename OutputIterator> - void choose_n_farthest_points( Kernel& k, - Point_container const &input_pts, - int final_size, - OutputIterator output_it) - { - // Choose randomly the first landmark - std::random_device rd; - std::mt19937 gen(rd()); - std::uniform_int_distribution<> dis(1, 6); - int starting_point = dis(gen); - choose_n_farthest_points(k, input_pts, final_size, starting_point, output_it); } - -} // namespace subsampling - +} + +/** + * \ingroup subsampling + * \brief Subsample by a greedy strategy of iteratively adding the farthest point from the + * current chosen point set to the subsampling. + * The iteration starts with a random landmark. + * \details It chooses `final_size` points from a random access range `input_pts` and + * outputs it in the output iterator `output_it`. + * + */ +template < typename Kernel, +typename Point_container, +typename OutputIterator> +void choose_n_farthest_points(Kernel const& k, + Point_container const &input_pts, + unsigned final_size, + OutputIterator output_it) { + // Choose randomly the first landmark + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(1, 6); + int starting_point = dis(gen); + choose_n_farthest_points(k, input_pts, final_size, starting_point, output_it); +} + +} // namespace subsampling + } // namespace Gudhi #endif // CHOOSE_N_FARTHEST_POINTS_H_ diff --git a/src/Subsampling/include/gudhi/pick_n_random_points.h b/src/Subsampling/include/gudhi/pick_n_random_points.h index 4ca1fafc..e89b2b2d 100644 --- a/src/Subsampling/include/gudhi/pick_n_random_points.h +++ b/src/Subsampling/include/gudhi/pick_n_random_points.h @@ -20,63 +20,65 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef PICK_RANDOM_POINTS_H_ -#define PICK_RANDOM_POINTS_H_ +#ifndef PICK_N_RANDOM_POINTS_H_ +#define PICK_N_RANDOM_POINTS_H_ + +#include <gudhi/Clock.h> #include <boost/range/size.hpp> +#include <cstddef> #include <random> // random_device, mt19937 #include <algorithm> // shuffle #include <numeric> // iota #include <iterator> -#include <gudhi/Clock.h> +#include <vector> namespace Gudhi { namespace subsampling { - - /** - * \ingroup subsampling - * \brief Subsample a point set by picking random vertices. - * - * \details It chooses `final_size` distinct points from a random access range `points` - * and outputs them to the output iterator `output_it`. - * Point_container::iterator should be ValueSwappable and RandomAccessIterator. - */ - - template <typename Point_container, - typename OutputIterator> - void pick_n_random_points(Point_container const &points, - unsigned final_size, + +/** + * \ingroup subsampling + * \brief Subsample a point set by picking random vertices. + * + * \details It chooses `final_size` distinct points from a random access range `points` + * and outputs them to the output iterator `output_it`. + * Point_container::iterator should be ValueSwappable and RandomAccessIterator. + */ +template <typename Point_container, +typename OutputIterator> +void pick_n_random_points(Point_container const &points, + std::size_t final_size, OutputIterator output_it) { #ifdef GUDHI_SUBS_PROFILING - Gudhi::Clock t; + Gudhi::Clock t; #endif - unsigned nbP = boost::size(points); - assert(nbP >= final_size); - std::vector<int> landmarks(nbP); - std::iota(landmarks.begin(), landmarks.end(), 0); + std::size_t nbP = boost::size(points); + assert(nbP >= final_size); + std::vector<int> landmarks(nbP); + std::iota(landmarks.begin(), landmarks.end(), 0); + + std::random_device rd; + std::mt19937 g(rd()); - std::random_device rd; - std::mt19937 g(rd()); - - std::shuffle(landmarks.begin(), landmarks.end(), g); - landmarks.resize(final_size); + std::shuffle(landmarks.begin(), landmarks.end(), g); + landmarks.resize(final_size); + + for (int l : landmarks) + *output_it++ = points[l]; - for (int l: landmarks) - *output_it++ = points[l]; - #ifdef GUDHI_SUBS_PROFILING - t.end(); - std::cerr << "Random landmark choice took " << t.num_seconds() + t.end(); + std::cerr << "Random landmark choice took " << t.num_seconds() << " seconds." << std::endl; #endif - } +} + +} // namespace subsampling -} // namesapce subsampling - } // namespace Gudhi -#endif // PICK_RANDOM_POINTS_H_ +#endif // PICK_N_RANDOM_POINTS_H_ diff --git a/src/Subsampling/include/gudhi/sparsify_point_set.h b/src/Subsampling/include/gudhi/sparsify_point_set.h index 607555b4..7ff11b4c 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 @@ -32,6 +32,7 @@ #include <vector> namespace Gudhi { + namespace subsampling { /** @@ -54,16 +55,14 @@ namespace subsampling { * @param[in] min_squared_dist Minimum squared distance separating the output points. * @param[out] output_it The output iterator. */ - template <typename Kernel, typename Point_range, typename OutputIterator> void sparsify_point_set( - const Kernel &k, Point_range const& input_pts, - typename Kernel::FT min_squared_dist, - OutputIterator output_it) -{ + const Kernel &k, Point_range const& input_pts, + typename Kernel::FT min_squared_dist, + OutputIterator output_it) { typedef typename Gudhi::spatial_searching::Kd_tree_search< - Kernel, Point_range> Points_ds; + Kernel, Point_range> Points_ds; typename Kernel::Squared_distance_d sqdist = k.squared_distance_d_object(); @@ -78,10 +77,9 @@ sparsify_point_set( // Parse the input points, and add them if they are not too close to // the other points 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) - { + for (typename Point_range::const_iterator it_pt = input_pts.begin(); + it_pt != input_pts.end(); + ++it_pt, ++pt_idx) { if (dropped_points[pt_idx]) continue; @@ -90,30 +88,28 @@ 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; + } } } #ifdef GUDHI_SUBSAMPLING_PROFILING t.end(); std::cerr << "Point set sparsified in " << t.num_seconds() - << " seconds." << std::endl; + << " seconds." << std::endl; #endif } -} // namespace subsampling -} // namespace Gudhi +} // namespace subsampling +} // namespace Gudhi -#endif // GUDHI_POINT_CLOUD_H +#endif // SPARSIFY_POINT_SET_H_ diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 91d4ed8f..3a2fb649 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -12,8 +12,6 @@ endif() if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - if (EIGEN3_FOUND) add_executable( Subsampling_test_pick_n_random_points test_pick_n_random_points.cpp ) target_link_libraries(Subsampling_test_pick_n_random_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) @@ -23,12 +21,18 @@ if(CGAL_FOUND) add_executable(Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) target_link_libraries(Subsampling_test_sparsify_point_set ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") + + add_test(Subsampling_test_pick_n_random_points ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_test_pick_n_random_points + # XML format for Jenkins xUnit plugin + --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Subsampling_test_pick_n_random_points_UT.xml --log_level=test_suite --report_level=no) + + add_test(Subsampling_test_choose_n_farthest_points ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_test_choose_n_farthest_points + # XML format for Jenkins xUnit plugin + --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Subsampling_test_choose_n_farthest_points_UT.xml --log_level=test_suite --report_level=no) + + add_test(Subsampling_test_sparsify_point_set ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_test_sparsify_point_set + # XML format for Jenkins xUnit plugin + --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Subsampling_test_sparsify_point_set_UT.xml --log_level=test_suite --report_level=no) endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling tests. Version 4.8.1 is required.") endif () -else() - message(WARNING "CGAL not found. It is required for the Subsampling tests.") endif() diff --git a/src/Subsampling/test/test_choose_n_farthest_points.cpp b/src/Subsampling/test/test_choose_n_farthest_points.cpp index f79a4dfb..d064899a 100644 --- a/src/Subsampling/test/test_choose_n_farthest_points.cpp +++ b/src/Subsampling/test/test_choose_n_farthest_points.cpp @@ -35,10 +35,9 @@ #include <CGAL/Epick_d.h> -typedef CGAL::Epick_d<CGAL::Dynamic_dimension_tag> K; -typedef typename K::FT FT; -typedef typename K::Point_d Point_d; - +typedef CGAL::Epick_d<CGAL::Dynamic_dimension_tag> K; +typedef typename K::FT FT; +typedef typename K::Point_d Point_d; BOOST_AUTO_TEST_CASE(test_choose_farthest_point) { std::vector< Point_d > points, landmarks; @@ -52,6 +51,6 @@ BOOST_AUTO_TEST_CASE(test_choose_farthest_point) { landmarks.clear(); K k; Gudhi::subsampling::choose_n_farthest_points(k, points, 100, std::back_inserter(landmarks)); - + BOOST_CHECK(landmarks.size() == 100); } diff --git a/src/Subsampling/test/test_sparsify_point_set.cpp b/src/Subsampling/test/test_sparsify_point_set.cpp index 61f6fa18..f993d6d6 100644 --- a/src/Subsampling/test/test_sparsify_point_set.cpp +++ b/src/Subsampling/test/test_sparsify_point_set.cpp @@ -29,21 +29,19 @@ #include <CGAL/Epick_d.h> #include <CGAL/Random.h> -#include <array> #include <vector> #include <iterator> BOOST_AUTO_TEST_CASE(test_sparsify_point_set) { typedef CGAL::Epick_d<CGAL::Dimension_tag<4> > K; - typedef typename K::FT FT; typedef typename K::Point_d Point_d; CGAL::Random rd; std::vector<Point_d> points; for (int i = 0 ; i < 500 ; ++i) - points.push_back(Point_d(std::array<FT,4>({rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1)}))); + points.push_back(Point_d(rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1))); K k; std::vector<Point_d> results; |