Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
Graph utility classes, functions and objects

Classes

struct  graphle::util::edge_field_filter< G, Field >
 
struct  graphle::util::no_op_t
 
struct  graphle::util::addressof_t
 
struct  graphle::util::indirect_t
 
struct  graphle::util::as_const_t
 
struct  graphle::util::pointed_to_as_const_t
 
struct  graphle::util::transpose_edge_t
 

Typedefs

template<graph_ref G>
using graphle::util::edge_from_filter = edge_field_filter< G, &edge_of< G >::first >
 
template<graph_ref G>
using graphle::util::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 graphle::util::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 graphle::util::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 graphle::util::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 graphle::util::out_degree (G &&graph, vertex_of< G > vertex)
 
template<directed_graph G>
requires (edge_list_graph<G> || in_edges_graph<G>)
constexpr bool graphle::util::is_root (G &&graph, vertex_of< G > vertex)
 
template<directed_graph G>
requires (edge_list_graph<G> || out_edges_graph<G>)
constexpr bool graphle::util::is_branch (G &&graph, vertex_of< G > vertex)
 
template<directed_graph G>
requires (edge_list_graph<G> || out_edges_graph<G>)
constexpr bool graphle::util::is_leaf (G &&graph, vertex_of< G > vertex)
 
template<typename F >
constexpr auto graphle::util::transform_edge (F &&fn)
 

Detailed Description

Typedef Documentation

◆ edge_from_filter

template<graph_ref G>
using graphle::util::edge_from_filter = typedef edge_field_filter<G, &edge_of<G>::first>

Filter that keeps all edges coming from the given vertex.

Definition at line 22 of file edge_utils.hpp.

◆ edge_to_filter

template<graph_ref G>
using graphle::util::edge_to_filter = typedef edge_field_filter<G, &edge_of<G>::second>

Filter that keeps all edges going to the given vertex.

Definition at line 24 of file edge_utils.hpp.

Function Documentation

◆ in_degree()

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 graphle::util::in_degree ( G &&  graph,
vertex_of< G >  vertex 
)
inlineconstexpr

Returns the in-degree of the given vertex (i.e. the number of edges going into the vertex). If the graph is non-directed, this is the same as the out-degree.

Graph Requirements:

Definition at line 108 of file edge_utils.hpp.

◆ in_edges()

template<graph_ref G>
requires ( edge_list_graph<G> || in_edges_graph<G> || (non_directed_graph<G> && out_edges_graph<G>) )
constexpr auto graphle::util::in_edges ( G &&  graph,
vertex_of< G >  vertex 
)
inlineconstexpr

Returns a range of all in edges of the given vertex. If the graph is non-directed, this is the same set of edges as the out edges.

Graph Requirements:

Definition at line 42 of file edge_utils.hpp.

◆ is_branch()

template<directed_graph G>
requires (edge_list_graph<G> || out_edges_graph<G>)
constexpr bool graphle::util::is_branch ( G &&  graph,
vertex_of< G >  vertex 
)
inlineconstexpr

Returns whether or not the given vertex is a branch vertex (i.e. a vertex with at least one outgoing edge).

Graph Requirements:

Definition at line 188 of file edge_utils.hpp.

◆ is_leaf()

template<directed_graph G>
requires (edge_list_graph<G> || out_edges_graph<G>)
constexpr bool graphle::util::is_leaf ( G &&  graph,
vertex_of< G >  vertex 
)
inlineconstexpr

Returns whether or not the given vertex is a leaf vertex (i.e. a vertex with no outgoing edges).

Graph Requirements:

Definition at line 205 of file edge_utils.hpp.

◆ is_root()

template<directed_graph G>
requires (edge_list_graph<G> || in_edges_graph<G>)
constexpr bool graphle::util::is_root ( G &&  graph,
vertex_of< G >  vertex 
)
inlineconstexpr

Returns whether or not the given vertex is a root vertex (i.e. a vertex with no ingoing edges).

Graph Requirements:

Definition at line 171 of file edge_utils.hpp.

◆ out_degree()

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 graphle::util::out_degree ( G &&  graph,
vertex_of< G >  vertex 
)
inlineconstexpr

Returns the out-degree of the given vertex (i.e. the number of edges going out of the vertex). If the graph is non-directed, this is the same as the in-degree.

Graph Requirements:

Definition at line 141 of file edge_utils.hpp.

◆ out_edges()

template<graph_ref G>
requires ( edge_list_graph<G> || out_edges_graph<G> || (non_directed_graph<G> && in_edges_graph<G>) )
constexpr auto graphle::util::out_edges ( G &&  graph,
vertex_of< G >  vertex 
)
inlineconstexpr

Returns a range of all out edges of the given vertex. If the graph is non-directed, this is the same set of edges as the in edges.

Graph Requirements:

Definition at line 75 of file edge_utils.hpp.

◆ transform_edge()

template<typename F >
constexpr auto graphle::util::transform_edge ( F &&  fn)
inlineconstexpr

Returns a function object that applies F to both vertices of an edge.

Todo:
: This would probably work better as a range view.

Definition at line 95 of file functional.hpp.