|
MimIR 0.1
MimIR is my Intermediate Representation
|
This is an intrusive Link-Cut-Tree. More...
#include <mim/util/link_cut_tree.h>
Public Member Functions | |
| constexpr | Node () noexcept=default |
Getters | |
| bool | contains (const K &k) noexcept |
| constexpr P * | find (const K &k) noexcept |
Find k or the element just greater than k. | |
parent | |
| constexpr Node * | aux_parent () noexcept |
| constexpr P * | path_parent () noexcept |
Splay Tree | |
| constexpr void | splay () noexcept |
Splays this to the root of its splay tree. | |
| template<size_t l> | |
| constexpr void | rotate () noexcept |
| Helper for Splay-Tree: rotate left/right: | |
| constexpr void | rol () noexcept |
| constexpr void | ror () noexcept |
Link-Cut-Tree | |
| constexpr void | link (Node *child) noexcept |
Registers the edge this -> child in the aux tree. | |
| constexpr P * | expose () noexcept |
Make a preferred path from this to root while putting this at the root of the aux tree. | |
| constexpr P * | lca (Node *other) noexcept |
Least Common Ancestor of this and other in the aux tree; leaves other exposed. | |
| constexpr bool | is_descendant_of (Node *other) noexcept |
Is this a descendant of other in the aux tree? | |
Public Attributes | |
| Node * | parent = nullptr |
| parent or path-parent | |
| Node * | bot = nullptr |
| left/deeper/bottom/leaf-direction | |
| Node * | top = nullptr |
| right/shallower/top/root-direction | |
This is an intrusive Link-Cut-Tree.
Intrusive means that you have to inherit from this class via CRTP like this:
Definition at line 18 of file link_cut_tree.h.
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
Definition at line 58 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::splay().
|
inlinenodiscardnoexcept |
Definition at line 28 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Make a preferred path from this to root while putting this at the root of the aux tree.
Definition at line 152 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::contains(), mim::lct::Node< Node, D * >::find(), mim::lct::Node< Node, D * >::is_descendant_of(), mim::lct::Node< Node, D * >::lca(), and mim::lct::Node< Node, D * >::link().
|
inlineconstexprnoexcept |
Find k or the element just greater than k.
Definition at line 37 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Is this a descendant of other in the aux tree?
Also true, if this == other.
Definition at line 169 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Least Common Ancestor of this and other in the aux tree; leaves other exposed.
nullptr, if a and b are in different trees. Definition at line 165 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Registers the edge this -> child in the aux tree.
Definition at line 141 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Definition at line 59 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Definition at line 133 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Definition at line 134 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Helper for Splay-Tree: rotate left/right:
Definition at line 106 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::rol(), and mim::lct::Node< Node, D * >::ror().
|
inlineconstexprnoexcept |
Splays this to the root of its splay tree.
Definition at line 67 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::expose().
| Node* mim::lct::Node< P, K >::bot = nullptr |
left/deeper/bottom/leaf-direction
Definition at line 181 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::rotate().
| Node* mim::lct::Node< P, K >::parent = nullptr |
parent or path-parent
Definition at line 180 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::expose().
| Node* mim::lct::Node< P, K >::top = nullptr |
right/shallower/top/root-direction
Definition at line 182 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::rotate().