|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Special iterator for distinguishing input arcs of output ones. More...
#include <graph-dry.H>
Public Types | |
| using | Item_Type = typename Itor::Item_Type |
| using | Iterator_Type = Itor |
| the type of items (Arc*) | |
Public Member Functions | |
| Digraph_Iterator (Node *p) | |
Instantiate an filtered iterator for arcs on the node p | |
| void | next_ne () noexcept(shows_ne) |
| next() without its check: the current arc must exist. | |
| void | next () |
| Advance to next arc. | |
| void | prev () |
| back to previous item. | |
| void | prev_ne () |
| prev() without exceptions. Only where the iterator moves back | |
| bool | has_curr () const noexcept |
| Return true is the iterator has a current arc. | |
| GT::Arc * | get_curr () const |
| Return the current arc. | |
| GT::Arc * | get_curr_ne () const noexcept |
| auto | get_current_arc () const |
See get_curr(). | |
| auto | get_current_arc_ne () const noexcept |
| GT::Node * | get_node (typename GT::Arc *a) const noexcept |
Return the node connected to p (passed during construction) and linked through a | |
| GT::Node * | get_node_ne () const noexcept |
Return the node connected to p (passed during construction) and linked through the current arc. | |
| auto | get_tgt_node_ne () const noexcept |
Backward-compatible alias: return target node (same as get_node_ne()). | |
| GT::Node * | get_node () const |
| auto | get_tgt_node () const |
Backward-compatible alias: return target node (same as get_node()). | |
| void | reset_first () noexcept(shows_ne) |
| Reset the iterator to first arc. | |
| void | reset_last () noexcept(shows_ne) |
| Reset the iterator to last arc. | |
Static Public Attributes | |
| static constexpr bool | shows_ne = noexcept(std::declval<Itor &>().next_ne()) |
| Whether what the filter says of an arc cannot throw, nor its conversion to bool: the moves without checks and the resets are noexcept then. | |
| static constexpr bool | goes_back = Itor::goes_back |
Whether the iterator moves back: the iterators of the lists of List_SGraph go only forward, and have no prev() | |
| static constexpr bool | goes_to_last = Itor::goes_to_last |
| Whether the iterator goes to its last arc, which reset_last() needs. | |
Private Types | |
| using | Itor = Filter_Iterator< Node *, typename GT::Node_Arc_Iterator, Filter > |
Private Attributes | |
| Filter | filt |
| Itor | it |
Special iterator for distinguishing input arcs of output ones.
The intended use of this iterator is to traverse the arcs linked to a node p inserted in a non-directed graph and to filter those arcs that are incoming or outcoming respect to p.
The in/out feature is given by the filter.
For example, for iterating on the input arcs of node p, we can do:
for (GT::Digraph_Iterator<In_Filt> it(p); it.has_curr(); it.next())
auto a = it.get_curr(); // this arc is incoming q --> p
Although this iterator is exclusivelly conceived for dealing with incoming or outcoming arcs. it could be used as filtered iterator. That is, you could to configure the filter for filtering arcs according your own criteria. In this case, we recommend to use the aliased version Filter_Iterator.
Apart from the fact that some arcs are filtered, the interface is identical to the Aleph-w ( \(\aleph_\omega\)) iterators.
Definition at line 3312 of file graph-dry.H.
| using GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::Item_Type = typename Itor::Item_Type |
Definition at line 3325 of file graph-dry.H.
| using GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::Iterator_Type = Itor |
the type of items (Arc*)
Definition at line 3327 of file graph-dry.H.
|
private |
Definition at line 3314 of file graph-dry.H.
|
inline |
Instantiate an filtered iterator for arcs on the node p
Definition at line 3337 of file graph-dry.H.
|
inline |
Return the current arc.
Throws overflow_error if there is no current arc
Definition at line 3362 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_current_arc(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
|
inlinenoexcept |
Definition at line 3364 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_current_arc_ne(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node_ne().
|
inline |
See get_curr().
Definition at line 3367 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr().
|
inlinenoexcept |
Definition at line 3369 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr_ne().
Referenced by Aleph::kosaraju_detail::Frame< GT >::next_target().
|
inline |
Definition at line 3388 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
|
inlinenoexcept |
Return the node connected to p (passed during construction) and linked through a
Definition at line 3373 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::filt.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node_ne(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_tgt_node().
|
inlinenoexcept |
Return the node connected to p (passed during construction) and linked through the current arc.
Definition at line 3380 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr_ne(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_tgt_node_ne().
|
inline |
Backward-compatible alias: return target node (same as get_node()).
Definition at line 3394 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
|
inlinenoexcept |
Backward-compatible alias: return target node (same as get_node_ne()).
Definition at line 3386 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node_ne().
Referenced by Aleph::kosaraju_detail::Frame< GT >::next_target().
|
inlinenoexcept |
Return true is the iterator has a current arc.
Definition at line 3358 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
Referenced by GraphCommon< GT, Node, Arc >::in_arcs(), GraphCommon< GT, Node, Arc >::in_degree(), GraphCommon< GT, Node, Arc >::in_nodes(), GraphCommon< GT, Node, Arc >::in_pairs(), main(), Aleph::kosaraju_detail::Frame< GT >::next_target(), GraphCommon< GT, Node, Arc >::out_arcs(), GraphCommon< GT, Node, Arc >::out_degree(), GraphCommon< GT, Node, Arc >::out_nodes(), GraphCommon< GT, Node, Arc >::out_pairs(), print_graph(), and GraphCommon< GT, Node, Arc >::search_directed_arc().
|
inline |
Advance to next arc.
Throw overflow_error if there is no current arc
Definition at line 3348 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inlinenoexcept |
next() without its check: the current arc must exist.
noexcept when the filter is (shows_ne); else what the filter throws goes out
Definition at line 3344 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
Referenced by Aleph::kosaraju_detail::Frame< GT >::next_arc(), and Aleph::kosaraju_detail::Frame< GT >::next_target().
|
inline |
back to previous item.
Throw underflow_error if there is no current arc. Only where the iterator moves back (goes_back)
Definition at line 3352 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inline |
prev() without exceptions. Only where the iterator moves back
Definition at line 3355 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inlinenoexcept |
Reset the iterator to first arc.
Definition at line 3397 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inlinenoexcept |
Reset the iterator to last arc.
Only where the iterator goes to its last arc (goes_to_last)
Definition at line 3401 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
private |
Definition at line 3316 of file graph-dry.H.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
|
staticconstexpr |
Whether the iterator moves back: the iterators of the lists of List_SGraph go only forward, and have no prev()
Definition at line 3331 of file graph-dry.H.
|
staticconstexpr |
Whether the iterator goes to its last arc, which reset_last() needs.
Definition at line 3334 of file graph-dry.H.
|
private |
Definition at line 3317 of file graph-dry.H.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr_ne(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::has_curr(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::next(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::next_ne(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::prev(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::prev_ne(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::reset_first(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::reset_last().
|
staticconstexpr |
Whether what the filter says of an arc cannot throw, nor its conversion to bool: the moves without checks and the resets are noexcept then.
Definition at line 3323 of file graph-dry.H.