Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
Functions | Variables
Graph views

Functions

template<std::ranges::viewable_range R, template< typename... > typename G, typename... Args>
constexpr auto operator| (R &&range, const graphle::detail::range_adaptor_closure< G, Args... > &closure)
 

Variables

constexpr auto graphle::views::duplicate_transposed_edges = detail::range_adaptor<detail::edge_duplication_view> {}
 
constexpr auto graphle::views::edge_from
 
constexpr auto graphle::views::edge_to
 
constexpr auto graphle::views::from_vertex_perspective
 
constexpr auto graphle::views::to_vertex_perspective
 
constexpr auto graphle::views::maybe_exists = detail::primary_range_adaptor<detail::maybe_exists_view> {}
 

Detailed Description

Function Documentation

◆ operator|()

template<std::ranges::viewable_range R, template< typename... > typename G, typename... Args>
constexpr auto operator| ( R &&  range,
const graphle::detail::range_adaptor_closure< G, Args... > &  closure 
)
constexpr

Range pipe operator for all non-primary Graphle views (Types using graphle::detail::range_adapter which take a range as their first argument).

Definition at line 234 of file range_utils.hpp.

Variable Documentation

◆ duplicate_transposed_edges

constexpr auto graphle::views::duplicate_transposed_edges = detail::range_adaptor<detail::edge_duplication_view> {}
inlineconstexpr

View that iterates both [A, B] as well as [B, A] for every original edge [A, B].

Definition at line 86 of file duplicate_transposed_edges.hpp.

◆ edge_from

constexpr auto graphle::views::edge_from
inlineconstexpr
Initial value:
= detail::range_adaptor<
detail::edge_from_vertex_view,
detail::project_nth<0>,
detail::project_nth<1>
> {}

View that stores a vertex S and constructs edges [S, P] for every vertex P in the viewed range.

Definition at line 77 of file edge_from_vertex.hpp.

◆ edge_to

constexpr auto graphle::views::edge_to
inlineconstexpr
Initial value:
= detail::range_adaptor<
detail::edge_from_vertex_view,
detail::project_nth<0>,
detail::project_nth<1>
> {}

View that stores a vertex S and constructs edges [P, S] for every vertex P in the viewed range.

Definition at line 87 of file edge_from_vertex.hpp.

◆ from_vertex_perspective

constexpr auto graphle::views::from_vertex_perspective
inlineconstexpr
Initial value:
= detail::range_adaptor<
detail::vertex_perspective_view,
detail::project_nth<1>
> {}

View that transposes every edge that includes the vertex V such that V is the first element of that edge.

Definition at line 64 of file edge_perspective.hpp.

◆ maybe_exists

constexpr auto graphle::views::maybe_exists = detail::primary_range_adaptor<detail::maybe_exists_view> {}
inlineconstexpr

View that either wraps a provided view or is an empty view. This can be used to provide a wrapper around a range that might not exist, e.g.:

std::unordered_map<Key, std::vector<T>> my_values;
using view_type = decltype(ranges::all(my_values.at(key)));
auto values_for_key = my_values.contains(key)
? views::maybe_exists(ranges::all(my_values.at(key)))
: views::maybe_exists(meta::deduce_type<view_type>);
constexpr auto maybe_exists

Definition at line 74 of file maybe_exists.hpp.

◆ to_vertex_perspective

constexpr auto graphle::views::to_vertex_perspective
inlineconstexpr
Initial value:
= detail::range_adaptor<
detail::vertex_perspective_view,
detail::project_nth<0>
> {}

View that transposes every edge that includes the vertex V such that V is the second element of that edge.

Definition at line 73 of file edge_perspective.hpp.