Simplex_tree_node_explicit_storage.h
1 /* This file is part of the Gudhi Library. The Gudhi library
2  * (Geometric Understanding in Higher Dimensions) is a generic C++
3  * library for computational topology.
4  *
5  * Author(s): ClĂ©ment Maria
6  *
7  * Copyright (C) 2014 Inria
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef SIMPLEX_TREE_SIMPLEX_TREE_NODE_EXPLICIT_STORAGE_H_
24 #define SIMPLEX_TREE_SIMPLEX_TREE_NODE_EXPLICIT_STORAGE_H_
25 
26 #include <vector>
27 
28 namespace Gudhi {
29 
30 /* \addtogroup simplex_tree
31  * Represents a node of a Simplex_tree.
32  * @{
33  */
34 
35 /*
36  * \brief Node of a simplex tree with filtration value
37  * and simplex key.
38  *
39  * It stores explicitely its own filtration value and its own Simplex_key.
40  */
41 template<class SimplexTree>
42 struct Simplex_tree_node_explicit_storage : SimplexTree::Filtration_simplex_base, SimplexTree::Key_simplex_base {
43  typedef typename SimplexTree::Siblings Siblings;
45  typedef typename SimplexTree::Simplex_key Simplex_key;
46 
47  Simplex_tree_node_explicit_storage(Siblings * sib = nullptr,
48  Filtration_value filtration = 0)
49  : children_(sib) {
50  this->assign_filtration(filtration);
51  }
52 
53  /*
54  * Assign children to the node
55  */
56  void assign_children(Siblings * children) {
57  children_ = children;
58  }
59 
60  /* Careful -> children_ can be NULL*/
61  Siblings * children() {
62  return children_;
63  }
64 
65  private:
66  Siblings * children_;
67 };
68 
69 /* @} */ // end addtogroup simplex_tree
70 } // namespace Gudhi
71 
72 #endif // SIMPLEX_TREE_SIMPLEX_TREE_NODE_EXPLICIT_STORAGE_H_
Definition: SimplicialComplexForAlpha.h:26
Key type used as simplex identifier.
Definition: SimplexKey.h:27
Value type for a filtration function on a cell complex.
Definition: FiltrationValue.h:32
GUDHI  Version 2.3.0  - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.  - Copyright : GPL v3 Generated on Fri Oct 5 2018 15:05:03 for GUDHI by Doxygen 1.8.13