58typedef std::pair<node, node>
edge;
74 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
75 node_t(
const T& _v) noexcept : value(_v) { }
79 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
80 node_t& operator= (
const T& _v)
noexcept { value = _v;
return *
this; }
84 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
85 bool operator== (
const T& t)
const noexcept {
return value == t; }
86 bool operator== (
const node_t& u)
const noexcept {
return value == u.value; }
87 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
88 friend bool operator== (
const T& t,
const node_t& u)
noexcept {
return u.value == t; }
90 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
91 bool operator!= (
const T& t)
const noexcept {
return value != t; }
92 bool operator!= (
const node_t& u)
const noexcept {
return value != u.value; }
93 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
94 friend bool operator!= (
const T& t,
const node_t& u)
noexcept {
return u.value != t; }
96 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
97 bool operator< (
const T& t)
const noexcept {
return value < t; }
98 bool operator< (
const node_t& u)
const noexcept {
return value < u.value; }
99 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
100 friend bool operator< (
const T& t,
const node_t& u)
noexcept {
return t < u.value; }
102 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
103 bool operator<= (
const T& t)
const noexcept {
return value <= t; }
104 bool operator<= (
const node_t& u)
const noexcept {
return value <= u.value; }
105 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
106 friend bool operator<= (
const T& t,
const node_t& u)
noexcept {
return t <= u.value; }
108 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
109 bool operator> (
const T& t)
const noexcept {
return value > t; }
110 bool operator> (
const node_t& u)
const noexcept {
return value > u.value; }
111 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
112 friend bool operator> (
const T& t,
const node_t& u)
noexcept {
return t > u.value; }
114 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
115 bool operator>= (
const T& t)
const noexcept {
return value >= t; }
116 bool operator>= (
const node_t& u)
const noexcept {
return value >= u.value; }
117 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
118 friend bool operator>= (
const T& t,
const node_t& u)
noexcept {
return t >= u.value; }
122 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
123 node_t operator+ (
const T& t)
const noexcept {
return node_t{value + t}; }
125 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
126 friend node_t operator+ (
const T& t,
const node_t& u)
noexcept {
return node_t{u.value + t}; }
128 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
129 node_t& operator+= (
const T& t)
noexcept { value += t;
return *
this; }
130 node_t& operator+= (
const node_t& u)
noexcept { value += u.value;
return *
this; }
132 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
133 node_t operator- (
const T& t)
const noexcept {
return node_t{value - t}; }
135 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
136 friend node_t operator- (
const T& t,
const node_t& u)
noexcept {
return node_t{t - u.value}; }
138 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
139 node_t& operator-= (
const T& t)
noexcept { value -= t;
return *
this; }
140 node_t& operator-= (
const node_t& u)
noexcept { value -= u.value;
return *
this; }
142 node_t& operator++()
noexcept { ++value;
return *
this; }
143 node_t& operator--()
noexcept { --value;
return *
this; }
147 template <
class stream>
148 friend stream& operator>> (stream& s,
node_t& p)
noexcept {
153 template <
class stream>
154 friend stream& operator<< (stream& s,
const node_t& p)
noexcept {
159 uint64_t operator*()
const noexcept {
return value; }
175 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
176 position_t(
const T& _v) noexcept : value(_v) { }
180 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
181 position_t& operator= (
const T& _v)
noexcept { value = _v;
return *
this; }
185 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
186 bool operator== (
const T& t)
const noexcept {
return value == t; }
187 bool operator== (
const position_t& u)
const noexcept {
return value == u.value; }
188 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
189 friend bool operator== (
const T& t,
const position_t& u)
noexcept {
return u.value == t; }
191 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
192 bool operator!= (
const T& t)
const noexcept {
return value != t; }
193 bool operator!= (
const position_t& u)
const noexcept {
return value != u.value; }
194 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
195 friend bool operator!= (
const T& t,
const position_t& u)
noexcept {
return u.value != t; }
197 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
198 bool operator< (
const T& t)
const noexcept {
return value < t; }
199 bool operator< (
const position_t& u)
const noexcept {
return value < u.value; }
200 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
201 friend bool operator< (
const T& t,
const position_t& u)
noexcept {
return t < u.value; }
203 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
204 bool operator<= (
const T& t)
const noexcept {
return value <= t; }
205 bool operator<= (
const position_t& u)
const noexcept {
return value <= u.value; }
206 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
207 friend bool operator<= (
const T& t,
const position_t& u)
noexcept {
return t <= u.value; }
209 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
210 bool operator> (
const T& t)
const noexcept {
return value > t; }
211 bool operator> (
const position_t& u)
const noexcept {
return value > u.value; }
212 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
213 friend bool operator> (
const T& t,
const position_t& u)
noexcept {
return t > u.value; }
215 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
216 bool operator>= (
const T& t)
const noexcept {
return value >= t; }
217 bool operator>= (
const position_t& u)
const noexcept {
return value >= u.value; }
218 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
219 friend bool operator>= (
const T& t,
const position_t& u)
noexcept {
return t >= u.value; }
223 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
226 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
229 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
230 position_t& operator+= (
const T& t)
noexcept { value += t;
return *
this; }
233 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
236 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
239 template <
typename T,std::enable_if_t<std::is_
integral_v<T>,
bool> = true>
240 position_t& operator-= (
const T& t)
noexcept { value -= t;
return *
this; }
243 position_t& operator++()
noexcept { ++value;
return *
this; }
244 position_t& operator--()
noexcept { --value;
return *
this; }
248 template <
class stream>
249 friend stream& operator>> (stream& s,
position_t& p)
noexcept {
254 template <
class stream>
255 friend stream& operator<< (stream& s,
const position_t& p)
noexcept {
260 uint64_t operator*()
const noexcept {
return value; }
263static_assert( std::is_trivial_v<node_t>);
264static_assert( std::is_trivially_constructible_v<node_t>);
265static_assert( std::is_trivially_copy_assignable_v<node_t>);
266static_assert( std::is_trivially_copy_constructible_v<node_t>);
267static_assert( std::is_trivially_copyable_v<node_t>);
268static_assert( std::is_trivially_move_constructible_v<node_t>);
269static_assert( std::is_trivially_move_assignable_v<node_t>);
270static_assert( std::is_constructible_v<node_t, node_t>);
271static_assert( std::is_constructible_v<node_t, node>);
272static_assert( std::is_constructible_v<node_t, int>);
273static_assert( std::is_trivially_assignable_v<node_t, node_t>);
274static_assert(not std::is_trivially_assignable_v<node_t, node>);
275static_assert(not std::is_trivially_assignable_v<node_t, int>);
276static_assert( std::is_trivially_destructible_v<node_t>);
278static_assert( std::is_trivial_v<position_t>);
279static_assert( std::is_trivially_constructible_v<position_t>);
280static_assert( std::is_trivially_copy_assignable_v<position_t>);
281static_assert( std::is_trivially_copy_constructible_v<position_t>);
282static_assert( std::is_trivially_copyable_v<position_t>);
283static_assert( std::is_trivially_move_constructible_v<position_t>);
284static_assert( std::is_trivially_move_assignable_v<position_t>);
285static_assert( std::is_constructible_v<position_t, position_t>);
286static_assert( std::is_constructible_v<position_t, position>);
287static_assert( std::is_constructible_v<position_t, int>);
288static_assert( std::is_trivially_assignable_v<position_t, position_t>);
289static_assert(not std::is_trivially_assignable_v<position_t, position>);
290static_assert(not std::is_trivially_assignable_v<position_t, int>);
291static_assert( std::is_trivially_destructible_v<position_t>);
Main namespace of the library.
Definition: basic_types.hpp:50
std::pair< edge, edge > edge_pair
Edge pair type.
Definition: basic_types.hpp:60
std::vector< uint64_t > head_vector
See Head vector page for further details.
Definition: basic_types.hpp:64
std::pair< node, node > edge
See Edge page for further details.
Definition: basic_types.hpp:58
uint64_t position
Node's position type.
Definition: basic_types.hpp:55
std::pair< edge_t, edge_t > edge_pair_t
Similar to edge_pair.
Definition: basic_types.hpp:165
uint64_t node
Node type. See Node / Vertex page for further details.
Definition: basic_types.hpp:53
std::vector< node > neighbourhood
List of nodes.
Definition: basic_types.hpp:62
std::pair< node_t, node_t > edge_t
Similar to edge.
Definition: basic_types.hpp:163
Typesafe node type.
Definition: basic_types.hpp:67
Typesafe position type.
Definition: basic_types.hpp:168