diff options
author | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-08-15 09:03:52 +0000 |
---|---|---|
committer | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-08-15 09:03:52 +0000 |
commit | f98b5a5f13d9657eb6ca924ca9909d4d29c9641a (patch) | |
tree | 27484da5e4b35787b5fcd6cfa94cfc1db9630283 /src/Simplex_tree/include/gudhi/Simplex_tree | |
parent | e91d128cf0a7b35d6a0caaae7066ad34d412c4be (diff) |
Optionally provide a dummy key/filtration interface instead of storing them for real.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST-options@734 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: ea7237a7b5c3d8e2dde49ea8356b142f3efa8089
Diffstat (limited to 'src/Simplex_tree/include/gudhi/Simplex_tree')
-rw-r--r-- | src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h index 1f1a34cc..26d18098 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h @@ -39,62 +39,32 @@ namespace Gudhi { * It stores explicitely its own filtration value and its own Simplex_key. */ template<class SimplexTree> -class Simplex_tree_node_explicit_storage { +struct Simplex_tree_node_explicit_storage : SimplexTree::Filtration_simplex_base, SimplexTree::Key_simplex_base { public: typedef typename SimplexTree::Siblings Siblings; typedef typename SimplexTree::Filtration_value Filtration_value; typedef typename SimplexTree::Simplex_key Simplex_key; - // Default constructor. - Simplex_tree_node_explicit_storage() - : children_(NULL), - simplex_key_(-1), - filtration_(0) { - } - - Simplex_tree_node_explicit_storage(Siblings * sib, - Filtration_value filtration) - : children_(sib), - simplex_key_(-1), - filtration_(filtration) { - } - - void assign_key(Simplex_key key) { - simplex_key_ = key; + Simplex_tree_node_explicit_storage(Siblings * sib = nullptr, + Filtration_value filtration = 0) + : children_(sib) { + this->assign_filtration(filtration); } /* - * Assign a children to the node + * Assign children to the node */ void assign_children(Siblings * children) { children_ = children; } - /* - * - */ - void assign_filtration(double filtration_value) { - filtration_ = filtration_value; - } - - Filtration_value filtration() { - return filtration_; - } /* Careful -> children_ can be NULL*/ Siblings * children() { return children_; } - Simplex_key key() { - return simplex_key_; - } - private: Siblings * children_; - - // Data attached to simplex, explicit storage - Simplex_key simplex_key_; - Filtration_value filtration_; // value in the filtration }; /* @} */ // end addtogroup simplex_tree |