|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
#include <Tree_Decomposition.H>
Public Types | |
| using | Node = typename GT::Node |
| using | Arc = typename GT::Arc |
Public Member Functions | |
| Rooted_Tree_Topology (const GT &g, Node *root, SA sa=SA()) | |
| Rooted_Tree_Topology (const Rooted_Tree_Topology &other)=default | |
| Copy the topology of another tree. | |
| Rooted_Tree_Topology (Rooted_Tree_Topology &&other) noexcept(std::is_nothrow_move_constructible_v< SA >) | |
| Take the topology of another tree, which is left empty. | |
| Rooted_Tree_Topology & | operator= (const Rooted_Tree_Topology &other)=default |
| Copy the topology of another tree. | |
| Rooted_Tree_Topology & | operator= (Rooted_Tree_Topology &&other) noexcept(noexcept(swap(other))) |
| Exchange this topology with another, which is left with the previous topology of this one. | |
| void | swap (Rooted_Tree_Topology &other) noexcept(std::is_nothrow_swappable_v< SA >) |
| Exchange in O(1) this topology and another. | |
| size_t | size () const noexcept |
| bool | is_empty () const noexcept |
| Node * | root () const noexcept |
| size_t | root_id () const noexcept |
| const Array< Node * > & | id_to_node () const noexcept |
| const Array< Array< size_t > > & | adjacency () const noexcept |
| size_t | id_of (const Node *node) const |
| Node * | node_of (const size_t id) const |
| void | validate_id (const size_t id, const char *where) const |
Static Public Attributes | |
| static constexpr size_t | NONE = std::numeric_limits<size_t>::max() |
Private Types | |
| using | Pair_Key = std::pair< size_t, size_t > |
Private Member Functions | |
| void | check_id (const size_t id, const char *where) const |
| void | index_nodes () |
| void | build_simple_adjacency () |
| void | validate_connected_acyclic () const |
Static Private Member Functions | |
| static Pair_Key | normalize_pair (size_t u, size_t v) noexcept |
Private Attributes | |
| const GT * | graph_ = nullptr |
| SA | sa_ |
| Node * | root_ = nullptr |
| size_t | root_id_ = NONE |
| size_t | n_ = 0 |
| Array< Node * > | id_to_node_ |
| MapOLhash< Node *, size_t > | node_to_id_ |
| Array< Array< size_t > > | adjacency_ |
Definition at line 154 of file Tree_Decomposition.H.
| using Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::Arc = typename GT::Arc |
Definition at line 161 of file Tree_Decomposition.H.
| using Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::Node = typename GT::Node |
Definition at line 160 of file Tree_Decomposition.H.
|
private |
Definition at line 166 of file Tree_Decomposition.H.
|
inline |
Definition at line 333 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::index_nodes(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::validate_connected_acyclic().
|
default |
Copy the topology of another tree.
| [in] | other | topology to copy. |
|
inlinenoexcept |
Take the topology of another tree, which is left empty.
The implicit move took the arrays and the map but copied the number of nodes and the root: the moved-from topology then passed the checks of the ids, and so did the engines that hold it, which read arrays that they no longer had.
| [in,out] | other | topology to move from. |
Definition at line 355 of file Tree_Decomposition.H.
|
inlinenoexcept |
Definition at line 414 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::adjacency_.
Referenced by Aleph::Gen_Centroid_Decomposition< GT, SA >::append_centroid_annotations(), Aleph::Gen_Centroid_Decomposition< GT, SA >::build_centroid_tree(), Aleph::Gen_Heavy_Light_Decomposition< GT, SA >::build_decomposition(), Aleph::Gen_Centroid_Decomposition< GT, SA >::choose_centroid(), and Aleph::Gen_Centroid_Decomposition< GT, SA >::collect_component_nodes().
|
inlineprivate |
Definition at line 229 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::adjacency_, ah_domain_error_if, ah_runtime_error_unless, Aleph::and, GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::graph_, Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::n_, Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::node_to_id_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::normalize_pair(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::sa_, Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), and Aleph::MapOpenHash< Key, Data, Cmp, HashTable >::search().
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::Rooted_Tree_Topology().
|
inlineprivate |
Definition at line 186 of file Tree_Decomposition.H.
References ah_out_of_range_error_if, and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::n_.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::node_of(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::validate_id().
|
inline |
Definition at line 419 of file Tree_Decomposition.H.
References ah_domain_error_if, ah_invalid_argument_if, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::node_to_id_, and Aleph::MapOpenHash< Key, Data, Cmp, HashTable >::search().
|
inlinenoexcept |
Definition at line 409 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::id_to_node_.
|
inlineprivate |
Definition at line 192 of file Tree_Decomposition.H.
References ah_domain_error_if, ah_runtime_error_unless, Aleph::Array< T >::create(), Aleph::MapOpenHash< Key, Data, Cmp, HashTable >::find(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::graph_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::id_to_node_, Aleph::MapOpenHash< Key, Data, Cmp, HashTable >::insert(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::n_, Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::node_to_id_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::root_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::root_id_, and Aleph::MapOpenHash< Key, Data, Cmp, HashTable >::search().
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::Rooted_Tree_Topology().
|
inlinenoexcept |
Definition at line 405 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::n_.
|
inline |
Definition at line 431 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::check_id(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::id_to_node_.
|
inlinestaticprivatenoexcept |
Definition at line 179 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency().
|
default |
Copy the topology of another tree.
| [in] | other | topology to copy. |
|
inlinenoexcept |
Exchange this topology with another, which is left with the previous topology of this one.
| [in,out] | other | topology to move from. |
Definition at line 375 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap().
|
inlinenoexcept |
Definition at line 406 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::root_.
|
inlinenoexcept |
Definition at line 407 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::root_id_.
Referenced by Aleph::Gen_Centroid_Decomposition< GT, SA >::build_centroid_tree(), and Aleph::Gen_Heavy_Light_Decomposition< GT, SA >::build_decomposition().
|
inlinenoexcept |
Definition at line 404 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::n_.
|
inlinenoexcept |
Exchange in O(1) this topology and another.
| [in,out] | other | topology to exchange with. |
| what | swapping the filters throws. They are exchanged first, so that, if that swap throws, nothing else is exchanged, and both topologies are left as they were if it left its arguments as they were. |
Definition at line 389 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::adjacency_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::graph_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::id_to_node_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::n_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::node_to_id_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::root_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::root_id_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::sa_, Aleph::Array< T >::swap(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap().
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::operator=(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap().
|
inlineprivate |
Definition at line 285 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::adjacency_, ah_domain_error_if, Aleph::Array< T >::create(), Aleph::DynListStack< T >::is_empty(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::n_, Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::NONE, Aleph::DynListStack< T >::pop(), Aleph::DynListStack< T >::push(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::root_id_, and Aleph::DynListStack< T >::top().
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::Rooted_Tree_Topology().
|
inline |
Definition at line 437 of file Tree_Decomposition.H.
References Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::check_id().
|
private |
Definition at line 177 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::validate_connected_acyclic().
|
private |
Definition at line 168 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::index_nodes(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap().
|
private |
Definition at line 175 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::id_to_node(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::index_nodes(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::node_of(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap().
|
private |
Definition at line 173 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::check_id(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::index_nodes(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::is_empty(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::size(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::validate_connected_acyclic().
|
private |
Definition at line 176 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::id_of(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::index_nodes(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap().
|
staticconstexpr |
Definition at line 163 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::validate_connected_acyclic().
|
private |
|
private |
Definition at line 171 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::index_nodes(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::root_id(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::validate_connected_acyclic().
|
private |
Definition at line 169 of file Tree_Decomposition.H.
Referenced by Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), and Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::swap().