summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryuichi-ike <yuichi.ike.1990@gmail.com>2020-05-12 09:37:32 +0900
committeryuichi-ike <yuichi.ike.1990@gmail.com>2020-05-12 09:37:32 +0900
commit6c17494e02721ca826750155bac14c7f91a173fa (patch)
tree94caf6a3852dd82f8c1b13f4394ee02e3e52661f /src
parent5040c75893cb864f5e780b6644b8097f7beeb3a6 (diff)
reference and comments added
Diffstat (limited to 'src')
-rw-r--r--src/python/CMakeLists.txt4
-rw-r--r--src/python/doc/rips_complex_ref.rst4
-rw-r--r--src/python/gudhi/weighted_rips_complex.py6
-rw-r--r--src/python/test/test_weighted_rips.py4
4 files changed, 11 insertions, 7 deletions
diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index adf4923b..0aa55467 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -487,7 +487,9 @@ if(PYTHONINTERP_FOUND)
endif()
# Weighted Rips
- add_gudhi_py_test(test_weighted_rips)
+ if(SCIPY_FOUND)
+ add_gudhi_py_test(test_weighted_rips)
+ endif()
# Set missing or not modules
set(GUDHI_MODULES ${GUDHI_MODULES} "python" CACHE INTERNAL "GUDHI_MODULES")
diff --git a/src/python/doc/rips_complex_ref.rst b/src/python/doc/rips_complex_ref.rst
index 8fc7e1b0..3c25564a 100644
--- a/src/python/doc/rips_complex_ref.rst
+++ b/src/python/doc/rips_complex_ref.rst
@@ -25,7 +25,7 @@ Weighted Rips complex reference manual
.. automethod:: gudhi.WeightedRipsComplex.__init__
Basic examples
--------------
+--------------
The following example computes the weighted Rips filtration associated with a distance matrix and weights on vertices.
@@ -60,6 +60,8 @@ Combining with DistanceToMeasure, one can compute the DTM-filtration of a point
st = w_rips.create_simplex_tree(max_dimension=2)
print(st.persistence())
+The output is:
+
.. testoutput::
[(0, (3.1622776601683795, inf)), (0, (3.1622776601683795, 5.39834563766817)), (0, (3.1622776601683795, 5.39834563766817))]
diff --git a/src/python/gudhi/weighted_rips_complex.py b/src/python/gudhi/weighted_rips_complex.py
index 7401c428..bccac1ff 100644
--- a/src/python/gudhi/weighted_rips_complex.py
+++ b/src/python/gudhi/weighted_rips_complex.py
@@ -12,9 +12,9 @@ from gudhi import SimplexTree
class WeightedRipsComplex:
"""
Class to generate a weighted Rips complex from a distance matrix and weights on vertices,
- in the way described in the paper 'DTM-based filtrations' https://arxiv.org/abs/1811.04757.
- Remark that the filtration value of a vertex is twice of its weight for the consistency with
- RipsComplex, which is different from the definition in the paper.
+ in the way described in :cite:`dtmfiltrations`.
+ Remark that all the filtration values of vertices are twice of the given weights for the consistency
+ with RipsComplex, which is different from the definition in the paper.
"""
def __init__(self,
distance_matrix,
diff --git a/src/python/test/test_weighted_rips.py b/src/python/test/test_weighted_rips.py
index 59ec022a..7ef48333 100644
--- a/src/python/test/test_weighted_rips.py
+++ b/src/python/test/test_weighted_rips.py
@@ -35,8 +35,8 @@ def test_compatibility_with_rips():
([0, 2], 1.0),
([1, 3], 1.0),
([2, 3], 1.0),
- ([1, 2], 1.4142135623730951),
- ([0, 3], 1.4142135623730951),
+ ([1, 2], sqrt(2)),
+ ([0, 3], sqrt(2)),
]
def test_compatibility_with_filtered_rips():