summaryrefslogtreecommitdiff
path: root/src/python/gudhi/simplex_tree.pyx
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2021-03-25 08:52:50 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2021-03-25 08:52:50 +0100
commit953a7da68657b9ab493cfb35b41fc46e26a73876 (patch)
tree717f6541654148fef445b8417778e05cb4a7ba78 /src/python/gudhi/simplex_tree.pyx
parent7e05e915adc1be285e04eb00d3ab7ba1b797f38d (diff)
Add equality operator for python Simplex tree
Diffstat (limited to 'src/python/gudhi/simplex_tree.pyx')
-rw-r--r--src/python/gudhi/simplex_tree.pyx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx
index d7991417..0bfaa19f 100644
--- a/src/python/gudhi/simplex_tree.pyx
+++ b/src/python/gudhi/simplex_tree.pyx
@@ -639,3 +639,10 @@ cdef class SimplexTree:
self.thisptr = <intptr_t>(ptr.collapse_edges(nb_iter))
# Delete old pointer
del ptr
+
+ def __eq__(self, other:SimplexTree):
+ """Simplex tree equality operator using C++ depth first search operator==
+ :returns: True if the 2 simplex trees are equal, False otherwise.
+ :rtype: bool
+ """
+ return dereference(self.get_ptr()) == dereference(other.get_ptr()) \ No newline at end of file