diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2020-05-29 17:56:45 +0200 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2020-05-29 17:56:45 +0200 |
commit | 34207229b3ab2936aecd953997286a0daab88a83 (patch) | |
tree | a6271b2eec86d848c6443d4cceb47e29227148d5 /src/python/test/test_simplex_tree.py | |
parent | 48d9ff9986cb3a6e36f60142784c2a02317dd327 (diff) |
convert matrix to SimplexTree
Diffstat (limited to 'src/python/test/test_simplex_tree.py')
-rwxr-xr-x | src/python/test/test_simplex_tree.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py index 2137d822..f75be58d 100755 --- a/src/python/test/test_simplex_tree.py +++ b/src/python/test/test_simplex_tree.py @@ -10,6 +10,7 @@ from gudhi import SimplexTree import pytest +import numpy as np __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" @@ -340,3 +341,9 @@ def test_simplices_iterator(): assert st.find(simplex[0]) == True print("filtration is: ", simplex[1]) assert st.filtration(simplex[0]) == simplex[1] + +def test_insert_array(): + st = SimplexTree() + a = np.array([[1, 4, 13, 6], [4, 3, 11, 5], [13, 11, 10, 12], [6, 5, 12, 2]]) + st.insert_array(a, max_filtration=5) + assert list(st.get_filtration()) == [([0], 1.0), ([3], 2.0), ([1], 3.0), ([0, 1], 4.0), ([1, 3], 5.0)] |