23 #ifndef SIMPLEX_TREE_SIMPLEX_TREE_SIBLINGS_H_ 24 #define SIMPLEX_TREE_SIMPLEX_TREE_SIBLINGS_H_ 26 #include <gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h> 28 #include <boost/container/flat_map.hpp> 42 template<
class SimplexTree,
class MapContainer>
43 class Simplex_tree_siblings {
47 template<
class T>
friend class Simplex_tree_simplex_vertex_iterator;
48 template<
class T>
friend class Simplex_tree_boundary_simplex_iterator;
49 template<
class T>
friend class Simplex_tree_complex_simplex_iterator;
50 template<
class T>
friend class Simplex_tree_skeleton_simplex_iterator;
54 typedef typename SimplexTree::Node Node;
55 typedef MapContainer Dictionary;
56 typedef typename MapContainer::iterator Dictionary_it;
59 Simplex_tree_siblings()
66 Simplex_tree_siblings(Simplex_tree_siblings * oncles, Vertex_handle parent)
75 template<
typename RandomAccessVertexRange>
76 Simplex_tree_siblings(Simplex_tree_siblings * oncles, Vertex_handle parent,
const RandomAccessVertexRange & members)
79 members_(boost::container::ordered_unique_range, members.begin(),
81 for (
auto& map_el : members_) {
82 map_el.second.assign_children(
this);
93 void insert(Vertex_handle v, Filtration_value filtration_value) {
94 auto ins = members_.emplace(v, Node(
this, filtration_value));
95 if (!ins.second && filtration(ins.first) > filtration_value)
96 ins.first->second.assign_filtration(filtration_value);
99 Dictionary_it find(Vertex_handle v) {
100 return members_.find(v);
103 Simplex_tree_siblings * oncles() {
107 Vertex_handle parent()
const {
111 Dictionary & members() {
115 size_t size()
const {
116 return members_.size();
119 void erase(
const Dictionary_it iterator) {
120 members_.erase(iterator);
123 Simplex_tree_siblings * oncles_;
124 Vertex_handle parent_;
131 #endif // SIMPLEX_TREE_SIMPLEX_TREE_SIBLINGS_H_ Definition: SimplicialComplexForAlpha.h:26
Value type for a filtration function on a cell complex.
Definition: FiltrationValue.h:32
Handle type for the vertices of a cell complex.
Definition: VertexHandle.h:27