diff options
author | yuichi-ike <yuichi.ike.1990@gmail.com> | 2020-05-26 18:22:14 +0900 |
---|---|---|
committer | yuichi-ike <yuichi.ike.1990@gmail.com> | 2020-05-26 18:22:14 +0900 |
commit | 55316205b2c7c2e3d7e3fe3ea92e20f3f8b29b11 (patch) | |
tree | 078909eee9a8bef9bed4631e5a795bd73299f980 /src/python/test | |
parent | 2ccc5ea97a5979f80fec93863da5549e4e6f2eea (diff) |
test fixed, documents modified
Diffstat (limited to 'src/python/test')
-rw-r--r-- | src/python/test/test_dtm_rips_complex.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/python/test/test_dtm_rips_complex.py b/src/python/test/test_dtm_rips_complex.py index 7cd2ad90..e1c0ee44 100644 --- a/src/python/test/test_dtm_rips_complex.py +++ b/src/python/test/test_dtm_rips_complex.py @@ -9,6 +9,7 @@ """ from gudhi.dtm_rips_complex import DTMRipsComplex +from gudhi import RipsComplex import numpy as np from math import sqrt import pytest @@ -25,16 +26,7 @@ def test_compatibility_with_rips(): distance_matrix = np.array([[0, 1, 1, sqrt(2)], [1, 0, sqrt(2), 1], [1, sqrt(2), 0, 1], [sqrt(2), 1, 1, 0]]) dtm_rips = DTMRipsComplex(distance_matrix=distance_matrix, max_filtration=42) st = dtm_rips.create_simplex_tree(max_dimension=1) - assert list(st.get_filtration()) == [ - ([0], 0.0), - ([1], 0.0), - ([2], 0.0), - ([3], 0.0), - ([0, 1], 1.0), - ([0, 2], 1.0), - ([1, 3], 1.0), - ([2, 3], 1.0), - ([1, 2], sqrt(2)), - ([0, 3], sqrt(2)), - ] + rips_complex = RipsComplex(distance_matrix=distance_matrix, max_edge_length=42) + st_from_rips = rips_complex.create_simplex_tree(max_dimension=1) + assert list(st.get_filtration()) == list(st_from_rips.get_filtration()) |