Simplex_tree_node_explicit_storage.h
1 /* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
2  * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
3  * Author(s): ClĂ©ment Maria
4  *
5  * Copyright (C) 2014 Inria
6  *
7  * Modification(s):
8  * - YYYY/MM Author: Description of the modification
9  */
10 
11 #ifndef SIMPLEX_TREE_SIMPLEX_TREE_NODE_EXPLICIT_STORAGE_H_
12 #define SIMPLEX_TREE_SIMPLEX_TREE_NODE_EXPLICIT_STORAGE_H_
13 
14 // Empty base optimization for MSVC - https://learn.microsoft.com/en-us/cpp/cpp/empty-bases
15 #if _MSC_VER
16  #define GUDHI_EMPTY_BASE_CLASS_OPTIMIZATION __declspec(empty_bases)
17 #else
18  #define GUDHI_EMPTY_BASE_CLASS_OPTIMIZATION
19 #endif
20 
21 #include <vector>
22 
23 namespace Gudhi {
24 
35 template<class SimplexTree>
36 struct GUDHI_EMPTY_BASE_CLASS_OPTIMIZATION Simplex_tree_node_explicit_storage : SimplexTree::Filtration_simplex_base,
37  SimplexTree::Key_simplex_base,
38  SimplexTree::Hooks_simplex_base {
39  typedef typename SimplexTree::Siblings Siblings;
41  typedef typename SimplexTree::Simplex_key Simplex_key;
42 
44  Filtration_value filtration = 0)
45  : children_(sib) {
46  this->assign_filtration(filtration);
47  }
48 
49  /*
50  * Assign children to the node
51  */
52  void assign_children(Siblings * children) {
53  children_ = children;
54  }
55 
56  /* Careful -> children_ can be NULL*/
57  Siblings * children() {
58  return children_;
59  }
60 
61  private:
62  Siblings * children_;
63 };
64  // end addtogroup simplex_tree
66 
67 } // namespace Gudhi
68 
69 #endif // SIMPLEX_TREE_SIMPLEX_TREE_NODE_EXPLICIT_STORAGE_H_
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
Value type for a filtration function on a cell complex.
Definition: FiltrationValue.h:20
Node of a simplex tree with filtration value and simplex key.
Definition: Simplex_tree_node_explicit_storage.h:38
Key type used as simplex identifier.
Definition: SimplexKey.h:15