Sequoia
Loading...
Searching...
No Matches
StaticGraph.hpp
Go to the documentation of this file.
1
2// Copyright Oliver J. Rosten 2018. //
3// Distributed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. //
4// (See accompanying file LICENSE.md or copy at //
5// https://www.gnu.org/licenses/gpl-3.0.en.html) //
7
8#pragma once
9
19
20namespace sequoia::maths
21{
22 template
23 <
24 std::size_t Size,
25 std::size_t Order,
26 class EdgeWeight,
27 class NodeWeight,
28 class EdgeStorageConfig = static_edge_storage_config<graph_flavour::directed, Size, Order>
29 >
30 class static_directed_graph final : public
32 <
33 connectivity<graph_flavour::directed, graph_impl::edge_storage_generator_t<graph_flavour::directed, EdgeWeight, null_meta_data, typename EdgeStorageConfig::index_type, EdgeStorageConfig>>,
34 static_node_storage<NodeWeight, Order>
35 >
36 {
37 private:
38 using primitive_type =
40 <
43 >;
44
45 public:
46 constexpr static graph_flavour flavour{graph_flavour::directed};
47
48 [[nodiscard]]
49 constexpr static std::size_t order() noexcept { return Order; }
50
51 [[nodiscard]]
52 constexpr static std::size_t size() noexcept { return Size; }
53
54 using node_weight_type = NodeWeight;
55
56 using
58 <
61 >::graph_primitive;
62
63 using primitive_type::swap_nodes;
64 using primitive_type::sort_edges;
65 using primitive_type::stable_sort_edges;
66 using primitive_type::swap_edges;
67 };
68
69 template
70 <
71 std::size_t Size,
72 std::size_t Order,
73 class EdgeWeight,
74 class NodeWeight,
75 class EdgeMetaData = null_meta_data,
77 >
78 class static_undirected_graph final : public
80 <
81 connectivity<graph_flavour::undirected, graph_impl::edge_storage_generator_t<graph_flavour::undirected, EdgeWeight, EdgeMetaData, typename EdgeStorageConfig::index_type, EdgeStorageConfig>>,
82 static_node_storage<NodeWeight, Order>
83 >
84 {
85 private:
86 using primitive_type =
88 <
91 >;
92
93 public:
94 constexpr static graph_flavour flavour{graph_flavour::undirected};
95
96 [[nodiscard]]
97 constexpr static std::size_t order() noexcept { return Order; }
98
99 [[nodiscard]]
100 constexpr static std::size_t size() noexcept { return Size; }
101
102 using node_weight_type = NodeWeight;
103
104 using
106 <
109 >::graph_primitive;
110
111 using primitive_type::swap_nodes;
112 using primitive_type::sort_edges;
113 using primitive_type::stable_sort_edges;
114 using primitive_type::swap_edges;
115 };
116
117 template
118 <
119 std::size_t Size,
120 std::size_t Order,
121 class EdgeWeight,
122 class NodeWeight,
123 class EdgeMetaData = null_meta_data,
125 >
126 class static_embedded_graph final : public
128 <
129 connectivity<graph_flavour::undirected_embedded, graph_impl::edge_storage_generator_t<graph_flavour::undirected_embedded, EdgeWeight, EdgeMetaData, typename EdgeStorageConfig::index_type, EdgeStorageConfig>>,
130 static_node_storage<NodeWeight, Order>
131 >
132 {
133 private:
134 using primitive =
136 <
139 >;
140
141 public:
142 constexpr static graph_flavour flavour{graph_flavour::undirected_embedded};
143
144 [[nodiscard]]
145 constexpr static std::size_t order() noexcept { return Order; }
146
147 [[nodiscard]]
148 constexpr static std::size_t size() noexcept { return Size; }
149
150 using node_weight_type = NodeWeight;
151
152 using
154 <
157 >::graph_primitive;
158
159 using primitive::swap_nodes;
160 };
161}
Underlying class for the various different graph flavour.
Classes implementing the concept of a sequence of data which is divided into partitions.
Edge configuration for static graphs.
Classes for node storage that may be used in a constexpr context.
Definition: Connectivity.hpp:1641
Definition: GraphPrimitive.hpp:107
Definition: StaticGraph.hpp:36
Definition: StaticGraph.hpp:132
Definition: StaticNodeStorage.hpp:26
Definition: StaticGraph.hpp:84
Definition: Edge.hpp:287
Definition: StaticGraphConfig.hpp:20