Elements ======== .. toctree:: :maxdepth: 0 :hidden: :cpp:include:`#include` .. cpp:namespace:: hysj .. cpp:namespace-push:: graphs In namespace :cpp:any:`graphs`: .. cpp:enum-class:: element_tag .. rest-script:: from hysj.graphs import ElementTag as Enum for e in Enum.__members__.values(): print(f'.. cpp:enumerator:: {e.name}') | Names the elements of a graph, vertices and edges. | .. cpp:function:: auto direction(const auto &graph,auto id) | Hook for computing the direction of an edge. | .. cpp:function:: auto element_ids(auto element_tag,const auto &graph) | Hook for computing the element ids of a graph. | *Shorthands* .. rest-script:: from hysj.graphs import ElementTag as Enum for e in Enum.__members__.values(): print(f'.. cpp:var:: unspecified {e.name}_ids = bind(element_ids,{e.name}_tag)') | .. cpp:function:: auto element_count(auto element_tag,const auto &graph) | Hook for computing the number of elements in a graph. | *Shorthands* .. cpp:var:: unspecified order = bind(element_count,in_tag) unspecified size = bind(element_count,out_tag) | .. cpp:function:: auto swap(auto element_tag,const auto &graph,auto id0,auto id1) | Hook for swapping the relations of elements :cpp:var:`id0` and :cpp:var:`id1`. | .. cpp:struct:: template traits::element_id_trait .. cpp:type:: template traits::element_id | Trait for computing the id-type of a given element-type. | .. cpp:concept:: template concepts::elements | Whether :cpp:type:`G` is a container of elements of tag :cpp:expr:`T`. *Let* .. cpp:var:: G g *Requires* :cpp:expr:`typename traits::element_id` :cpp:expr:`graphs::element_ids(constant_t{},g)` :cpp:expr:`graphs::element_count(constant_t{},g)` Builtin ^^^^^^^ .. cpp:namespace-push:: builtin :cpp:include:`#include` In namespace :cpp:any:`builtin`: .. cpp:struct:: template basic_element_id .. cpp:member:: static constexpr auto tag = constant_c .. cpp:member:: natural value | Implements a basic element id. | *Shorthands* .. rest-script:: from hysj.graphs import ElementTag as Enum for e in Enum.__members__.values(): print(f'.. cpp:type:: {e.name}_id = basic_element_id') | .. cpp:struct:: dynamically_directed_edge_id .. cpp:member:: edge_id id .. cpp:member:: direction_tag direction | .. cpp:struct:: template statically_directed_edge_id .. cpp:member:: edge_id id | .. cpp:namespace-pop:: .. cpp:namespace-pop::