$extrastylesheet
#include <mln/util/soft_heap.hh>
Public Member Functions | |
| soft_heap (unsigned r=20) | |
| ~soft_heap () | |
| void | clear () |
| head< T, R > * | head_hook_ () const |
| bool | is_empty () const |
| bool | is_valid () const |
| int | nelements () const |
| T | pop_front () |
| void | push (const T &element) |
| void | push (soft_heap< T, R > &sh) |
| void | soft_clear_ () |
Public Types | |
| typedef Object< void > | category |
| typedef T | element |
| typedef soft_heap< T, R > | exact_t |
Soft heap.
T key, the data to store in the heap. For instance a point 2d. R rank, for instance int_u8
Definition at line 178 of file soft_heap.hh.
| mln::util::soft_heap< T, R >::soft_heap | ( | unsigned | r = 20 | ) |
Default constructor.
A corruption threshold r can be specified. This threshold means that if nodes have a rank higher than this threshold they can be "corrupted" and therefore their rank can be reduced.
| mln::util::soft_heap< T, R >::~soft_heap | ( | ) |
Destructor.
| void mln::util::soft_heap< T, R >::clear | ( | ) |
Clear the heap.
| head<T,R>* mln::util::soft_heap< T, R >::head_hook_ | ( | ) | const |
Internal use only.
Return a pointer to the first header struct of this heap.
| bool mln::util::soft_heap< T, R >::is_empty | ( | ) | const |
Return true if there is at least one element.
| bool mln::util::soft_heap< T, R >::is_valid | ( | ) | const |
Return true if there is at least one element.
| int mln::util::soft_heap< T, R >::nelements | ( | ) | const |
Return the number of element in the heap.
| T mln::util::soft_heap< T, R >::pop_front | ( | ) |
Returns the element with the lowest priority and remove it from the heap.
| void mln::util::soft_heap< T, R >::push | ( | const T & | element | ) |
Add a new element element.
| void mln::util::soft_heap< T, R >::push | ( | soft_heap< T, R > & | sh | ) |
Merge sh with this heap.
Be ware that after this call, sh will be empty. This heap will hold the elements which were part of sh.
| void mln::util::soft_heap< T, R >::soft_clear_ | ( | ) |
|
inherited |
| typedef T mln::util::soft_heap< T, R >::element |
Element associated type.
Definition at line 185 of file soft_heap.hh.