![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
the nodes of splay trees More...
#include <agrum/tools/core/splay.h>
Protected Attributes | |
Data Members | |
Element | elt |
The content. More... | |
Size | size |
The size of the sub-tree. More... | |
SplayBinaryNode * | fg |
The left child. More... | |
SplayBinaryNode * | fd |
The right child. More... | |
SplayBinaryNode * | pere |
The father, nullptr for the root. More... | |
Protected Member Functions | |
Constructors / Destructors | |
SplayBinaryNode (const Element &e, HashTable< Element, SplayBinaryNode< Element > * > &addr, SplayBinaryNode *g=0, SplayBinaryNode *d=0, SplayBinaryNode *p=0) | |
Basic constructor: creates a node with a reference to the element. More... | |
SplayBinaryNode (const SplayBinaryNode< Element > &from, HashTable< Element, SplayBinaryNode< Element > * > &addr) | |
Copy constructor. More... | |
void | copy_ (const SplayBinaryNode< Element > &from, HashTable< Element, SplayBinaryNode< Element > * > &addr) |
A function used to perform copies. More... | |
~SplayBinaryNode () | |
Class destructor. More... | |
Friends | |
class | SplayTree< Element > |
Friendly with SplayTree. More... | |
std::ostream & | operator<< (std::ostream &out, const SplayBinaryNode< Element > &) |
Friendly to display. More... | |
Accessors / Modifiers | |
int | position () const |
Position of the node. More... | |
const Element & | getElement () const |
Returns the element in the node. More... | |
const SplayBinaryNode< Element > * | getFg () const |
Returns the left child. More... | |
const SplayBinaryNode< Element > * | getFd () const |
Returns the right child. More... | |
SplayBinaryNode< Element > * | zig () |
A right rotation, the node must have a father. More... | |
SplayBinaryNode< Element > * | zag () |
A left rotation, the node must hava a father. More... | |
SplayBinaryNode< Element > * | splay () |
A splay rotation, the node will be the root of the tree. More... | |
SplayBinaryNode< Element > * | join (const SplayBinaryNode< Element > *e, HashTable< Element, SplayBinaryNode< Element > * > &addr) |
Concatenation of two trees. More... | |
the nodes of splay trees
These file implements a data structure. A splay tree is a self-balancing binary search tree.
|
protected |
Basic constructor: creates a node with a reference to the element.
e | The element in the node. |
addr | TODO don't know what to do here. |
g | The left child of the node, can be nullptr. |
d | The right child of the node, can be nullptr. |
p | The father of the node, can be nullptr if the node is the root of the tree. |
Definition at line 72 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
Copy constructor.
from | the src SplayBinaryNode |
addr | TODO don't know what to do here. |
Definition at line 92 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
Class destructor.
Definition at line 103 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
A function used to perform copies.
from | the src SplayBinaryNode |
addr | TODO don't know what to do here .. |
Definition at line 41 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE const Element & gum::SplayBinaryNode< Element >::getElement | ( | ) | const |
Returns the element in the node.
Definition at line 319 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE const SplayBinaryNode< Element > * gum::SplayBinaryNode< Element >::getFd | ( | ) | const |
Returns the right child.
Definition at line 339 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE const SplayBinaryNode< Element > * gum::SplayBinaryNode< Element >::getFg | ( | ) | const |
Returns the left child.
Definition at line 329 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
Concatenation of two trees.
e | The node to add. |
addr | TODO Don't know what to do here. |
Definition at line 263 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE int gum::SplayBinaryNode< Element >::position | ( | ) | const |
Position of the node.
Definition at line 292 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
A splay rotation, the node will be the root of the tree.
Definition at line 217 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
A left rotation, the node must hava a father.
Definition at line 167 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
A right rotation, the node must have a father.
Definition at line 116 of file splay_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
friend |
Friendly to display.
Definition at line 787 of file splay_tpl.h.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |