From 258439dfbe0d109b1ab26e9b60370cafdc78ac3e Mon Sep 17 00:00:00 2001 From: glisse Date: Tue, 30 Jan 2018 16:31:13 +0000 Subject: 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 --- src/Rips_complex/doc/Intro_rips_complex.h | 4 +++- src/Rips_complex/include/gudhi/Sparse_rips_complex.h | 5 +++-- src/Rips_complex/utilities/README | 12 ++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'src/Rips_complex') diff --git a/src/Rips_complex/doc/Intro_rips_complex.h b/src/Rips_complex/doc/Intro_rips_complex.h index 54afad66..a9cfc0ab 100644 --- a/src/Rips_complex/doc/Intro_rips_complex.h +++ b/src/Rips_complex/doc/Intro_rips_complex.h @@ -83,7 +83,9 @@ namespace rips_complex { * diagrams are at log-bottleneck distance at most ε). * * The sparse Rips filtration was introduced by Don Sheehy \cite - * sheehy13linear. We are using the version from \cite buchet16efficient. + * sheehy13linear. We are using the version from \cite buchet16efficient + * (except that we multiply all filtration values by 2, to match the usual + * Rips complex). * A more intuitive presentation of the idea is available in \cite * cavanna15geometric, and in a video \cite cavanna15visualizing. * 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_); diff --git a/src/Rips_complex/utilities/README b/src/Rips_complex/utilities/README index 40fc58ba..390e31f8 100644 --- a/src/Rips_complex/utilities/README +++ b/src/Rips_complex/utilities/README @@ -97,14 +97,14 @@ where `dim` is the dimension of the homological feature, `birth` and `death` are * `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals. **Example with Z/2Z coefficients** -`rips_persistence ../../data/points/tore3D_1307.off -e .5 -m .1 -d 3 -p 2` +`rips_persistence ../../data/points/tore3D_1307.off -e .5 -m .2 -d 3 -p 2` -outputs: +may output (there is randomness involved): ``` -The complex contains 16742034 simplices +The complex contains 17002096 simplices and has dimension 3 2 0 0 inf -2 1 0.0521735 0.645093 -2 2 0.0691677 0.289148 -2 1 0.0491747 0.265232 +2 1 0.104347 1.29343 +2 2 0.138335 0.577743 +2 1 0.0983494 0.529708 ``` -- cgit v1.2.3