#include <WEMHeap.h>

Public Member Functions | |
| WEMHeap () | |
| Standard constructor. | |
| ~WEMHeap () | |
| Standard destructor. | |
| T * | root () |
| Get root (fist) element of heap, typecast from WEMPrimitive to T. | |
| const T * | root () const |
| Get root (fist) element of heap, typecast from WEMPrimitive to T. | |
| void | swap (unsigned int i, unsigned int j) |
| Swap two heap elements and resort heap. | |
| void | insert (WEMPrimitive *wp) |
| Insert heap element, resort heap. | |
| void | insert (WEMPrimitive *wp, double v) |
| Insert heap element and set value, resort heap. | |
| void | update (WEMPrimitive *wp, double nv) |
| Update given heap element with new value, resort heap. | |
| int | remove (WEMPrimitive *wp) |
| Remove heap element, resort heap. | |
| void | sort () |
| Sort heap. | |
Elements are sorted while inserting them in the heap.
Definition at line 31 of file WEMHeap.h.
| ml::WEMHeap< T >::WEMHeap | ( | ) | [inline] |
Standard constructor.
Definition at line 74 of file WEMHeap.h.
References ML_TRACE_IN_TIME_CRITICAL.
| ml::WEMHeap< T >::~WEMHeap | ( | ) | [inline] |
Standard destructor.
Definition at line 82 of file WEMHeap.h.
References ml::WEMVector< WEMPrimitive >::clear(), and ML_TRACE_IN_TIME_CRITICAL.
| void ml::WEMHeap< T >::insert | ( | WEMPrimitive * | wp, | |
| double | v | |||
| ) | [inline] |
Insert heap element and set value, resort heap.
Definition at line 143 of file WEMHeap.h.
References ml::WEMVector< WEMPrimitive >::appendUnsafe(), ml::WEMPrimitive::getHeapPosition(), ml::WEMVector< WEMPrimitive >::last(), ML_TRACE_IN_TIME_CRITICAL, ml::WEMVector< WEMPrimitive >::num(), ml::WEMPrimitive::setHeapPosition(), ml::WEMPrimitive::setHeapValue(), and ml::WEMHeap< T >::update().
| void ml::WEMHeap< T >::insert | ( | WEMPrimitive * | wp | ) | [inline] |
Insert heap element, resort heap.
Definition at line 127 of file WEMHeap.h.
References ml::WEMVector< WEMPrimitive >::appendUnsafe(), ml::WEMPrimitive::getHeapPosition(), ml::WEMVector< WEMPrimitive >::last(), ML_TRACE_IN_TIME_CRITICAL, ml::WEMVector< WEMPrimitive >::num(), and ml::WEMPrimitive::setHeapPosition().
Referenced by ml::WEMHeap< T >::sort().
| int ml::WEMHeap< T >::remove | ( | WEMPrimitive * | wp | ) | [inline, virtual] |
Remove heap element, resort heap.
Reimplemented from ml::WEMVector< WEMPrimitive >.
Definition at line 163 of file WEMHeap.h.
References ml::WEMVector< WEMPrimitive >::at(), ml::WEMVector< WEMPrimitive >::deleteLast(), ml::WEMPrimitive::getHeapPosition(), ml::WEMPrimitive::getHeapValue(), ML_TRACE_IN_TIME_CRITICAL, ml::WEMVector< WEMPrimitive >::num(), ml::WEMPrimitive::setHeapPosition(), and ml::WEMHeap< T >::swap().
| const T * ml::WEMHeap< T >::root | ( | ) | const [inline] |
Get root (fist) element of heap, typecast from WEMPrimitive to T.
Definition at line 106 of file WEMHeap.h.
References ML_TRACE_IN_TIME_CRITICAL, and ml::WEMHeap< T >::root().
| T * ml::WEMHeap< T >::root | ( | ) | [inline] |
Get root (fist) element of heap, typecast from WEMPrimitive to T.
Definition at line 92 of file WEMHeap.h.
References ml::WEMVector< WEMPrimitive >::first(), ML_TRACE_IN_TIME_CRITICAL, and T.
Referenced by ml::WEMHeap< T >::root().
| void ml::WEMHeap< T >::sort | ( | ) | [inline] |
Sort heap.
Definition at line 255 of file WEMHeap.h.
References ml::WEMVector< T >::append(), ml::WEMVector< T >::at(), ml::WEMVector< WEMPrimitive >::at(), ml::WEMVector< WEMPrimitive >::clear(), ml::WEMHeap< T >::insert(), ML_CHECK_NEW, ML_DELETE, ML_TRACE_IN_TIME_CRITICAL, ml::WEMVector< T >::num(), and ml::WEMVector< WEMPrimitive >::num().
| void ml::WEMHeap< T >::swap | ( | unsigned int | i, | |
| unsigned int | j | |||
| ) | [inline, virtual] |
Swap two heap elements and resort heap.
Reimplemented from ml::WEMVector< WEMPrimitive >.
Definition at line 115 of file WEMHeap.h.
References ml::WEMVector< WEMPrimitive >::at(), ML_TRACE_IN_TIME_CRITICAL, and ml::WEMPrimitive::setHeapPosition().
Referenced by ml::WEMHeap< T >::remove().
| void ml::WEMHeap< T >::update | ( | WEMPrimitive * | wp, | |
| double | nv | |||
| ) | [inline] |
Update given heap element with new value, resort heap.
Definition at line 194 of file WEMHeap.h.
References ml::WEMPrimitive::getHeapPosition(), ml::WEMPrimitive::getHeapValue(), ML_TRACE_IN_TIME_CRITICAL, ml::WEMVector< WEMPrimitive >::num(), and ml::WEMPrimitive::setHeapValue().
Referenced by ml::WEMHeap< T >::insert().
1.5.8