$extrastylesheet
#include <mln/util/tree_fast.hh>
Public Member Functions | |
tree_fast () | |
tree_fast (T &elt) | |
unsigned | add_child (unsigned i, T &elt) |
unsigned | add_parent (T &elt) |
bool | has (T &elt) const |
bool | is_root (unsigned i) const |
unsigned | search (T &elt) const |
unsigned | size () const |
Public Attributes | |
std::vector< std::vector < unsigned > > | child_ |
std::vector< T > | data_ |
std::vector< unsigned > | parent_ |
unsigned | root_ |
Definition at line 44 of file tree_fast.hh.
mln::util::tree_fast< T >::tree_fast | ( | ) |
Constructor.
mln::util::tree_fast< T >::tree_fast | ( | T & | elt | ) |
Constructor.
[in] | elt | The value of the root of the tree. |
unsigned mln::util::tree_fast< T >::add_child | ( | unsigned | i, |
T & | elt | ||
) |
Add a child with value elt
to the i
th node.
unsigned mln::util::tree_fast< T >::add_parent | ( | T & | elt | ) |
Add a parent with value elt
to this tree.
bool mln::util::tree_fast< T >::has | ( | T & | elt | ) | const |
Check if the tree has elt
.
bool mln::util::tree_fast< T >::is_root | ( | unsigned | i | ) | const |
Check if the node at position i
is the root node.
unsigned mln::util::tree_fast< T >::search | ( | T & | elt | ) | const |
Search the position of the node with elt
.
[in] | elt | The value of the searched node. |
unsigned mln::util::tree_fast< T >::size | ( | ) | const |
Return the size of the tree.
std::vector<std::vector<unsigned> > mln::util::tree_fast< T >::child_ |
The vector of the vector children position of all node of the tree.
Definition at line 107 of file tree_fast.hh.
std::vector<T> mln::util::tree_fast< T >::data_ |
The vector of the value of all node of the tree.
Definition at line 101 of file tree_fast.hh.
std::vector<unsigned> mln::util::tree_fast< T >::parent_ |
The vector of the parent's position of all node of the tree.
Definition at line 104 of file tree_fast.hh.
unsigned mln::util::tree_fast< T >::root_ |
The position of the root in data_.
Definition at line 110 of file tree_fast.hh.