summaryrefslogtreecommitdiff
path: root/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
diff options
context:
space:
mode:
authorHind-M <hind.montassif@gmail.com>2022-07-05 18:30:36 +0200
committerHind-M <hind.montassif@gmail.com>2022-07-05 18:30:36 +0200
commit22dc06474f68832b2cf26c3ea64191ed9684e964 (patch)
tree69dd3c121c5a1d2b9f9339ab8e336aa4708a9ced /src/Cech_complex/include/gudhi/Cech_complex_blocker.h
parente854e1b2292de95ecdec021559926a1fba14659d (diff)
parent0505b97dd5dfa188a3d9ce421ca6992f06b13a16 (diff)
Merge remote-tracking branch 'upstream/master' into cech_opti
Diffstat (limited to 'src/Cech_complex/include/gudhi/Cech_complex_blocker.h')
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex_blocker.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
index 47b6c5e3..543f677e 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
@@ -74,6 +74,8 @@ class Cech_blocker {
CGAL::NT_converter<FT, Filtration_value> cast_to_fv;
Filtration_value radius = 0;
bool is_min_enclos_ball = false;
+ Point_cloud points;
+ points.reserve(sc_ptr_->dimension(sh)+1);
// for each face of simplex sh, test outsider point is indeed inside enclosing ball, if yes, take it and exit loop, otherwise, new sphere is circumsphere of all vertices
for (auto face_opposite_vertex : sc_ptr_->boundary_opposite_vertex_simplex_range(sh)) {
@@ -83,9 +85,8 @@ class Cech_blocker {
sph_key = k;
}
else {
- Point_cloud face_points;
for (auto vertex : sc_ptr_->simplex_vertex_range(face_opposite_vertex.first)) {
- face_points.push_back(cc_ptr_->get_point(vertex));
+ points.push_back(cc_ptr_->get_point(vertex));
#ifdef DEBUG_TRACES
std::clog << "#(" << vertex << ")#";
#endif // DEBUG_TRACES
@@ -93,9 +94,9 @@ class Cech_blocker {
// 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(get_sphere(face_points.cbegin(), face_points.cend()));
- // Clear face_points
- face_points.clear();
+ cc_ptr_->get_cache().push_back(get_sphere(points.cbegin(), points.cend()));
+ // Clear face points
+ points.clear();
}
// Check if the minimal enclosing ball of current face contains the extra point/opposite vertex
if (kernel_.squared_distance_d_object()(cc_ptr_->get_cache()[sph_key].first, cc_ptr_->get_point(face_opposite_vertex.second)) <= cc_ptr_->get_cache()[sph_key].second) {
@@ -113,7 +114,6 @@ class Cech_blocker {
}
// Spheres of each face don't contain the whole simplex
if(!is_min_enclos_ball) {
- Point_cloud points;
for (auto vertex : sc_ptr_->simplex_vertex_range(sh)) {
points.push_back(cc_ptr_->get_point(vertex));
}