|
Milena (Olena)
User documentation 2.0a Id
|
Soft heap. More...
#include <soft_heap.hh>

Public Types | |
| typedef T | element |
| Element associated type. | |
Public Member Functions | |
| void | clear () |
| Clear the heap. | |
| bool | is_empty () const |
| Return true if there is at least one element. | |
| bool | is_valid () const |
| Return true if there is at least one element. | |
| int | nelements () const |
| Return the number of element in the heap. | |
| T | pop_front () |
| Returns the element with the lowest priority and remove it from the heap. | |
| void | push (const T &element) |
Add a new element element. | |
| void | push (soft_heap< T, R > &sh) |
Merge sh with this heap. | |
| soft_heap (unsigned r=20) | |
| Default constructor. | |
| ~soft_heap () | |
| Destructor. | |
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.
| typedef T mln::util::soft_heap< T, R >::element |
Element associated type.
Definition at line 185 of file soft_heap.hh.
|
inline |
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.
Definition at line 619 of file soft_heap.hh.
|
inline |
Destructor.
Definition at line 631 of file soft_heap.hh.
|
inline |
Clear the heap.
Definition at line 771 of file soft_heap.hh.
|
inline |
Return true if there is at least one element.
Definition at line 753 of file soft_heap.hh.
|
inline |
Return true if there is at least one element.
Definition at line 744 of file soft_heap.hh.
|
inline |
Return the number of element in the heap.
Definition at line 762 of file soft_heap.hh.
Referenced by mln::util::soft_heap< T, R >::push().
|
inline |
Returns the element with the lowest priority and remove it from the heap.
Definition at line 675 of file soft_heap.hh.
|
inline |
Add a new element element.
Definition at line 646 of file soft_heap.hh.
|
inline |
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.
Definition at line 658 of file soft_heap.hh.
References mln::util::soft_heap< T, R >::nelements().