From 91b0ff839b8058d3f5767e6ed80b93c23be2c98a Mon Sep 17 00:00:00 2001 From: Hind-M Date: Mon, 9 Aug 2021 16:21:24 +0200 Subject: First version of cech enhancement --- src/Cech_complex/include/gudhi/Cech_complex.h | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/Cech_complex/include/gudhi/Cech_complex.h') diff --git a/src/Cech_complex/include/gudhi/Cech_complex.h b/src/Cech_complex/include/gudhi/Cech_complex.h index b0871e10..2c6f202a 100644 --- a/src/Cech_complex/include/gudhi/Cech_complex.h +++ b/src/Cech_complex/include/gudhi/Cech_complex.h @@ -40,7 +40,7 @@ namespace cech_complex { * \tparam ForwardPointRange must be a range for which `std::begin()` and `std::end()` methods return input * iterators on a point. `std::begin()` and `std::end()` methods are also required for a point. */ -template +template class Cech_complex { private: // Required by compute_proximity_graph @@ -49,14 +49,15 @@ class Cech_complex { using Proximity_graph = Gudhi::Proximity_graph; // Retrieve Coordinate type from ForwardPointRange - using Point_from_range_iterator = typename boost::range_const_iterator::type; - using Point_from_range = typename std::iterator_traits::value_type; - using Coordinate_iterator = typename boost::range_const_iterator::type; - using Coordinate = typename std::iterator_traits::value_type; +// using Point_from_range_iterator = typename boost::range_const_iterator::type; +// using Point_from_range = typename std::iterator_traits::value_type; +// using Coordinate_iterator = typename boost::range_const_iterator::type; +// using Coordinate = typename std::iterator_traits::value_type; public: // Point and Point_cloud type definition - using Point = std::vector; + //using Point = std::vector; + using Point = typename Kernel::Point_d; using Point_cloud = std::vector; public: @@ -70,9 +71,13 @@ class Cech_complex { */ Cech_complex(const ForwardPointRange& points, Filtration_value max_radius) : max_radius_(max_radius) { // Point cloud deep copy - point_cloud_.reserve(boost::size(points)); - for (auto&& point : points) point_cloud_.emplace_back(std::begin(point), std::end(point)); +// point_cloud_.reserve(boost::size(points)); +// for (auto&& point : points) point_cloud_.emplace_back(point.cartesian_begin(), point.cartesian_end()); + + point_cloud_.assign(points.begin(), points.end()); + + std::clog << "Hind: Just before the graph compute" << std::endl; cech_skeleton_graph_ = Gudhi::compute_proximity_graph( point_cloud_, max_radius_, Gudhi::Minimal_enclosing_ball_radius()); } @@ -87,14 +92,17 @@ class Cech_complex { */ template void create_complex(SimplicialComplexForCechComplex& complex, int dim_max) { + std::clog << "Hind: in create complex" << std::endl; GUDHI_CHECK(complex.num_vertices() == 0, std::invalid_argument("Cech_complex::create_complex - simplicial complex is not empty")); // insert the proximity graph in the simplicial complex + std::clog << "Hind: before insert_graph" << std::endl; complex.insert_graph(cech_skeleton_graph_); // expand the graph until dimension dim_max + std::clog << "Hind: before expansion_with_blockers" << std::endl; complex.expansion_with_blockers(dim_max, - Cech_blocker(&complex, this)); + Cech_blocker(&complex, this)); } /** @return max_radius value given at construction. */ -- cgit v1.2.3