|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Generic filter iterator wrapper. More...
#include <filter_iterator.H>
Public Types | |
| using | Item_Type = typename It::Item_Type |
| The type of element returned by get_curr() | |
| using | Iterator_Type = It |
| The type of the base iterator. | |
| using | Container_Type = Container |
| The type of container being iterated. | |
| using | Filter_Type = Show_Item |
| The type of the filter functor. | |
Public Member Functions | |
| const Container & | get_container () const |
| Returns a const reference to the container being iterated over. | |
| bool | has_container () const noexcept |
| Check if a container has been set. | |
| It & | get_iterator () noexcept |
| Returns a reference to the underlying base iterator. | |
| const It & | get_iterator () const noexcept |
| Returns a const reference to the underlying base iterator. | |
| Show_Item & | get_filter () noexcept |
| Returns a reference to the filter functor. | |
| const Show_Item & | get_filter () const noexcept |
| Returns a const reference to the filter functor. | |
| void | set_filter (Show_Item si) |
| Sets a new filter functor. | |
| void | set_cookie (void *__cookie) noexcept |
| Sets the cookie pointer. | |
| void * | get_cookie () const noexcept |
| Gets the cookie pointer. | |
| Filter_Iterator (Show_Item si=Show_Item()) noexcept | |
| Default constructor. | |
| Filter_Iterator (const Container &c, Show_Item si=Show_Item()) | |
| Constructs a filter iterator over a container. | |
| Filter_Iterator (Container &c, Show_Item si=Show_Item()) | |
Filter over the modifiable container c. | |
| Filter_Iterator (const Container &c, void *__cookie, Show_Item si=Show_Item()) | |
| Constructs a filter iterator with a cookie. | |
| Filter_Iterator (Container &c, void *__cookie, Show_Item si=Show_Item()) | |
See Filter_Iterator(const Container &, void *, Show_Item); over a modifiable container. | |
| void | next () |
| Advances the iterator to the next filtered element. | |
| void | next_ne () noexcept(shows_ne) |
| Advances the iterator to the next filtered element, as next() does. | |
| void | prev () |
| Moves the iterator backward to the previous filtered element. | |
| void | prev_ne () noexcept(shows_ne) |
| Moves the iterator backward, as prev() does. | |
| void | reset_first () |
| Resets the iterator to the first filtered element. | |
| void | reset_last () |
| Resets the iterator to the last filtered element. | |
| size_t | count () |
| Count the number of elements that pass the filter. | |
| bool | empty () |
| Check if there are no elements that pass the filter. | |
| template<typename Op > | |
| void | for_each (Op op) |
| Apply a function to all filtered elements. | |
| template<typename Pred > | |
| bool | find_if (Pred pred) |
| Find the first element that satisfies an additional predicate. | |
Static Public Attributes | |
| static constexpr bool | goes_back = requires (It & i) { i.prev(); } |
| Whether the base iterator moves back, as prev() and prev_ne() need. | |
| static constexpr bool | goes_to_last = requires (It & i) { i.reset_last(); i.prev(); } |
| Whether the base iterator goes to its last item and moves back, as reset_last() needs. | |
Private Member Functions | |
| bool | container_set () const noexcept |
| decltype(auto) | base_curr () |
| void | goto_first_valid_item () |
| Advance to the first element that passes the filter. | |
| void | forward_without_curr () |
| void | forward () |
| Move forward to the next element that passes the filter. | |
| void | goto_last_valid_item () |
| Move to the last element that passes the filter. | |
| void | backward () |
| Move backward to the previous element that passes the filter. | |
Static Private Member Functions | |
| static auto | kept (const Container &c) noexcept |
Private Attributes | |
| Show_Item | show_item |
| std::conditional_t< keeps_copy, Container, const Container * > | container_ptr {} |
| void * | cookie = nullptr |
| User-defined pointer for extensibility (e.g., passing context data to filter) | |
Static Private Attributes | |
| static constexpr bool | keeps_copy = filter_iterator_keeps_copy<Container> |
| static constexpr bool | shows_ne |
| static constexpr bool | unchecked = AlephUncheckedIterator<It> |
Generic filter iterator wrapper.
Filter_Iterator wraps an existing iterator and filters elements based on a user-defined predicate. Only elements that satisfy the filter predicate are visible during iteration.
This class is parameterized by the following types:
Show_Item::operator()(Item_Type) which must return true if the element should be shown, or false otherwise.The purpose of Filter_Iterator is to provide a generic iterator that filters elements according to a criterion defined by the Show_Item class. This allows generic algorithms using Filter_Iterator to have different behaviors depending on the Show_Item filter.
Aleph containers export two important types in the context of Filter_Iterator: Set_Type and Item_Type, which correspond to the type of container being iterated over and the type of element returned by the iterator It, respectively.
Usage example:
| Container | The container type being iterated over. Must be an Aleph container type that supports iteration. |
| It | The base iterator type for the container. Should be one of the iterator classes provided by Container. |
| Show_Item | A functor class that determines element visibility. Must provide: bool operator()(const Item_Type&) that returns true if the item should be shown, false otherwise. |
std::overflow_error and std::underflow_error of the base iterator there. What the filter throws goes out of every member that calls it, next_ne() and prev_ne() included, which are noexcept only when the filter is; the iterator stays then on the item on which the filter threw.Definition at line 146 of file filter_iterator.H.
| using Aleph::Filter_Iterator< Container, It, Show_Item >::Container_Type = Container |
The type of container being iterated.
Definition at line 321 of file filter_iterator.H.
| using Aleph::Filter_Iterator< Container, It, Show_Item >::Filter_Type = Show_Item |
The type of the filter functor.
Definition at line 324 of file filter_iterator.H.
| using Aleph::Filter_Iterator< Container, It, Show_Item >::Item_Type = typename It::Item_Type |
The type of element returned by get_curr()
Definition at line 315 of file filter_iterator.H.
| using Aleph::Filter_Iterator< Container, It, Show_Item >::Iterator_Type = It |
The type of the base iterator.
Definition at line 318 of file filter_iterator.H.
|
inlinenoexcept |
Default constructor.
Creates a filter iterator with only a filter functor. The container must be set later by copy/assignment from another iterator that has a container.
| si | The filter functor to use (default constructed if not provided). |
Definition at line 419 of file filter_iterator.H.
|
inline |
Constructs a filter iterator over a container.
The iterator is automatically positioned at the first element that passes the filter predicate.
| c | The container to iterate over. |
| si | The filter functor to use (default constructed if not provided). |
| std::bad_alloc | if there is not enough memory. |
| anything | that the filter throws. |
Definition at line 435 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::goto_first_valid_item().
|
inline |
Filter over the modifiable container c.
| [in] | c | the container. |
| [in] | si | the filter. |
| anything | that the filter throws. |
Definition at line 446 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::goto_first_valid_item().
|
inline |
Constructs a filter iterator with a cookie.
The cookie is a user-defined pointer that can be used to attach arbitrary data to the iterator for extensibility purposes.
| c | The container to iterate over. |
| __cookie | User-defined pointer for extensibility. |
| si | The filter functor to use (default constructed if not provided). |
| std::bad_alloc | if there is not enough memory. |
Definition at line 462 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::cookie.
|
inline |
See Filter_Iterator(const Container &, void *, Show_Item); over a modifiable container.
Definition at line 470 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::cookie.
|
inlineprivate |
Move backward to the previous element that passes the filter.
First moves back past the current element, then continues moving backward until finding an element that satisfies the filter predicate, or until reaching the beginning of the sequence.
Before the first item, the base iterator throws std::underflow_error, and the iterator stays there; what the filter throws goes out.
Definition at line 286 of file filter_iterator.H.
References Aleph::and, Aleph::HTList::Iterator::get_curr(), Aleph::HTList::Iterator::has_curr(), Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::prev(), and Aleph::Filter_Iterator< Container, It, Show_Item >::show_item.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::prev(), and Aleph::Filter_Iterator< Container, It, Show_Item >::prev_ne().
|
inlineprivate |
Definition at line 183 of file filter_iterator.H.
References Aleph::HTList::Iterator::get_curr(), Aleph::HTList::Iterator::get_curr_ne(), and Aleph::Filter_Iterator< Container, It, Show_Item >::unchecked.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::goto_first_valid_item().
|
inlineprivatenoexcept |
Definition at line 163 of file filter_iterator.H.
References Aleph::and, Aleph::Filter_Iterator< Container, It, Show_Item >::container_ptr, and Aleph::Filter_Iterator< Container, It, Show_Item >::keeps_copy.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::get_container(), and Aleph::Filter_Iterator< Container, It, Show_Item >::has_container().
|
inline |
Count the number of elements that pass the filter.
Iterates through the entire sequence and counts elements that satisfy the filter predicate. This is a destructive operation that modifies the iterator position.
Definition at line 547 of file filter_iterator.H.
References Aleph::has_curr(), Aleph::Filter_Iterator< Container, It, Show_Item >::next(), and Aleph::Filter_Iterator< Container, It, Show_Item >::reset_first().
|
inline |
Check if there are no elements that pass the filter.
Resets the iterator to the first position and checks if any element passes the filter.
Definition at line 564 of file filter_iterator.H.
References Aleph::has_curr(), and Aleph::Filter_Iterator< Container, It, Show_Item >::reset_first().
Referenced by TEST().
|
inline |
Find the first element that satisfies an additional predicate.
Searches through filtered elements until finding one that also satisfies the given predicate.
| Pred | A callable type that accepts Item_Type and returns bool. |
| pred | The additional predicate to check. |
Definition at line 603 of file filter_iterator.H.
References Aleph::get_curr(), Aleph::has_curr(), Aleph::Filter_Iterator< Container, It, Show_Item >::next(), pred, and Aleph::Filter_Iterator< Container, It, Show_Item >::reset_first().
Referenced by TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Apply a function to all filtered elements.
Iterates through all elements that pass the filter and applies the given operation to each one.
| Op | A callable type that accepts Item_Type. |
| op | The operation to apply to each filtered element. |
Definition at line 585 of file filter_iterator.H.
References Aleph::get_curr(), Aleph::has_curr(), Aleph::Filter_Iterator< Container, It, Show_Item >::next(), and Aleph::Filter_Iterator< Container, It, Show_Item >::reset_first().
|
inlineprivate |
Move forward to the next element that passes the filter.
First advances past the current element, then continues advancing until finding an element that satisfies the filter predicate, or until reaching the end of the sequence.
Past the end, the base iterator throws std::overflow_error, and the iterator stays there; what the filter throws goes out.
Definition at line 235 of file filter_iterator.H.
References Aleph::and, Aleph::Filter_Iterator< Container, It, Show_Item >::forward_without_curr(), Aleph::HTList::Iterator::get_curr_ne(), Aleph::Filter_Iterator< Container, It, Show_Item >::goto_first_valid_item(), Aleph::HTList::Iterator::has_curr(), Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::next(), Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::next_ne(), Aleph::Filter_Iterator< Container, It, Show_Item >::show_item, and Aleph::Filter_Iterator< Container, It, Show_Item >::unchecked.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::next(), and Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
|
inlineprivate |
Definition at line 213 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::goto_first_valid_item(), and Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::next().
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::forward().
|
inline |
Returns a const reference to the container being iterated over.
| std::domain_error | if the iterator was default-constructed without a container. |
Definition at line 332 of file filter_iterator.H.
References ah_domain_error_if, Aleph::Filter_Iterator< Container, It, Show_Item >::container_ptr, Aleph::Filter_Iterator< Container, It, Show_Item >::container_set(), and Aleph::Filter_Iterator< Container, It, Show_Item >::keeps_copy.
Referenced by TEST(), TEST(), and TYPED_TEST().
|
inlinenoexcept |
Gets the cookie pointer.
Definition at line 406 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::cookie.
Referenced by TEST(), TEST(), TEST(), TEST(), and TYPED_TEST().
|
inlinenoexcept |
Returns a const reference to the filter functor.
Definition at line 375 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::show_item.
|
inlinenoexcept |
Returns a reference to the filter functor.
Use this function if you need to access or modify the filter state. Note that the filter object will be destroyed when the ~Filter_Iterator() destructor is called.
Definition at line 369 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::show_item.
Referenced by TEST(), and TYPED_TEST().
|
inlinenoexcept |
Returns a const reference to the underlying base iterator.
Definition at line 359 of file filter_iterator.H.
|
inlinenoexcept |
Returns a reference to the underlying base iterator.
This provides access to the base iterator functionality if needed.
Definition at line 353 of file filter_iterator.H.
Referenced by TEST().
|
inlineprivate |
Advance to the first element that passes the filter.
Starting from the current position, advances the iterator until finding an element that satisfies the filter predicate, or until reaching the end of the sequence.
The base iterator moves only from an item, which does not throw; what the filter throws goes out.
Definition at line 200 of file filter_iterator.H.
References Aleph::and, Aleph::Filter_Iterator< Container, It, Show_Item >::base_curr(), Aleph::HTList::Iterator::has_curr(), Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::next(), Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::next_ne(), Aleph::Filter_Iterator< Container, It, Show_Item >::show_item, and Aleph::Filter_Iterator< Container, It, Show_Item >::unchecked.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::Filter_Iterator(), Aleph::Filter_Iterator< Container, It, Show_Item >::Filter_Iterator(), Aleph::Filter_Iterator< Container, It, Show_Item >::forward(), Aleph::Filter_Iterator< Container, It, Show_Item >::forward_without_curr(), and Aleph::Filter_Iterator< Container, It, Show_Item >::reset_first().
|
inlineprivate |
Move to the last element that passes the filter.
Positions the iterator at the end, then moves backward until finding an element that satisfies the filter predicate, or until reaching the beginning of the sequence.
The base iterator moves only from an item, which does not throw; what the filter throws goes out.
Definition at line 269 of file filter_iterator.H.
References Aleph::and, Aleph::HTList::Iterator::get_curr(), Aleph::HTList::Iterator::has_curr(), Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::prev(), Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::reset_last(), and Aleph::Filter_Iterator< Container, It, Show_Item >::show_item.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::reset_last().
|
inlinenoexcept |
Check if a container has been set.
Definition at line 345 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::container_set().
|
inlinestaticprivatenoexcept |
Definition at line 155 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::keeps_copy.
|
inline |
Advances the iterator to the next filtered element.
Moves forward in the sequence, skipping elements that don't pass the filter, until reaching the next visible element or the end.
| anything | that the filter throws; the iterator stays then on the item on which it threw. |
Definition at line 485 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::forward().
Referenced by JohnsonTest::computeFloydWarshall(), Aleph::Filter_Iterator< Container, It, Show_Item >::count(), count_elements(), demo_digraph(), demo_eulerian(), demo_network_vulnerability(), demo_practical(), Aleph::Filter_Iterator< Container, It, Show_Item >::find_if(), Aleph::Dial_Min_Paths< GT, Distance, Itor, SA >::find_max_weight(), Aleph::Filter_Iterator< Container, It, Show_Item >::for_each(), RandomNetworkTest::is_valid_network(), main(), Aleph::Digraph_Iterator< GT, Filter >::next(), print_degrees(), print_graph(), print_graph(), print_graph_stats(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and Aleph::vertex_connectivity().
|
inlinenoexcept |
Advances the iterator to the next filtered element, as next() does.
Definition at line 493 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::forward().
Referenced by Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::Floyd_All_Shortest_Paths(), Aleph::In_Arcs_Index< GT, SA >::In_Arcs_Index(), Aleph::hamiltonian_detail::Simple_Graph< GT, SA >::Simple_Graph(), Aleph::Test_Eulerian< GT, SN, SA >::analyze_digraph(), Aleph::Test_Eulerian< GT, SN, SA >::analyze_graph(), Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::append_lightest_arc(), Aleph::arcs(), Aleph::eulerian_detail::arcs_are_together(), Aleph::Breadth_First_Traversal< GT, Operation, SA >::bft(), Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::build_adjacency(), Aleph::tree_dp_detail::Tree_Topology< GT, SA >::build_adjacency(), Aleph::GraphCopyWithMapping< GT, Tree >::build_copy(), Aleph::IndexArc< GT, Tree, SA >::build_index(), Aleph::IndexNode< GT, Compare, Tree, SN >::build_index(), Aleph::Karger_Min_Cut< GT, SA >::build_kgraph(), Aleph::build_level_graph(), Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::build_node_index(), Aleph::hld_detail::HLD_Tree_Data< GT, SA >::build_simple_adjacency(), Aleph::lca_detail::Rooted_Tree_Data< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::k_shortest_paths_detail::build_suffix_index_digraph(), Aleph::k_shortest_paths_detail::build_suffix_index_with_itor(), Aleph::Find_Breadth_First_Spanning_Tree< GT, SA >::build_tree(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_underlying_simple_graph(), Aleph::capacity_scaling_maximum_flow(), Aleph::Path< GT >::check(), Aleph::Path< GT >::check_directed(), Aleph::clear_graph(), Aleph::compute_bipartite(), Aleph::compute_bipartite_all_components(), Aleph::compute_flow_statistics(), Aleph::compute_maximum_cardinality_bipartite_matching(), Aleph::compute_maximum_weight_general_matching(), Aleph::compute_min_cut(), Aleph::Path< GT >::contains_arc(), Aleph::Path< GT >::contains_node(), Aleph::Matrix_Graph< GT, SA >::copy(), Aleph::Copy_Graph< GT, SN, SA >::copy(), Aleph::copy_graph(), Aleph::Map_Matrix_Graph< GT, SA >::copy_list_graph(), Aleph::Bit_Mat_Graph< GT, SA >::copy_list_graph(), Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::copy_painted_min_paths_tree(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::count_shown_arcs(), Aleph::Compute_Cut_Nodes< GT, SA >::cut_nodes(), Aleph::decompose_flow(), Aleph::eulerian_detail::degree(), Aleph::digraph_graphviz(), Aleph::in_arcs_detail::digraph_in_degree(), Aleph::dinic_maximum_flow(), Aleph::edge_connectivity(), Aleph::Digraph_Iterator< GT, Filter >::end(), Aleph::export_network_to_dimacs(), Aleph::export_network_to_dot(), Aleph::export_network_to_json(), Aleph::Test_Dirac_Condition< GT, SN, SA >::find_min_degree_vertex(), Aleph::find_path_depth_first(), Aleph::Find_Eulerian_Path< GT, SN, SA >::find_start_vertex(), Aleph::blossom_weighted_detail::mwmatching::impl::Problem_Data< WeightType >::for_adjacent_edges(), Aleph::for_each_arc(), Aleph::for_each_arc(), GraphCommon< GT, Node, Arc >::for_each_arc(), GraphCommon< GT, Node, Arc >::for_each_arc(), Aleph::Path< GT >::for_each_arc(), Aleph::for_each_arc(), Aleph::for_each_node(), GraphCommon< GT, Node, Arc >::for_each_node(), Aleph::Path< GT >::for_each_node(), Aleph::forall_arc(), Aleph::forall_arc(), Aleph::forall_node(), Aleph::generate_dot_file(), Aleph::k_shortest_paths_detail::generate_general_deviation_candidates(), Aleph::generate_graphpic(), Aleph::generate_graphviz(), Aleph::generate_graphviz(), Aleph::Find_Eulerian_Path< GT, SN, SA >::hierholzer_directed(), Aleph::Find_Eulerian_Path< GT, SN, SA >::hierholzer_undirected(), Aleph::hlpp_maximum_flow(), Aleph::hopcroft_karp_matching(), Aleph::in_arcs(), Aleph::in_degree(), Aleph::in_degree(), Aleph::in_nodes(), Aleph::in_pairs(), Aleph::min_mean_cycle_detail::incoming_lists(), Aleph::negative_cycles_detail::index_graph(), Aleph::hld_detail::HLD_Tree_Data< GT, SA >::index_nodes(), Aleph::lca_detail::Rooted_Tree_Data< GT, SA >::index_nodes(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::index_nodes(), Aleph::tree_dp_detail::Tree_Topology< GT, SA >::index_nodes(), Aleph::net_detail::infinite_arc_preflow(), Aleph::IndexArc< GT, Tree, SA >::init(), Aleph::IndexNode< GT, Compare, Tree, SN >::init(), Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::init(), Aleph::Arcs_Index< GT, Compare, Tree, SA >::init(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::init(), Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA >::init_from_graph(), Aleph::inter_copy_graph(), is_valid_topological_order(), Aleph::Compute_Cut_Nodes< GT, SA >::map_cut_graph(), Aleph::min_cut(), Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::min_spanning_tree(), Aleph::network_to_dot_string(), Aleph::network_to_json_string(), Aleph::graph_to_tree_detail::Frame< GT, Key, SA >::next_arc(), Aleph::Hopcroft_Karp_Frame< GT, SA >::next_arc(), Aleph::Build_Subgraph< GT, SA >::Map_Frame::next_arc(), Aleph::Build_Subgraph< GT, SA >::Arc_Frame::next_arc(), Aleph::Compute_Cut_Nodes< GT, SA >::Cut_Frame::next_arc(), Aleph::Compute_Cut_Nodes< GT, SA >::Arc_Frame::next_arc(), Aleph::Compute_Cut_Nodes< GT, SA >::Map_Frame::next_arc(), Aleph::Compute_Bridges< GT, SA >::Frame::next_arc(), Aleph::Dfs_Arc_Frame< It >::next_arc(), Aleph::Find_Depth_First_Spanning_Tree< GT, SA >::Frame::next_arc(), Aleph::Digraph_Iterator< GT, Filter >::next_ne(), Aleph::graph_to_tree_detail::Frame< GT, Key, SA >::next_target(), Aleph::Find_Depth_First_Spanning_Tree< GT, SA >::Frame::next_target(), Aleph::Build_Subgraph< GT, SA >::Arc_Frame::next_target(), Aleph::Dfs_Arc_Frame< It >::next_target(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::number_shown_nodes(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_list_graph(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_list_graph(), Aleph::Invert_Digraph< GT, SA >::operator()(), Aleph::Operate_On_Nodes< GT, Operation, SN >::operator()(), Aleph::Operate_On_Arcs< GT, Operation, SA >::operator()(), Aleph::Operate_On_Arcs< GT, Operation, SA >::operator()(), Aleph::Test_Single_Graph< GT, SN, SA >::operator()(), Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA >::operator()(), Aleph::Operate_On_Nodes< GT, Operation, SN >::operator()(), Aleph::Operate_On_Arcs< GT, Operation, SA >::operator()(), Aleph::Operate_On_Arcs< GT, Operation, SA >::operator()(), Aleph::out_arcs(), Aleph::out_degree(), Aleph::out_nodes(), Aleph::out_pairs(), Aleph::Compute_Cut_Nodes< GT, SA >::paint_from_cut_node(), Aleph::Kruskal_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree(), Aleph::Kruskal_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree(), Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree(), Aleph::Q_Topological_Sort< GT, Itor, SA >::perform(), Aleph::rank_graphviz(), Aleph::restore_flow_solution(), Aleph::net_detail::return_dust(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::save(), Aleph::save_flow_solution(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::save_in_text_mode(), Aleph::search_arc(), GraphCommon< GT, Node, Arc >::search_arc(), GraphCommon< GT, Node, Arc >::search_arc(), GraphCommon< GT, Node, Arc >::search_arc(), Aleph::search_directed_arc(), GraphCommon< GT, Node, Arc >::search_node(), Aleph::search_spanning_tree_arc(), Aleph::solve_circulation(), Aleph::solve_transshipment(), Aleph::ssp_init_potentials(), Aleph::ssp_shortest_path(), Aleph::successive_shortest_paths(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), Aleph::Test_For_Cycle< GT, SA >::test_cycle(), Aleph::Test_Eulerian< GT, SN, SA >::test_degree_only(), Aleph::Test_Hamiltonian_Sufficiency< GT, SN, SA >::test_digraph(), Aleph::Test_Dirac_Condition< GT, SN, SA >::test_digraph(), TEST_F(), TEST_F(), TEST_F(), Aleph::Test_Hamiltonian_Sufficiency< GT, SN, SA >::test_graph(), Aleph::Test_Dirac_Condition< GT, SN, SA >::test_graph(), Aleph::Test_Single_Graph< GT, SN, SA >::test_node(), Aleph::Test_For_Path< GT, SA >::test_path(), GraphCommon< GT, Node, Arc >::traverse_arcs(), GraphCommon< GT, Node, Arc >::traverse_arcs(), Aleph::traverse_arcs(), Aleph::in_arcs_detail::traverse_arcs_into(), Aleph::in_arcs_detail::traverse_digraph_arcs_into(), GraphCommon< GT, Node, Arc >::traverse_nodes(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::uninit(), Aleph::k_shortest_paths_detail::validate_non_negative_weights(), verify_bipartition(), verify_flow_conservation(), Aleph::vertex_connectivity(), and Aleph::df_tree_detail::Df_Low_Builder< GT, Node_Label, SA >::visit().
|
inline |
Moves the iterator backward to the previous filtered element.
Moves backward in the sequence, skipping elements that don't pass the filter, until reaching the previous visible element or the beginning.
| anything | that the filter throws; the iterator stays then on the item on which it threw. |
List_SGraph, has no prev(), so that the error is at the call. Definition at line 506 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::backward().
Referenced by Aleph::Digraph_Iterator< GT, Filter >::prev(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), and TYPED_TEST().
|
inlinenoexcept |
Moves the iterator backward, as prev() does.
Definition at line 514 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::backward().
Referenced by TEST(), TEST(), TEST(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Resets the iterator to the first filtered element.
Positions the iterator at the first element in the sequence that passes the filter predicate.
Definition at line 521 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::goto_first_valid_item(), and Aleph::Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par >::reset_first().
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::count(), Aleph::Filter_Iterator< Container, It, Show_Item >::empty(), Aleph::Filter_Iterator< Container, It, Show_Item >::find_if(), Aleph::Filter_Iterator< Container, It, Show_Item >::for_each(), Aleph::Digraph_Iterator< GT, Filter >::reset_first(), TEST(), TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Resets the iterator to the last filtered element.
Positions the iterator at the last element in the sequence that passes the filter predicate.
Definition at line 535 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::goto_last_valid_item().
Referenced by Aleph::Digraph_Iterator< GT, Filter >::end(), Aleph::Digraph_Iterator< GT, Filter >::reset_last(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), and TYPED_TEST().
|
inlinenoexcept |
Sets the cookie pointer.
The cookie is a user-defined pointer for extensibility purposes, such as passing context data to the filter functor.
| __cookie | The new cookie value. |
Definition at line 400 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::cookie.
Referenced by TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Sets a new filter functor.
This allows changing the filtering criterion after construction. After setting a new filter, you should call reset_first() or reset_last() to reposition the iterator according to the new filter.
| si | The new filter functor to use. |
Definition at line 389 of file filter_iterator.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::show_item.
Referenced by TEST(), and TYPED_TEST().
|
private |
Definition at line 153 of file filter_iterator.H.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::container_set(), and Aleph::Filter_Iterator< Container, It, Show_Item >::get_container().
|
private |
User-defined pointer for extensibility (e.g., passing context data to filter)
Definition at line 172 of file filter_iterator.H.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::Filter_Iterator(), Aleph::Filter_Iterator< Container, It, Show_Item >::Filter_Iterator(), Aleph::Filter_Iterator< Container, It, Show_Item >::get_cookie(), and Aleph::Filter_Iterator< Container, It, Show_Item >::set_cookie().
|
staticconstexpr |
Whether the base iterator moves back, as prev() and prev_ne() need.
The iterators of a singly linked list, as those of the lists of arcs of List_SGraph, and of the sets of List_SGraph, go only forward.
Definition at line 307 of file filter_iterator.H.
|
staticconstexpr |
Whether the base iterator goes to its last item and moves back, as reset_last() needs.
Definition at line 312 of file filter_iterator.H.
|
staticconstexprprivate |
Definition at line 150 of file filter_iterator.H.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::container_set(), Aleph::Filter_Iterator< Container, It, Show_Item >::get_container(), and Aleph::Filter_Iterator< Container, It, Show_Item >::kept().
|
private |
Definition at line 148 of file filter_iterator.H.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::backward(), Aleph::Filter_Iterator< Container, It, Show_Item >::forward(), Aleph::Filter_Iterator< Container, It, Show_Item >::get_filter(), Aleph::Filter_Iterator< Container, It, Show_Item >::get_filter(), Aleph::Filter_Iterator< Container, It, Show_Item >::goto_first_valid_item(), Aleph::Filter_Iterator< Container, It, Show_Item >::goto_last_valid_item(), and Aleph::Filter_Iterator< Container, It, Show_Item >::set_filter().
|
staticconstexprprivate |
Definition at line 175 of file filter_iterator.H.
|
staticconstexprprivate |