summaryrefslogtreecommitdiff
path: root/src/Cech_complex
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-03-27 14:01:50 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-03-27 14:01:50 +0000
commit7e3cfb3aad5ad38779e48f77dc2ba24014814dc9 (patch)
tree51958815e86cc9d1b4acd5ffa0bb1fceb099161b /src/Cech_complex
parent90ea210d07afa9c48a19cdad0621d607b4ebd54b (diff)
No more deep copy of the simplicial complex in the Cech Blocker, just use the pointer
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3307 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 026cd5491d8e3030fce63beabd6e77bddebb05cc
Diffstat (limited to 'src/Cech_complex')
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex.h2
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex_blocker.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/Cech_complex/include/gudhi/Cech_complex.h b/src/Cech_complex/include/gudhi/Cech_complex.h
index 7c2e31ac..1cae7b0b 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex.h
@@ -97,7 +97,7 @@ class Cech_complex {
complex.insert_graph(cech_skeleton_graph_);
// expand the graph until dimension dim_max
complex.expansion_with_blockers(dim_max,
- Cech_blocker<SimplicialComplexForCechComplex, ForwardPointRange>(complex, this));
+ Cech_blocker<SimplicialComplexForCechComplex, ForwardPointRange>(&complex, this));
}
/** @return max_radius value given at construction. */
diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
index c082815d..6755c826 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
@@ -68,7 +68,7 @@ class Cech_blocker {
* \return true if the simplex radius is greater than the Cech_complex max_radius*/
bool operator()(Simplex_handle sh) {
Point_cloud points;
- for (auto vertex : simplicial_complex_.simplex_vertex_range(sh)) {
+ 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()));
#ifdef DEBUG_TRACES
@@ -80,17 +80,17 @@ class Cech_blocker {
if (radius > cc_ptr_->max_radius())
std::cout << "radius > max_radius => expansion is blocked\n";
#endif // DEBUG_TRACES
- simplicial_complex_.assign_filtration(sh, radius);
+ sc_ptr_->assign_filtration(sh, radius);
return (radius > cc_ptr_->max_radius());
}
/** \internal \brief Cech complex blocker constructor. */
- Cech_blocker(SimplicialComplexForCech& simplicial_complex, Cech_complex* cc_ptr)
- : simplicial_complex_(simplicial_complex),
+ Cech_blocker(SimplicialComplexForCech* sc_ptr, Cech_complex* cc_ptr)
+ : sc_ptr_(sc_ptr),
cc_ptr_(cc_ptr) {
}
private:
- SimplicialComplexForCech simplicial_complex_;
+ SimplicialComplexForCech* sc_ptr_;
Cech_complex* cc_ptr_;
};