|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
The iterator on the arcs into a node of a digraph type, which In_Iterator is on a type built with the Digraph template.
More...
#include <graph-dry.H>
Public Types | |
| using | Item_Type = Arc * |
| The type of the items: arcs. | |
Public Member Functions | |
| In_Arcs_Walk (const GT &g, Node *p, SA sa=SA()) | |
The arcs of g into p that sa shows, from the first one. | |
| In_Arcs_Walk (Node *, SA sa=SA()) | |
| The form that takes only the node, which does not compile: the list of a node of a digraph holds only the arcs that leave it. | |
| bool | has_curr () const noexcept |
| Return true if there is a current arc. | |
| Arc * | get_curr () const |
Return the current arc. Throws overflow_error if there is none. | |
| Arc * | get_curr_ne () const noexcept |
| Return the current arc, which must exist. | |
| Arc * | get_current_arc () const |
See get_curr(). | |
| Arc * | get_current_arc_ne () const noexcept |
See get_curr_ne(). | |
| Node * | get_node (Arc *a) const noexcept |
Return the source of a. | |
| Node * | get_node () const |
| Return the source of the current arc. | |
| Node * | get_node_ne () const noexcept |
| Return the source of the current arc, which must exist. | |
| Node * | get_tgt_node () const |
| Alias of get_node(). | |
| Node * | get_tgt_node_ne () const noexcept |
| Alias of get_node_ne(). | |
| void | next () |
| Move to the next arc. | |
| void | next_ne () noexcept(shows_ne) |
| Move to the next arc, which must exist; noexcept when the filter is, else what the filter throws goes out. | |
| void | prev () |
| Move to the previous arc. | |
| void | prev_ne () noexcept(shows_ne) |
| prev() without its exception: nothing if there is no current arc; noexcept when the filter is, else what the filter throws goes out. | |
| void | reset_first () |
| Put the walk on the first arc. | |
| void | reset_last () |
| Put the walk on the last arc. | |
| void | end () noexcept |
| Put the walk past the last arc. | |
Static Public Attributes | |
| static constexpr bool | goes_back = requires (Arc_Itor & a) { a.prev(); } |
Whether the walk moves back: the arc iterators of List_SGraph and List_SDigraph go only forward. | |
| static constexpr bool | goes_to_last = requires (Arc_Itor & a) { a.reset_last(); a.prev(); } |
| Whether the walk goes to its last arc, which reset_last() needs. | |
Private Types | |
| using | Node = typename GT::Node |
| using | Arc = typename GT::Arc |
| using | Arc_Itor = typename GT::Arc_Iterator |
Private Member Functions | |
| void | forward () |
| void | backward () |
Private Attributes | |
| std::optional< Arc_Itor > | arcs |
| Node * | tgt = nullptr |
| SA | show_arc |
Static Private Attributes | |
| static constexpr bool | shows_ne = NothrowPredicateWith<SA &, Arc *&> |
The iterator on the arcs into a node of a digraph type, which In_Iterator is on a type built with the Digraph template.
A digraph keeps each arc only in the list of its source, so that the arcs into a node are found among the arcs of the graph: the walk goes through them, in the order of the arc iterator of the graph, and keeps those whose target is the node and that the filter shows. To build it and go through all of them takes \(O(E)\).
Its interface is that of the iterators on the arcs of a node: the node of an arc is its source. prev(), prev_ne() and reset_last() exist only where the arc iterator of the graph moves back.
| GT | the graph type, complete where the walk is used. |
| SA | the arc filter. |
Definition at line 132 of file graph-dry.H.
|
private |
Definition at line 135 of file graph-dry.H.
|
private |
Definition at line 136 of file graph-dry.H.
| using Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::Item_Type = Arc * |
The type of the items: arcs.
Definition at line 167 of file graph-dry.H.
|
private |
Definition at line 134 of file graph-dry.H.
|
inline |
The arcs of g into p that sa shows, from the first one.
| anything | that sa throws. |
Definition at line 179 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().
|
inline |
The form that takes only the node, which does not compile: the list of a node of a digraph holds only the arcs that leave it.
Definition at line 188 of file graph-dry.H.
|
inlineprivate |
Definition at line 158 of file graph-dry.H.
References Aleph::and, Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::show_arc, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::tgt.
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::prev(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::prev_ne(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::reset_last().
|
inlinenoexcept |
Put the walk past the last arc.
Definition at line 277 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs.
|
inlineprivate |
Definition at line 149 of file graph-dry.H.
References Aleph::and, Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::show_arc, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::tgt.
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::In_Arcs_Walk(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::next(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::next_ne(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::reset_first().
|
inline |
Return the current arc. Throws overflow_error if there is none.
Definition at line 200 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs.
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_current_arc(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node().
|
inlinenoexcept |
Return the current arc, which must exist.
Definition at line 203 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs.
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_current_arc_ne(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node_ne().
|
inline |
See get_curr().
Definition at line 206 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr().
|
inlinenoexcept |
See get_curr_ne().
Definition at line 209 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr_ne().
|
inline |
Return the source of the current arc.
Throws overflow_error if there is no current arc.
Definition at line 216 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node().
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node().
|
inlinenoexcept |
Return the source of a.
Definition at line 212 of file graph-dry.H.
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node_ne(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_tgt_node().
|
inlinenoexcept |
Return the source of the current arc, which must exist.
Definition at line 219 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr_ne(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node().
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_tgt_node_ne().
|
inline |
Alias of get_node().
Definition at line 222 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node().
|
inlinenoexcept |
Alias of get_node_ne().
Definition at line 225 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_node_ne().
|
inlinenoexcept |
Return true if there is a current arc.
Definition at line 197 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs.
|
inline |
Move to the next arc.
Throws overflow_error if there is no current arc.
Definition at line 229 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().
|
inlinenoexcept |
Move to the next arc, which must exist; noexcept when the filter is, else what the filter throws goes out.
Definition at line 237 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().
|
inline |
Move to the previous arc.
Throws underflow_error if there is no current arc. Only where the walk moves back.
Definition at line 245 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward().
|
inlinenoexcept |
prev() without its exception: nothing if there is no current arc; noexcept when the filter is, else what the filter throws goes out.
Definition at line 253 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward().
|
inline |
Put the walk on the first arc.
Definition at line 262 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().
|
inline |
Put the walk on the last arc.
Only where the walk goes to its last arc.
Definition at line 270 of file graph-dry.H.
References Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::arcs, and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward().
|
private |
Definition at line 139 of file graph-dry.H.
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::end(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::get_curr_ne(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::has_curr(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::next(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::next_ne(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::prev(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::prev_ne(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::reset_first(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::reset_last().
|
staticconstexpr |
Whether the walk moves back: the arc iterators of List_SGraph and List_SDigraph go only forward.
Definition at line 171 of file graph-dry.H.
|
staticconstexpr |
Whether the walk goes to its last arc, which reset_last() needs.
Definition at line 174 of file graph-dry.H.
|
private |
Definition at line 141 of file graph-dry.H.
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().
|
staticconstexprprivate |
Definition at line 145 of file graph-dry.H.
|
private |
Definition at line 140 of file graph-dry.H.
Referenced by Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward(), and Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward().