diff options
author | Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> | 2020-11-02 11:21:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-02 11:21:23 +0100 |
commit | 5900b2d802a7387f7fd4a87b5251dcbe6931371c (patch) | |
tree | 44fde353aa1e7c41e680c153182af0933b489487 /src/python/gudhi/simplex_tree.pyx | |
parent | 6b995c03793096459a333c907b606770113b96d7 (diff) | |
parent | af5af2df409576035f2e31564f4048278d4f0f19 (diff) |
Merge pull request #362 from VincentRouvreau/python_stree_boundaries
A fix proposal for boudaries of a simplex python version
Diffstat (limited to 'src/python/gudhi/simplex_tree.pyx')
-rw-r--r-- | src/python/gudhi/simplex_tree.pyx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx index 910711a9..c671da56 100644 --- a/src/python/gudhi/simplex_tree.pyx +++ b/src/python/gudhi/simplex_tree.pyx @@ -285,6 +285,20 @@ cdef class SimplexTree: ct.append((v, filtered_simplex.second)) return ct + def get_boundaries(self, simplex): + """This function returns a generator with the boundaries of a given N-simplex. + + :param simplex: The N-simplex, represented by a list of vertex. + :type simplex: list of int. + :returns: The (simplices of the) boundary of a simplex + :rtype: generator with tuples(simplex, filtration) + """ + cdef pair[Simplex_tree_boundary_iterator, Simplex_tree_boundary_iterator] it = self.get_ptr().get_boundary_iterators(simplex) + + while it.first != it.second: + yield self.get_ptr().get_simplex_and_filtration(dereference(it.first)) + preincrement(it.first) + def remove_maximal_simplex(self, simplex): """This function removes a given maximal N-simplex from the simplicial complex. |