Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
graphle::util Namespace Reference

Classes

struct  addressof_t
 
struct  as_const_t
 
struct  edge_field_filter
 
struct  indirect_t
 
struct  no_op_t
 
struct  pointed_to_as_const_t
 
struct  transpose_edge_t
 
class  vec_of_vecs_output_iterator
 

Typedefs

template<graph_ref G>
using edge_from_filter = edge_field_filter< G, &edge_of< G >::first >
 
template<graph_ref G>
using edge_to_filter = edge_field_filter< G, &edge_of< G >::second >
 

Functions

template<graph_ref G>
requires ( edge_list_graph<G> || in_edges_graph<G> || (non_directed_graph<G> && out_edges_graph<G>) )
constexpr auto in_edges (G &&graph, vertex_of< G > vertex)
 
template<graph_ref G>
requires ( edge_list_graph<G> || out_edges_graph<G> || (non_directed_graph<G> && in_edges_graph<G>) )
constexpr auto out_edges (G &&graph, vertex_of< G > vertex)
 
template<graph_ref G>
requires ( edge_list_graph<G> || in_edges_graph<G> || (non_directed_graph<G> && out_edges_graph<G>) )
constexpr std::size_t in_degree (G &&graph, vertex_of< G > vertex)
 
template<graph_ref G>
requires ( edge_list_graph<G> || out_edges_graph<G> || (non_directed_graph<G> && in_edges_graph<G>) )
constexpr std::size_t out_degree (G &&graph, vertex_of< G > vertex)
 
template<directed_graph G>
requires (edge_list_graph<G> || in_edges_graph<G>)
constexpr bool is_root (G &&graph, vertex_of< G > vertex)
 
template<directed_graph G>
requires (edge_list_graph<G> || out_edges_graph<G>)
constexpr bool is_branch (G &&graph, vertex_of< G > vertex)
 
template<directed_graph G>
requires (edge_list_graph<G> || out_edges_graph<G>)
constexpr bool is_leaf (G &&graph, vertex_of< G > vertex)
 
template<typename F >
constexpr auto transform_edge (F &&fn)
 
template<typename C >
requires requires (C c) { c.front(), c.pop_front(); }
constexpr rng::range_value_t< C > take_front (C &container)
 
template<typename C >
requires requires (C c) { c.back(), c.pop_back(); }
constexpr rng::range_value_t< C > take_back (C &container)
 
template<typename R >
constexpr auto empty_range_of (R &&range)
 
template<graph_ref G, typename F >
constexpr vertex_of< G > find_vertex (G &&graph, F &&pred)
 

Variables

constexpr no_op_t no_op = {}
 
constexpr addressof_t addressof = {}
 
constexpr indirect_t indirect = {}
 
constexpr as_const_t as_const = {}
 
constexpr pointed_to_as_const_t pointed_to_as_const = {}
 
constexpr transpose_edge_t transpose_edge = {}
 

Detailed Description

Utility methods.

Function Documentation

◆ empty_range_of()

template<typename R >
constexpr auto graphle::util::empty_range_of ( R &&  range)
inlineconstexpr

Returns a view of the given range with no elements, i.e. the subrange (range.end(), range.end()).

Definition at line 30 of file storage_utils.hpp.

◆ find_vertex()

template<graph_ref G, typename F >
constexpr vertex_of< G > graphle::util::find_vertex ( G &&  graph,
F &&  pred 
)
inlineconstexpr

Finds the first vertex matching the given predicate, or nullptr if no such vertex exists.

Parameters
graphThe graph to search
predA function object invocable as pred(vertex_of<G>) -> bool
Returns
Either a vertex matching the given predicate or nullptr
Graph Requirements:
~~~ vertex_list_graph<G> ~~~

Definition at line 18 of file vertex_utils.hpp.

◆ take_back()

template<typename C >
requires requires (C c) { c.back(), c.pop_back(); }
constexpr rng::range_value_t< C > graphle::util::take_back ( C &  container)
inlineconstexpr

Removes and returns the last item of the provided container.

Definition at line 21 of file storage_utils.hpp.

◆ take_front()

template<typename C >
requires requires (C c) { c.front(), c.pop_front(); }
constexpr rng::range_value_t< C > graphle::util::take_front ( C &  container)
inlineconstexpr

Removes and returns the first item of the provided container.

Definition at line 11 of file storage_utils.hpp.

Variable Documentation

◆ addressof

constexpr addressof_t graphle::util::addressof = {}
inlineconstexpr

Definition at line 61 of file functional.hpp.

◆ as_const

constexpr as_const_t graphle::util::as_const = {}
inlineconstexpr

Definition at line 73 of file functional.hpp.

◆ indirect

constexpr indirect_t graphle::util::indirect = {}
inlineconstexpr

Definition at line 67 of file functional.hpp.

◆ no_op

constexpr no_op_t graphle::util::no_op = {}
inlineconstexpr

Definition at line 55 of file functional.hpp.

◆ pointed_to_as_const

constexpr pointed_to_as_const_t graphle::util::pointed_to_as_const = {}
inlineconstexpr

Definition at line 80 of file functional.hpp.

◆ transpose_edge

constexpr transpose_edge_t graphle::util::transpose_edge = {}
inlineconstexpr

Definition at line 87 of file functional.hpp.