From 55316205b2c7c2e3d7e3fe3ea92e20f3f8b29b11 Mon Sep 17 00:00:00 2001 From: yuichi-ike Date: Tue, 26 May 2020 18:22:14 +0900 Subject: test fixed, documents modified --- src/python/test/test_dtm_rips_complex.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/python/test') 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()) -- cgit v1.2.3