summaryrefslogtreecommitdiff
path: root/src/Rips_complex
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
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')
-rw-r--r--src/Rips_complex/doc/Intro_rips_complex.h4
-rw-r--r--src/Rips_complex/include/gudhi/Sparse_rips_complex.h5
-rw-r--r--src/Rips_complex/utilities/README12
3 files changed, 12 insertions, 9 deletions
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 &epsilon;).
*
* 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
```