diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-11-02 09:25:06 +0100 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-11-02 09:25:06 +0100 |
commit | af5af2df409576035f2e31564f4048278d4f0f19 (patch) | |
tree | 44fde353aa1e7c41e680c153182af0933b489487 /src/python/test/test_simplex_tree.py | |
parent | 4186971033ee43821905cac53791bf074751d3af (diff) | |
parent | 6b995c03793096459a333c907b606770113b96d7 (diff) |
Merge master and resolve conflicts
Diffstat (limited to 'src/python/test/test_simplex_tree.py')
-rwxr-xr-x | src/python/test/test_simplex_tree.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py index d79d2c34..3b23fa0b 100755 --- a/src/python/test/test_simplex_tree.py +++ b/src/python/test/test_simplex_tree.py @@ -359,6 +359,28 @@ def test_collapse_edges(): for simplex in st.get_skeleton(0): assert simplex[1] == 1. +def test_reset_filtration(): + st = SimplexTree() + + assert st.insert([0, 1, 2], 3.) == True + assert st.insert([0, 3], 2.) == True + assert st.insert([3, 4, 5], 3.) == True + assert st.insert([0, 1, 6, 7], 4.) == True + + # Guaranteed by construction + for simplex in st.get_simplices(): + assert st.filtration(simplex[0]) >= 2. + + # dimension until 5 even if simplex tree is of dimension 3 to test the limits + for dimension in range(5, -1, -1): + st.reset_filtration(0., dimension) + for simplex in st.get_skeleton(3): + print(simplex) + if len(simplex[0]) < (dimension) + 1: + assert st.filtration(simplex[0]) >= 2. + else: + assert st.filtration(simplex[0]) == 0. + def test_boundaries_iterator(): st = SimplexTree() |