|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Iterator over the arcs of a node. More...
#include <tpl_agraph.H>
Public Types | |
| using | Item_Type = Arc * |
| The data type returned by get_curr(). | |
| using | Set_Type = Node * |
| The set type over which iteration is performed. | |
Public Member Functions | |
| Node_Arc_Iterator () noexcept | |
| Instantiate an empty (invalid) iterator. | |
| Node_Arc_Iterator (Node *src) noexcept | |
| Instantiate an iterator over node src. | |
| void ** | get_base () noexcept |
| Return the array of the arcs of the node. | |
| void *const * | get_base () const noexcept |
| Return the array of the arcs of the node. | |
| bool | has_curr () const noexcept |
| Return true if the iterator is on an arc. | |
| bool | is_last () const noexcept |
| Return true if the iterator is on the last arc. | |
| long | get_pos () const noexcept |
| Return the position of the current arc, counted from 0. | |
| Arc * | get_curr () const |
| Return the current arc. | |
| Arc * | get_curr_ne () const noexcept |
| Return the current arc, which must exist. | |
| void | next_ne () noexcept |
| Move to the next arc; the iterator must be on an arc. | |
| void | next () |
| Move to the next arc. | |
| void | prev_ne () noexcept |
| Move to the previous arc; the iterator must be on an arc. | |
| void | prev () |
| Move to the previous arc. | |
| void | reset () noexcept |
| Put the iterator on the first arc. | |
| void | reset_first () noexcept |
| Put the iterator on the first arc. | |
| void | reset_last () noexcept |
| Put the iterator on the last arc. | |
| void | set_pos (const long new_pos) noexcept |
| Put the iterator on position new_pos; the number of arcs is the position past the last one. | |
| void | end () noexcept |
| Put the iterator past the last arc. | |
| Arc * | get_current_arc_ne () const noexcept |
| Return the current arc. | |
| Arc * | get_current_arc () const |
| Return the current arc. | |
| Node * | get_tgt_node_ne () const |
| Return the target node of the current arc. | |
| Node * | get_tgt_node () const |
| Return the target node of the current arc; it throws as get_curr(). | |
Private Attributes | |
| void ** | arcs = nullptr |
| long | num_arcs = 0 |
| long | pos = 0 |
| Node * | src_node = nullptr |
Iterator over the arcs of a node.
It goes through the arcs that the node has when the iterator is built, in the order of its array of arcs, with the operations of an Array_Iterator. It keeps only the array, the number of arcs, the position and the node, so that a search that keeps an iterator for each node of a path, as the depth-first ones do, copies little.
Definition at line 353 of file tpl_agraph.H.
| using Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::Item_Type = Arc * |
The data type returned by get_curr().
Definition at line 362 of file tpl_agraph.H.
| using Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::Set_Type = Node * |
The set type over which iteration is performed.
Definition at line 365 of file tpl_agraph.H.
|
inlinenoexcept |
Instantiate an empty (invalid) iterator.
Definition at line 368 of file tpl_agraph.H.
|
inlinenoexcept |
Instantiate an iterator over node src.
Definition at line 373 of file tpl_agraph.H.
|
inlinenoexcept |
Put the iterator past the last arc.
Definition at line 462 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::num_arcs, and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
|
inlinenoexcept |
Return the array of the arcs of the node.
Definition at line 384 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::arcs.
|
inlinenoexcept |
Return the array of the arcs of the node.
Definition at line 381 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::arcs.
|
inline |
Return the current arc.
| underflow_error | if the iterator is before the first arc. |
| overflow_error | if the iterator is past the last arc. |
Definition at line 403 of file tpl_agraph.H.
References ah_overflow_error_if, ah_underflow_error_if, Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr_ne(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::num_arcs, and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_current_arc(), and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_tgt_node().
|
inlinenoexcept |
Return the current arc, which must exist.
Definition at line 413 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::arcs, and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_current_arc_ne(), and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_tgt_node_ne().
|
inline |
Return the current arc.
Definition at line 468 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr().
|
inlinenoexcept |
Return the current arc.
Definition at line 465 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr_ne().
|
inlinenoexcept |
Return the position of the current arc, counted from 0.
Definition at line 396 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
|
inline |
Return the target node of the current arc; it throws as get_curr().
Definition at line 478 of file tpl_agraph.H.
References GTArcCommon< ArcInfo >::get_connected_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr(), and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::src_node.
|
inline |
Return the target node of the current arc.
Definition at line 471 of file tpl_agraph.H.
References GTArcCommon< ArcInfo >::get_connected_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr_ne(), and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::src_node.
|
inlinenoexcept |
Return true if the iterator is on an arc.
Definition at line 387 of file tpl_agraph.H.
References Aleph::and, Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::num_arcs, and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
Referenced by Aleph::build_level_graph(), Aleph::capacity_scaling_maximum_flow(), Aleph::check_baseball_elimination(), compute_min_cut_capacity(), Aleph::decompose_flow(), Aleph::net_detail::fill_infinite_path(), Aleph::hlpp_maximum_flow(), Aleph::net_detail::infinite_arc_preflow(), Aleph::Net_Sup_Dem_Graph< NodeT, ArcT >::is_feasible(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::is_last(), Aleph::net_detail::node_flows(), Aleph::Net_Sup_Dem_Graph< NodeT, ArcT >::non_feasible_nodes(), Aleph::net_detail::return_dust(), Aleph::segment_image(), Aleph::MCF_LP_Solver< Net >::solve(), Aleph::solve_assignment(), Aleph::solve_circulation(), Aleph::solve_project_selection(), Aleph::ssp_shortest_path(), TEST(), TEST(), TEST(), and verify_flow_conservation().
|
inlinenoexcept |
Return true if the iterator is on the last arc.
Definition at line 390 of file tpl_agraph.H.
References Aleph::and, Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::num_arcs, and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
|
inline |
Move to the next arc.
| overflow_error | if the iterator is not on an arc, or is past the last one. |
Definition at line 426 of file tpl_agraph.H.
References ah_overflow_error_if, Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::next_ne(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::num_arcs, and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
|
inlinenoexcept |
Move to the next arc; the iterator must be on an arc.
Definition at line 419 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::next().
|
inline |
Move to the previous arc.
| underflow_error | if the iterator is not on an arc, or is before the first one. |
Definition at line 441 of file tpl_agraph.H.
References ah_underflow_error_if, Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::num_arcs, Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos, and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::prev_ne().
|
inlinenoexcept |
Move to the previous arc; the iterator must be on an arc.
Definition at line 434 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::prev().
|
inlinenoexcept |
Put the iterator on the first arc.
Definition at line 449 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset_first().
|
inlinenoexcept |
Put the iterator on the first arc.
Definition at line 452 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset().
|
inlinenoexcept |
Put the iterator on the last arc.
Definition at line 455 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::num_arcs, and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
|
inlinenoexcept |
Put the iterator on position new_pos; the number of arcs is the position past the last one.
Definition at line 459 of file tpl_agraph.H.
References Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::pos.
|
private |
Definition at line 355 of file tpl_agraph.H.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_base(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_base(), and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr_ne().
|
private |
Definition at line 356 of file tpl_agraph.H.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::end(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::is_last(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::next(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::prev(), and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset_last().
|
private |
Definition at line 357 of file tpl_agraph.H.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::end(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_curr_ne(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_pos(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::is_last(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::next(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::next_ne(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::prev(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::prev_ne(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::reset_last(), and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::set_pos().
|
private |
Definition at line 358 of file tpl_agraph.H.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_tgt_node(), and Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_tgt_node_ne().