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 |
Helpfer 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 17 of file link_cut_tree.h.
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
Definition at line 57 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::splay().
|
inlinenodiscardnoexcept |
Definition at line 27 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 150 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 36 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 167 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 163 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Registers the edge this -> child
in the aux tree.
Definition at line 139 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Definition at line 58 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Definition at line 131 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Definition at line 132 of file link_cut_tree.h.
|
inlineconstexprnoexcept |
Helpfer for Splay-Tree: rotate left/right:
Definition at line 104 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 66 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 178 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 177 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 179 of file link_cut_tree.h.
Referenced by mim::lct::Node< Node, D * >::rotate().