diff --git a/src/python/gudhi/simplex_tree_multi.pxd b/src/python/gudhi/simplex_tree_multi.pxd index a40bf7f399..187633b1c9 100644 --- a/src/python/gudhi/simplex_tree_multi.pxd +++ b/src/python/gudhi/simplex_tree_multi.pxd @@ -88,6 +88,7 @@ cdef extern from "Simplex_tree_interface_multi.h" namespace "Gudhi::multiparamet void expansion(int max_dim) except + nogil void remove_maximal_simplex(simplex_type simplex) nogil # bool prune_above_filtration(filtration_type filtration) nogil + bool prune_above_dimension(int dimension) nogil bool make_filtration_non_decreasing() except + nogil # void compute_extended_filtration() nogil # Simplex_tree_multi_interface* collapse_edges(int nb_collapse_iteration) except + nogil diff --git a/src/python/gudhi/simplex_tree_multi.pyx b/src/python/gudhi/simplex_tree_multi.pyx index d2c65adab4..c3f625033a 100644 --- a/src/python/gudhi/simplex_tree_multi.pyx +++ b/src/python/gudhi/simplex_tree_multi.pyx @@ -540,7 +540,15 @@ cdef class SimplexTreeMulti: # method to recompute the exact dimension. # """ # return self.get_ptr().prune_above_filtration(filtration) + def prune_above_dimension(self, int dimension): + """Remove all simplices of dimension greater than a given value. + :param dimension: Maximum dimension value. + :type dimension: int + :returns: The modification information. + :rtype: bool + """ + return self.get_ptr().prune_above_dimension(dimension) def expansion(self, int max_dim)->SimplexTreeMulti: """Expands the simplex tree containing only its one skeleton until dimension max_dim.