summaryrefslogtreecommitdiff
path: root/src/Rips_complex/include/gudhi/Sparse_rips_complex.h
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-01-30 16:31:13 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-01-30 16:31:13 +0000
commit258439dfbe0d109b1ab26e9b60370cafdc78ac3e (patch)
treef0b65ee70b15d7591bb761f1a5b6c3a3a4110d29 /src/Rips_complex/include/gudhi/Sparse_rips_complex.h
parentc4a3e9ad811034c21d7664f5e47457d2b7ffb888 (diff)
Double all filtration values.
It was using the Cech convention, not the Rips, so the Rips approximation was not close to the Rips, which is likely to confuse users. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/sparserips-glisse@3188 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 7b948c956f39dc75931cb00a64516d08ff42e435
Diffstat (limited to 'src/Rips_complex/include/gudhi/Sparse_rips_complex.h')
-rw-r--r--src/Rips_complex/include/gudhi/Sparse_rips_complex.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Rips_complex/include/gudhi/Sparse_rips_complex.h b/src/Rips_complex/include/gudhi/Sparse_rips_complex.h
index e1e3a951..b8850d00 100644
--- a/src/Rips_complex/include/gudhi/Sparse_rips_complex.h
+++ b/src/Rips_complex/include/gudhi/Sparse_rips_complex.h
@@ -152,10 +152,11 @@ class Sparse_rips_complex {
GUDHI_CHECK(lj <= li, "Bad furthest point sorting");
Filtration_value alpha;
+ // The paper has d/2 and d-lj/e to match the Cech, but we use doubles to match the Rips
if(d * epsilon <= 2 * lj)
- alpha = d / 2;
+ alpha = d;
else if(d * epsilon <= li + lj && (epsilon >= 1 || d * epsilon <= lj * (1 + 1 / (1 - epsilon))))
- alpha = d - lj / epsilon;
+ alpha = (d - lj / epsilon) * 2;
else continue;
add_edge(pi, pj, alpha, graph_);