19namespace sequoia::maths
25 constexpr static edge_sharing_preference edge_sharing{edge_sharing_preference::agnostic};
32 constexpr static edge_sharing_preference edge_sharing{edge_sharing_preference::agnostic};
36 template<
class Storage>
38 typename Storage::partitions_allocator_type;
43 graph_flavour GraphFlavour,
47 class EdgeStorageConfig,
48 class NodeWeightStorage
53 connectivity<GraphFlavour, graph_impl::edge_storage_generator_t<GraphFlavour, EdgeWeight, EdgeMetaData, std::size_t, EdgeStorageConfig>>,
59 using node_storage_type = NodeWeightStorage;
62 using node_weight_type = NodeWeight;
63 using size_type =
typename primitive_type::size_type;
64 using edges_initializer =
typename primitive_type::edges_initializer;
65 using edge_storage_type =
typename connectivity_type::edge_storage_type;
66 using edge_allocator_type =
typename edge_storage_type::allocator_type;
70 explicit graph_base(
const edge_allocator_type& edgeAllocator)
74 template<alloc EdgePartitionsAllocator>
76 graph_base(
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator)
82 graph_base(edges_initializer edges,
const edge_allocator_type& edgeAllocator)
86 template<alloc EdgePartitionsAllocator>
88 graph_base(edges_initializer edges,
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator)
92 template<tree_link_direction dir>
93 requires ( !heterogeneous_nodes<graph_base>
94 && ((dir == tree_link_direction::symmetric) || is_directed(primitive_type::connectivity::flavour)))
99 template<tree_link_direction dir>
100 requires ( !heterogeneous_nodes<graph_base>
101 && ((dir == tree_link_direction::symmetric) || is_directed(primitive_type::connectivity::flavour)))
112 template<alloc EdgePartitionsAllocator>
114 graph_base(
const graph_base& in,
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator)
124 template<alloc EdgePartitionsAllocator>
126 graph_base(
graph_base&& in,
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator)
127 :
primitive_type{std::move(in), edgeAllocator, edgePartitionsAllocator}
134 using primitive_type::swap;
135 using primitive_type::clear;
137 using primitive_type::get_edge_allocator;
138 using primitive_type::reserve_edges;
139 using primitive_type::edges_capacity;
140 using primitive_type::reserve_nodes;
141 using primitive_type::node_capacity;
142 using primitive_type::shrink_to_fit;
144 constexpr static graph_flavour flavour{GraphFlavour};
151 graph_flavour GraphFlavour,
155 class EdgeStorageConfig,
156 class NodeWeightStorage
158 requires (!std::is_empty_v<NodeWeight>)
169 connectivity<GraphFlavour, graph_impl::edge_storage_generator_t<GraphFlavour, EdgeWeight, EdgeMetaData, std::size_t, EdgeStorageConfig>>,
175 using node_storage_type = NodeWeightStorage;
178 using node_weight_type = NodeWeight;
179 using size_type =
typename primitive_type::size_type;
180 using edges_initializer =
typename primitive_type::edges_initializer;
181 using edge_storage_type =
typename connectivity_type::edge_storage_type;
182 using edge_allocator_type =
typename edge_storage_type::allocator_type;
183 using node_weight_allocator_type =
typename node_storage_type::node_weight_container_type::allocator_type;
189 graph_base(
const edge_allocator_type& edgeAllocator,
const node_weight_allocator_type& nodeWeightAllocator)
193 template<alloc EdgePartitionsAllocator>
195 graph_base(
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator,
const node_weight_allocator_type& nodeWeightAllocator)
196 :
primitive_type(edgeAllocator, edgePartitionsAllocator, nodeWeightAllocator)
199 graph_base(edges_initializer edges,
const edge_allocator_type& edgeAllocator,
const node_weight_allocator_type& nodeWeightAllocator)
203 template<alloc EdgePartitionsAllocator>
205 graph_base(edges_initializer edges,
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator,
const node_weight_allocator_type& nodeWeightAllocator)
206 :
primitive_type{edges, edgeAllocator, edgePartitionsAllocator, nodeWeightAllocator}
209 graph_base(edges_initializer edges, std::initializer_list<node_weight_type> nodeWeights)
213 graph_base(edges_initializer edges,
const edge_allocator_type& edgeAllocator, std::initializer_list<node_weight_type> nodeWeights,
const node_weight_allocator_type& nodeWeightAllocator)
214 :
primitive_type{edges, edgeAllocator, nodeWeights, nodeWeightAllocator}
217 template<alloc EdgePartitionsAllocator>
219 graph_base(edges_initializer edges,
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator, std::initializer_list<node_weight_type> nodeWeights,
const node_weight_allocator_type& nodeWeightAllocator)
220 :
primitive_type{edges, edgeAllocator, edgePartitionsAllocator, nodeWeights, nodeWeightAllocator}
223 template<tree_link_direction dir>
224 requires ((dir == tree_link_direction::symmetric) || is_directed(primitive_type::connectivity::flavour))
229 template<tree_link_direction dir>
230 requires ( !std::is_empty_v<node_weight_type> && !heterogeneous_nodes<graph_base>
231 && ((dir == tree_link_direction::symmetric) || is_directed(primitive_type::connectivity::flavour)))
236 graph_base(
const graph_base& in,
const edge_allocator_type& edgeAllocator,
const node_weight_allocator_type& nodeWeightAllocator)
240 template<alloc EdgePartitionsAllocator>
242 graph_base(
const graph_base& in,
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator,
const node_weight_allocator_type& nodeWeightAllocator)
243 :
primitive_type{in, edgeAllocator, edgePartitionsAllocator, nodeWeightAllocator}
247 graph_base(
graph_base&& in,
const edge_allocator_type& edgeAllocator,
const node_weight_allocator_type& nodeWeightAllocator)
248 :
primitive_type{std::move(in), edgeAllocator, nodeWeightAllocator}
251 template<alloc EdgePartitionsAllocator>
253 graph_base(
graph_base&& in,
const edge_allocator_type& edgeAllocator,
const EdgePartitionsAllocator& edgePartitionsAllocator,
const node_weight_allocator_type& nodeWeightAllocator)
254 :
primitive_type{std::move(in), edgeAllocator, edgePartitionsAllocator, nodeWeightAllocator}
263 constexpr static graph_flavour flavour{GraphFlavour};
265 using primitive_type::clear;
267 using primitive_type::get_edge_allocator;
268 using primitive_type::reserve_edges;
269 using primitive_type::edges_capacity;
270 using primitive_type::reserve_nodes;
271 using primitive_type::node_capacity;
272 using primitive_type::shrink_to_fit;
274 using primitive_type::get_node_allocator;
276 using primitive_type::swap;
296 graph_flavour::directed,
305 using node_weight_type = NodeWeight;
310 graph_flavour::directed,
321 graph_flavour::directed,
329 using base_type::swap_nodes;
330 using base_type::add_node;
331 using base_type::insert_node;
332 using base_type::erase_node;
334 using base_type::join;
335 using base_type::erase_edge;
337 using base_type::sort_edges;
338 using base_type::stable_sort_edges;
339 using base_type::swap_edges;
353 graph_flavour::undirected,
362 using node_weight_type = NodeWeight;
367 graph_flavour::undirected,
378 graph_flavour::undirected,
386 using base_type::swap_nodes;
387 using base_type::add_node;
388 using base_type::insert_node;
389 using base_type::erase_node;
391 using base_type::join;
392 using base_type::erase_edge;
394 using base_type::sort_edges;
395 using base_type::stable_sort_edges;
396 using base_type::swap_edges;
404 class EdgeStorageConfig,
405 class NodeWeightStorage
407 requires (!std::is_empty_v<EdgeMetaData>)
411 graph_flavour::undirected,
420 using node_weight_type = NodeWeight;
425 graph_flavour::undirected,
436 graph_flavour::undirected,
444 using base_type::swap_nodes;
445 using base_type::add_node;
446 using base_type::insert_node;
447 using base_type::erase_node;
449 using base_type::join;
466 graph_flavour::undirected_embedded,
475 using node_weight_type = NodeWeight;
480 graph_flavour::undirected_embedded,
491 graph_flavour::undirected_embedded,
499 using base_type::swap_nodes;
500 using base_type::add_node;
501 using base_type::insert_node;
502 using base_type::erase_node;
504 using base_type::join;
505 using base_type::erase_edge;
507 using base_type::primitive_type::insert_join;
Underlying class for the various different graph flavour.
Classes to allow homogeneous treatment of graphs with empty/non-empty node weights.
Classes implementing the concept of a sequence of data which is divided into partitions.
Storage for partitioned data such that data within each partition is contiguous.
Definition: PartitionedData.hpp:63
Definition: PartitionedData.hpp:991
Definition: Connectivity.hpp:1641
Definition: DynamicGraph.hpp:303
Definition: DynamicGraph.hpp:473
Definition: DynamicGraph.hpp:56
Definition: GraphPrimitive.hpp:107
Definition: NodeStorage.hpp:272
Definition: DynamicGraph.hpp:360
Definition: DynamicGraph.hpp:37
Definition: DynamicGraph.hpp:29
Definition: DynamicGraph.hpp:22
Definition: GraphPrimitive.hpp:84
Definition: GraphPrimitive.hpp:99