summaryrefslogtreecommitdiff
path: root/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
diff options
context:
space:
mode:
authorHind-M <hind.montassif@gmail.com>2022-06-30 09:59:23 +0200
committerHind-M <hind.montassif@gmail.com>2022-06-30 09:59:23 +0200
commit0b61062f68f5dde2e56e50f266a3f364ac39e86f (patch)
treea64daf431699272a9accdc2179634fc414a99220 /src/Cech_complex/include/gudhi/Cech_complex_blocker.h
parentcedd589258ef2e7c3c65d7a7db88b590f58c3d83 (diff)
Assign to sh same key as face in cech
Diffstat (limited to 'src/Cech_complex/include/gudhi/Cech_complex_blocker.h')
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex_blocker.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
index 1bb205b3..68a9f726 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
@@ -54,6 +54,7 @@ class Cech_blocker {
using Simplex_handle = typename SimplicialComplexForCech::Simplex_handle;
using Filtration_value = typename SimplicialComplexForCech::Filtration_value;
+ using Simplex_key = typename SimplicialComplexForCech::Simplex_key;
template<class PointIterator>
Sphere get_sphere(PointIterator begin, PointIterator end) const {
@@ -78,8 +79,10 @@ class Cech_blocker {
for (auto face_opposite_vertex : sc_ptr_->boundary_opposite_vertex_simplex_range(sh)) {
Sphere sph;
auto k = sc_ptr_->key(face_opposite_vertex.first);
+ Simplex_key sph_key;
if(k != sc_ptr_->null_key()) {
sph = cc_ptr_->get_cache().at(k);
+ sph_key = k;
}
else {
Point_cloud face_points;
@@ -92,6 +95,7 @@ class Cech_blocker {
sph = get_sphere(face_points.cbegin(), face_points.cend());
// Put edge sphere in cache
sc_ptr_->assign_key(face_opposite_vertex.first, cc_ptr_->get_cache().size());
+ sph_key = cc_ptr_->get_cache().size();
cc_ptr_->get_cache().push_back(sph);
// Clear face_points
face_points.clear();
@@ -106,8 +110,7 @@ class Cech_blocker {
if(exact_) CGAL::exact(sph.second);
#endif
radius = std::sqrt(cast_to_fv(sph.second));
- sc_ptr_->assign_key(sh, cc_ptr_->get_cache().size());
- cc_ptr_->get_cache().push_back(sph);
+ sc_ptr_->assign_key(sh, sph_key);
break;
}
}