From 86d8370c00ec9733469864ed7842f72f4f8417b8 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 10 Sep 2015 07:49:57 +0000 Subject: operator== git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/copy_move@782 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 498e8c3f35d105b22752983360fbf8229c224776 --- src/Simplex_tree/include/gudhi/Simplex_tree.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/Simplex_tree/include') diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index 05c493dd..a5ad6a79 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -347,18 +347,21 @@ class Simplex_tree { public: /** \brief Checks if two simplex trees are equal. */ - // TODO: constify is required to make an operator== - bool is_equal(Simplex_tree& st2) - { + bool operator==(Simplex_tree& st2) { if ((null_vertex_ != st2.null_vertex_) || (threshold_ != st2.threshold_) || (dimension_ != st2.dimension_)) return false; return rec_equal(&root_, &st2.root_); } - - /** rec_equal: Checks recursively whether or not two simplex trees are equal, using depth first search. */ + + /** \brief Checks if two simplex trees are different. */ + bool operator!=(Simplex_tree& st2) { + return (!(*this == st2)); + } + private: + /** rec_equal: Checks recursively whether or not two simplex trees are equal, using depth first search. */ bool rec_equal(Siblings* s1, Siblings* s2) { if (s1->members().size() != s2->members().size()) return false; -- cgit v1.2.3