diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-09-10 07:49:57 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-09-10 07:49:57 +0000 |
commit | 86d8370c00ec9733469864ed7842f72f4f8417b8 (patch) | |
tree | 72f6683740975e286d7e4d19a801f356edc2c09a /src/Simplex_tree/include/gudhi/Simplex_tree.h | |
parent | 606d3470542a3112ce6d67d4a493b98be6ea2c94 (diff) |
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
Diffstat (limited to 'src/Simplex_tree/include/gudhi/Simplex_tree.h')
-rw-r--r-- | src/Simplex_tree/include/gudhi/Simplex_tree.h | 13 |
1 files changed, 8 insertions, 5 deletions
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; |