$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mln::util::tree_fast< T > Struct Template Reference

#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< Tdata_
std::vector< unsignedparent_
unsigned root_

Detailed Description

template<typename T>
struct mln::util::tree_fast< T >

Definition at line 44 of file tree_fast.hh.

Constructor & Destructor Documentation

template<typename T>
mln::util::tree_fast< T >::tree_fast ( )

Constructor.

template<typename T>
mln::util::tree_fast< T >::tree_fast ( T elt)

Constructor.

Parameters
[in]eltThe value of the root of the tree.

Member Function Documentation

template<typename T>
unsigned mln::util::tree_fast< T >::add_child ( unsigned  i,
T elt 
)

Add a child with value elt to the i th node.

Returns
The position of the add child.
template<typename T>
unsigned mln::util::tree_fast< T >::add_parent ( T elt)

Add a parent with value elt to this tree.

Returns
The position of the new root of this tree.
template<typename T>
bool mln::util::tree_fast< T >::has ( T elt) const

Check if the tree has elt.

Returns
true if it has it else false.
template<typename T>
bool mln::util::tree_fast< T >::is_root ( unsigned  i) const

Check if the node at position i is the root node.

Returns
true if it's the node root it else false.
template<typename T>
unsigned mln::util::tree_fast< T >::search ( T elt) const

Search the position of the node with elt.

Parameters
[in]eltThe value of the searched node.
Returns
the position of the node if it's found else UINT_MAX.
template<typename T>
unsigned mln::util::tree_fast< T >::size ( ) const

Return the size of the tree.

Returns
the number of node of the tree.

Member Data Documentation

template<typename T>
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.

template<typename T>
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.

template<typename T>
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.

template<typename T>
unsigned mln::util::tree_fast< T >::root_

The position of the root in data_.

Definition at line 110 of file tree_fast.hh.