diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-11-20 16:03:08 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-11-20 16:03:08 +0000 |
commit | e0c930251736ab31732787c4d94761e33f31ff4d (patch) | |
tree | cf913a3ea94694ce03b4205eba9893ae5de7fccd /src/cython/test/test_simplex_tree.py | |
parent | 458b14bed05d40bcbc44a713dcae2cd08294a108 (diff) |
Add upper_bound_dimension and associated documentation for automatic dimension set.
prune_above_filtration cythonization
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/set_dimension_mechanism_precision@2917 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 12af3c5c2d6012c43d80cc95e1ecc8a2c0df340e
Diffstat (limited to 'src/cython/test/test_simplex_tree.py')
-rwxr-xr-x | src/cython/test/test_simplex_tree.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/cython/test/test_simplex_tree.py b/src/cython/test/test_simplex_tree.py index 801d52b7..8af653d2 100755 --- a/src/cython/test/test_simplex_tree.py +++ b/src/cython/test/test_simplex_tree.py @@ -134,3 +134,27 @@ def test_expansion(): ([1, 2], 0.5), ([0, 1, 2], 0.5), ([1, 2, 3], 0.5), ([5], 0.6), ([6], 0.6), ([5, 6], 0.6), ([4], 0.7), ([2, 4], 0.7), ([0, 3], 0.8), ([0, 1, 3], 0.8), ([0, 2, 3], 0.8), ([0, 1, 2, 3], 0.8), ([4, 6], 0.9), ([3, 6], 1.0)] + +def test_automatic_dimension(): + st = SimplexTree() + assert st.__is_defined() == True + assert st.__is_persistence_defined() == False + + # insert test + assert st.insert([0,1,3], filtration=0.5) == True + assert st.insert([0,1,2], filtration=1.) == True + + assert st.num_vertices() == 4 + assert st.num_simplices() == 11 + + assert st.dimension() == 2 + assert st.upper_bound_dimension() == 2 + + assert st.prune_above_filtration(0.6) == True + assert st.dimension() == 2 + assert st.upper_bound_dimension() == 2 + + st.remove_maximal_simplex([0, 1, 3]) + assert st.upper_bound_dimension() == 2 + assert st.dimension() == 1 + assert st.upper_bound_dimension() == 1 |