|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Filtered iterator on directed graphs. More...
#include <tpl_graph.H>
Public Types | |
| using | Item_Type = typename Itor::Item_Type |
| using | Iterator_Type = Itor |
| The type of element. | |
Public Member Functions | |
| Digraph_Iterator (typename GT::Node *p) | |
Initialize an iterator on adjacent arcs (incoming or outcoming) of p | |
| void | next () |
| Move the iterator one position forward. | |
| void | next_ne () noexcept(shows_ne) |
| next() without its check: the current arc must exist. | |
| void | prev () |
| Move the iterator one position backward. | |
| bool | has_curr () const noexcept |
Return true the iterator has an current arc. | |
| GT::Arc * | get_curr () const |
| Return the current arc. | |
| GT::Arc * | get_curr_ne () const noexcept |
| Return the current arc. | |
| auto | get_current_arc () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_curr(). | |
| GT::Node * | get_node (typename GT::Arc *a) const noexcept |
Return the connected node to arc. | |
| GT::Node * | get_node () const |
| Return the connected node to current arc. | |
| auto | get_tgt_node () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_node(). | |
| GT::Node * | get_node_ne () const noexcept |
| Return the connected node to current arc. | |
| auto | get_tgt_node_ne () const noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_node_ne(). | |
| void | reset_first () noexcept(shows_ne) |
| Reset the iterator to the first arc. | |
| void | reset_last () noexcept(shows_ne) |
| Reset the iterator to the last arc. | |
| void | end () noexcept(shows_ne) |
| Put the iterator in end state. | |
Static Public Attributes | |
| static constexpr bool | goes_back = Itor::goes_back |
| Iterator type. | |
| static constexpr bool | goes_to_last = Itor::goes_to_last |
| Whether the iterator goes to its last arc, which reset_last() and end() need. | |
| 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. | |
Private Types | |
| using | Itor = Filter_Iterator< typename GT::Node *, typename GT::Node_Arc_Iterator, Filter > |
Private Attributes | |
| Filter | filt |
| Itor | it |
Filtered iterator on directed graphs.
Definition at line 1769 of file tpl_graph.H.
| using Aleph::Digraph_Iterator< GT, Filter >::Item_Type = typename Itor::Item_Type |
Definition at line 1778 of file tpl_graph.H.
| using Aleph::Digraph_Iterator< GT, Filter >::Iterator_Type = Itor |
The type of element.
Definition at line 1780 of file tpl_graph.H.
|
private |
Definition at line 1771 of file tpl_graph.H.
|
inline |
Initialize an iterator on adjacent arcs (incoming or outcoming) of p
Definition at line 1797 of file tpl_graph.H.
|
inlinenoexcept |
Put the iterator in end state.
Only where the iterator goes to its last arc (goes_to_last). noexcept when the filter is (shows_ne); else what the filter throws goes out
Definition at line 1897 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it, Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), and Aleph::Filter_Iterator< Container, It, Show_Item >::reset_last().
|
inline |
Return the current arc.
Throws overflow_error it there is no current
Definition at line 1829 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it.
Referenced by Aleph::Digraph_Iterator< GT, Filter >::get_current_arc(), and Aleph::Digraph_Iterator< GT, Filter >::get_node().
|
inlinenoexcept |
Return the current arc.
Throws overflow_error it there is no current
Definition at line 1836 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it.
Referenced by Aleph::Digraph_Iterator< GT, Filter >::get_node_ne().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_curr().
Returns current arc.
Definition at line 1843 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::get_curr().
|
inline |
Return the connected node to current arc.
Definition at line 1856 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::get_curr(), and Aleph::Digraph_Iterator< GT, Filter >::get_node().
Referenced by Aleph::Digraph_Iterator< GT, Filter >::get_node(), Aleph::Digraph_Iterator< GT, Filter >::get_node_ne(), and Aleph::Digraph_Iterator< GT, Filter >::get_tgt_node().
|
inlinenoexcept |
Return the connected node to arc.
The result depends on iterator type
Definition at line 1850 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::filt.
|
inlinenoexcept |
Return the connected node to current arc.
Definition at line 1869 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::get_curr_ne(), and Aleph::Digraph_Iterator< GT, Filter >::get_node().
Referenced by Aleph::Digraph_Iterator< GT, Filter >::get_tgt_node_ne().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_node().
Returns target node of current arc.
Definition at line 1863 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::get_node().
|
inlinenoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Alias for get_node_ne().
Returns target node of current arc (no exceptions).
Definition at line 1876 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::get_node_ne().
|
inlinenoexcept |
Return true the iterator has an current arc.
Definition at line 1822 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it.
Referenced by Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::build_tree(), compute_min_cut_capacity(), Aleph::MCF_Graph< NodeT, ArcT >::demands_satisfied(), Aleph::Testing::LayeredNetworkGenerator< Net >::generate(), Aleph::Net_Graph< NodeT, ArcT >::get_in_cap(), Aleph::Net_Graph< NodeT, ArcT >::get_in_flow(), Aleph::Net_Graph< NodeT, ArcT >::get_out_cap(), Aleph::Net_Graph< NodeT, ArcT >::get_out_flow(), Aleph::Net_Cost_Graph< NodeT, ArcT >::in_pars(), Aleph::Testing::RandomNetworkGenerator< Net >::is_connected(), Aleph::Net_Cost_Graph< NodeT, ArcT >::out_pars(), Aleph::Two_Sat< GT >::solve(), TEST(), TEST(), TYPED_TEST(), and Aleph::vertex_connectivity().
|
inline |
Move the iterator one position forward.
Throws overflow_error it there is no current
Definition at line 1805 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it, and Aleph::Filter_Iterator< Container, It, Show_Item >::next().
|
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 1812 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it, and Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
|
inline |
Move the iterator one position backward.
Throws overflow_error if there is no current. Only where the iterator moves back (goes_back)
Definition at line 1819 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it, and Aleph::Filter_Iterator< Container, It, Show_Item >::prev().
|
inlinenoexcept |
Reset the iterator to the first arc.
Definition at line 1882 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it, and Aleph::Filter_Iterator< Container, It, Show_Item >::reset_first().
Referenced by TYPED_TEST().
|
inlinenoexcept |
Reset the iterator to the last arc.
Only where the iterator goes to its last arc (goes_to_last)
Definition at line 1889 of file tpl_graph.H.
References Aleph::Digraph_Iterator< GT, Filter >::it, and Aleph::Filter_Iterator< Container, It, Show_Item >::reset_last().
|
private |
Definition at line 1774 of file tpl_graph.H.
Referenced by Aleph::Digraph_Iterator< GT, Filter >::get_node().
|
staticconstexpr |
Iterator type.
Whether the iterator moves back: the iterators of the lists of List_SGraph and List_SDigraph go only forward, and have no prev()
Definition at line 1785 of file tpl_graph.H.
|
staticconstexpr |
Whether the iterator goes to its last arc, which reset_last() and end() need.
Definition at line 1789 of file tpl_graph.H.
|
private |
Definition at line 1775 of file tpl_graph.H.
Referenced by Aleph::Digraph_Iterator< GT, Filter >::end(), Aleph::Digraph_Iterator< GT, Filter >::get_curr(), Aleph::Digraph_Iterator< GT, Filter >::get_curr_ne(), Aleph::Digraph_Iterator< GT, Filter >::has_curr(), Aleph::Digraph_Iterator< GT, Filter >::next(), Aleph::Digraph_Iterator< GT, Filter >::next_ne(), Aleph::Digraph_Iterator< GT, Filter >::prev(), Aleph::Digraph_Iterator< GT, Filter >::reset_first(), and Aleph::Digraph_Iterator< GT, 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 1794 of file tpl_graph.H.