.. _cpp-dg/VertexMapper: ********************************************************** dg/VertexMapper.hpp ********************************************************** .. default-domain:: cpp .. default-role:: cpp:expr .. py:currentmodule:: mod .. cpp:namespace:: mod Class ``dg::VertexMapper`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: dg::VertexMapper A class for enumerating all valid vertex maps for a given :class:`dg::DG::HyperEdge`. That is, for such a hyperedge, collect the graphs associated with respectively the source and target vertices, and create the disjoint union of those graphs. Let the result be the graphs :math:`G` and :math:`H`. Then each rule :math:`r` associated with the hyperedge, calculate each direct derivation :math:`G \overset{r}{\Rightarrow} H` and record the associated vertex maps :math:`V(G) \rightarrow V(H)`. Those maps are available in this class. Synopsis ^^^^^^^^ .. alias:: dg::VertexMapper :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: dg::VertexMapper .. type:: Map = VertexMap; The vertex map type. .. type:: value_type = std::pair> The value type returned for each vertex map: the rule used to generate the map, and then the actual map. .. class:: iterator A random-access iterator over :type:`value_type`\ s. .. type:: const_iterator = iterator .. function:: VertexMapper(DG::HyperEdge e) Construct a vertex map holder. :throws: :class:`LogicError` if `!e`. .. function:: DG::HyperEdge getEdge() const :returns: the hyperedge for which the mapper calculates vertex maps. .. function:: graph::Union getLeft() const graph::Union getRight() const :returns: the disjoint union of graphs from respectively the source and target vertices of the hyperedge. That is, the graphs :math:`G` and :math:`H` that are the domain and codomain graphs of the calculated vertex maps. .. function:: const_iterator begin() const const_iterator end() const :returns: iterators for the range of vertex maps calculated by the mapper. .. function:: std::size_t size() const :returns: `end() - begin()` .. function:: value_type operator[](std::size_t i) const :returns: `begin()[i]` :throws: :class:`LogicError` if `i >= size()`. .. cpp:namespace-pop::