summaryrefslogtreecommitdiff
path: root/src/python/gudhi/simplex_tree.pyx
diff options
context:
space:
mode:
authorVincent Rouvreau <vincent.rouvreau@inria.fr>2022-02-10 16:16:14 +0100
committerVincent Rouvreau <vincent.rouvreau@inria.fr>2022-02-10 16:16:14 +0100
commit37a141533397568e7070c734e21ef9c4dc85d132 (patch)
tree0f73790d48faf129ab228576fe6984279b0018ab /src/python/gudhi/simplex_tree.pyx
parent7f1b8eb706c72921141b53e607d6e2aa28e2bf19 (diff)
Add SimplexTree copy method and its test
Diffstat (limited to 'src/python/gudhi/simplex_tree.pyx')
-rw-r--r--src/python/gudhi/simplex_tree.pyx14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx
index c3720936..6b3116a4 100644
--- a/src/python/gudhi/simplex_tree.pyx
+++ b/src/python/gudhi/simplex_tree.pyx
@@ -63,6 +63,20 @@ cdef class SimplexTree:
"""
return self.pcohptr != NULL
+ def copy(self):
+ """
+ :returns: A simplex tree that is a deep copy itself.
+ :rtype: SimplexTree
+ """
+ stree = SimplexTree()
+ cdef Simplex_tree_interface_full_featured* stree_ptr
+ cdef Simplex_tree_interface_full_featured* self_ptr=self.get_ptr()
+ with nogil:
+ stree_ptr = new Simplex_tree_interface_full_featured(dereference(self_ptr))
+
+ stree.thisptr = <intptr_t>(stree_ptr)
+ return stree
+
def filtration(self, simplex):
"""This function returns the filtration value for a given N-simplex in
this simplicial complex, or +infinity if it is not in the complex.