diff options
author | Hind-M <hind.montassif@gmail.com> | 2021-08-09 16:21:24 +0200 |
---|---|---|
committer | Hind-M <hind.montassif@gmail.com> | 2021-08-09 16:21:24 +0200 |
commit | 91b0ff839b8058d3f5767e6ed80b93c23be2c98a (patch) | |
tree | ba6b3c36cb526bd6dd2544e3f608e6c00cb67241 /src/Cech_complex/include/gudhi/Cech_complex.h | |
parent | 2bd2f8134daeb65a9fff730fef75c323320faefb (diff) |
First version of cech enhancement
Diffstat (limited to 'src/Cech_complex/include/gudhi/Cech_complex.h')
-rw-r--r-- | src/Cech_complex/include/gudhi/Cech_complex.h | 26 |
1 files changed, 17 insertions, 9 deletions
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 <typename SimplicialComplexForProximityGraph, typename ForwardPointRange> +template <typename SimplicialComplexForProximityGraph, typename ForwardPointRange, typename Kernel> class Cech_complex { private: // Required by compute_proximity_graph @@ -49,14 +49,15 @@ class Cech_complex { using Proximity_graph = Gudhi::Proximity_graph<SimplicialComplexForProximityGraph>; // Retrieve Coordinate type from ForwardPointRange - using Point_from_range_iterator = typename boost::range_const_iterator<ForwardPointRange>::type; - using Point_from_range = typename std::iterator_traits<Point_from_range_iterator>::value_type; - using Coordinate_iterator = typename boost::range_const_iterator<Point_from_range>::type; - using Coordinate = typename std::iterator_traits<Coordinate_iterator>::value_type; +// using Point_from_range_iterator = typename boost::range_const_iterator<ForwardPointRange>::type; +// using Point_from_range = typename std::iterator_traits<Point_from_range_iterator>::value_type; +// using Coordinate_iterator = typename boost::range_const_iterator<Point_from_range>::type; +// using Coordinate = typename std::iterator_traits<Coordinate_iterator>::value_type; public: // Point and Point_cloud type definition - using Point = std::vector<Coordinate>; + //using Point = std::vector<Coordinate>; + using Point = typename Kernel::Point_d; using Point_cloud = std::vector<Point>; 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<SimplicialComplexForProximityGraph>( point_cloud_, max_radius_, Gudhi::Minimal_enclosing_ball_radius()); } @@ -87,14 +92,17 @@ class Cech_complex { */ template <typename SimplicialComplexForCechComplex> 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<SimplicialComplexForCechComplex, Cech_complex>(&complex, this)); + Cech_blocker<SimplicialComplexForCechComplex, Cech_complex, Kernel>(&complex, this)); } /** @return max_radius value given at construction. */ |