summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-09-15 13:45:37 +0200
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-09-15 13:45:37 +0200
commit6db3b5db0f8b6dfae2b9b6eadb8bccdfdc613fb5 (patch)
treee770974e79d1c4f31874aeb1ce8e67f29ff8fe3a
parent53d09e2f7770f7e95d765d527712ef3c0758cf08 (diff)
This should be correct and efficient for 0-dimension weighted alpha
-rw-r--r--src/Alpha_complex/include/gudhi/Alpha_complex.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h
index f43cd071..b66ec20d 100644
--- a/src/Alpha_complex/include/gudhi/Alpha_complex.h
+++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h
@@ -436,8 +436,8 @@ class Alpha_complex {
// ### If filt(Sigma) is NaN : filt(Sigma) = alpha(Sigma)
if (std::isnan(complex.filtration(f_simplex))) {
Filtration_value alpha_complex_filtration = 0.0;
- // No need to compute squared_radius on a single point - alpha is 0.0
- if (f_simplex_dim > 0) {
+ // No need to compute squared_radius on a non-weighted single point - alpha is 0.0
+ if (Weighted || f_simplex_dim > 0) {
auto const& sqrad = radius(complex, f_simplex);
#if CGAL_VERSION_NR >= 1050000000
if(exact) CGAL::exact(sqrad);
@@ -450,14 +450,8 @@ class Alpha_complex {
#endif // DEBUG_TRACES
}
// No need to propagate further, unweighted points all have value 0
- if (decr_dim > 1)
+ if (decr_dim > !Weighted)
propagate_alpha_filtration(complex, f_simplex);
- // For weighted points, assign point weight as filtration value
- if (Weighted && decr_dim == 0) {
- Vertex_handle vertex = *(complex.simplex_vertex_range(f_simplex).begin());
- FT wght = Weight<Kernel, Weighted>()(get_point(vertex));
- complex.assign_filtration(f_simplex, cgal_converter(wght)*(-1.));
- }
}
}
old_cache_ = std::move(cache_);