From e0c930251736ab31732787c4d94761e33f31ff4d Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 20 Nov 2017 16:03:08 +0000 Subject: 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 --- src/cython/test/test_simplex_tree.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/cython/test/test_simplex_tree.py') 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 -- cgit v1.2.3