summaryrefslogtreecommitdiff
path: root/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-04-10 14:53:20 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-04-10 14:53:20 +0000
commit51ce9b513116f5fed2b4dc109f0b52595a2cd538 (patch)
tree89e4b98cc9aeb0184c28bbc0f1f2d21734831e95 /src/Cech_complex/include/gudhi/Cech_complex_blocker.h
parent97460e6058ab032fefb13289eb29c97d4d106bf8 (diff)
Code review : Cech_blocker was hardcoding double
replace point_iterator function in a get_point const function that returns a Point InputPointRange description Cech blocker is now templated with Cech complex, which is no more included. Deep copy of the point cloud on Cech complex ctor git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3365 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 93e3cf3fe61290b88a0714b9e55ad80e01a34f36
Diffstat (limited to 'src/Cech_complex/include/gudhi/Cech_complex_blocker.h')
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex_blocker.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
index ab56c10d..2ecef9cf 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
@@ -23,7 +23,6 @@
#ifndef CECH_COMPLEX_BLOCKER_H_
#define CECH_COMPLEX_BLOCKER_H_
-#include <gudhi/Cech_complex.h> // Cech_blocker is using a pointer on Gudhi::cech_complex::Cech_complex
#include <gudhi/distance_functions.h> // for Gudhi::Minimal_enclosing_ball_radius
#include <iostream>
@@ -34,10 +33,6 @@ namespace Gudhi {
namespace cech_complex {
-// Just declaring Cech_complex class because used and not yet defined.
-template<typename SimplicialComplexForCechComplex, typename InputPointRange>
-class Cech_complex;
-
/** \internal
* \class Cech_blocker
* \brief Cech complex blocker.
@@ -52,14 +47,13 @@ class Cech_complex;
*
* \tparam InputPointRange is required by the pointer on Chech_complex for type definition.
*/
-template <typename SimplicialComplexForCech, typename InputPointRange>
+template <typename SimplicialComplexForCech, typename Cech_complex>
class Cech_blocker {
private:
- using Point = std::vector<double>;
- using Point_cloud = std::vector<Point>;
+ using Point_cloud = typename Cech_complex::Point_cloud;
+
using Simplex_handle = typename SimplicialComplexForCech::Simplex_handle;
using Filtration_value = typename SimplicialComplexForCech::Filtration_value;
- using Cech_complex = Gudhi::cech_complex::Cech_complex<SimplicialComplexForCech, InputPointRange>;
public:
/** \internal \brief Cech complex blocker operator() - the oracle - assigns the filtration value from the simplex
@@ -69,8 +63,7 @@ class Cech_blocker {
bool operator()(Simplex_handle sh) {
Point_cloud points;
for (auto vertex : sc_ptr_->simplex_vertex_range(sh)) {
- points.push_back(Point(cc_ptr_->point_iterator(vertex)->begin(),
- cc_ptr_->point_iterator(vertex)->end()));
+ points.push_back(cc_ptr_->get_point(vertex));
#ifdef DEBUG_TRACES
std::cout << "#(" << vertex << ")#";
#endif // DEBUG_TRACES