#include <tree_fast.hh>
Public Member Functions | |
unsigned | add_child (unsigned i, T &elt) |
Add a child with value elt to the i th node. | |
unsigned | add_parent (T &elt) |
Add a parent with value elt to this tree. | |
bool | has (T &elt) const |
Check if the tree has elt . | |
bool | is_root (unsigned i) const |
Check if the node at position i is the root node. | |
unsigned | search (T &elt) const |
Search the position of the node with elt . | |
unsigned | size () const |
Return the size of the tree. | |
tree_fast (T &elt) | |
Constructor. | |
tree_fast () | |
Constructor. | |
Public Attributes | |
std::vector< std::vector < unsigned > > | child_ |
The vector of the vector children position of all node of the tree. | |
std::vector< T > | data_ |
The vector of the value of all node of the tree. | |
std::vector< unsigned > | parent_ |
The vector of the parent's position of all node of the tree. | |
unsigned | root_ |
The position of the root in data_. |
Definition at line 44 of file tree_fast.hh.
mln::util::tree_fast< T >::tree_fast | ( | ) | [inline] |
mln::util::tree_fast< T >::tree_fast | ( | T & | elt | ) | [inline] |
Constructor.
Definition at line 125 of file tree_fast.hh.
References mln::util::tree_fast< T >::child_, mln::util::tree_fast< T >::data_, mln::util::tree_fast< T >::parent_, and mln::util::tree_fast< T >::root_.
unsigned mln::util::tree_fast< T >::add_child | ( | unsigned | i, | |
T & | elt | |||
) | [inline] |
Add a child with value elt
to the i
th node.
Definition at line 180 of file tree_fast.hh.
References mln::util::tree_fast< T >::child_, mln::util::tree_fast< T >::data_, and mln::util::tree_fast< T >::parent_.
Referenced by mln::util::impl::tree_to_fast_().
unsigned mln::util::tree_fast< T >::add_parent | ( | T & | elt | ) | [inline] |
Add a parent with value elt
to this tree.
Definition at line 194 of file tree_fast.hh.
References mln::util::tree_fast< T >::child_, mln::util::tree_fast< T >::data_, mln::util::tree_fast< T >::parent_, and mln::util::tree_fast< T >::root_.
bool mln::util::tree_fast< T >::has | ( | T & | elt | ) | const [inline] |
Check if the tree has elt
.
Definition at line 146 of file tree_fast.hh.
References mln::util::tree_fast< T >::data_.
bool mln::util::tree_fast< T >::is_root | ( | unsigned | i | ) | const [inline] |
Check if the node at position i
is the root node.
Definition at line 172 of file tree_fast.hh.
References mln::util::tree_fast< T >::root_.
unsigned mln::util::tree_fast< T >::search | ( | T & | elt | ) | const [inline] |
Search the position of the node with elt
.
Bug the search failed.
Definition at line 158 of file tree_fast.hh.
References mln::util::tree_fast< T >::data_.
unsigned mln::util::tree_fast< T >::size | ( | ) | const [inline] |
Return the size of the tree.
Definition at line 137 of file tree_fast.hh.
References mln::util::tree_fast< T >::data_.
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.
Referenced by mln::util::tree_fast< T >::add_child(), mln::util::tree_fast< T >::add_parent(), mln::util::tree_fast< T >::tree_fast(), and mln::util::impl::tree_fast_to_image().
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.
Referenced by mln::util::tree_fast< T >::add_child(), mln::util::tree_fast< T >::add_parent(), mln::util::tree_fast< T >::has(), mln::util::tree_fast< T >::search(), mln::util::tree_fast< T >::size(), mln::util::tree_fast< T >::tree_fast(), and mln::util::impl::tree_fast_to_image().
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.
Referenced by mln::util::tree_fast< T >::add_child(), mln::util::tree_fast< T >::add_parent(), and mln::util::tree_fast< T >::tree_fast().
unsigned mln::util::tree_fast< T >::root_ |
The position of the root in data_.
Definition at line 110 of file tree_fast.hh.
Referenced by mln::util::tree_fast< T >::add_parent(), mln::util::tree_fast< T >::is_root(), mln::util::tree_fast< T >::tree_fast(), and mln::util::impl::tree_fast_to_image().