|
carl
25.04
Computer ARithmetic Library
|
A heap priority queue. More...
#include <Heap.h>


Data Structures | |
| class | c_iterator |
Public Types | |
| using | Configuration = C |
| using | Entry = typename Configuration::Entry |
| using | const_iterator = c_iterator |
Public Member Functions | |
| Heap (const Configuration &configuration) | |
| Configuration & | getConfiguration () |
| const Configuration & | getConfiguration () const |
| std::string | get_name () const |
| void | push (Entry entry) |
| void | push (const Entry *begin, const Entry *end) |
| Entry | pop () |
| Entry | top () const |
| bool | empty () const |
| size_t | size () const |
| c_iterator | begin () const |
| c_iterator | end () const |
| std::vector< Entry > | getCopy () const |
| void | print (std::ostream &out=std::cout) const |
| void | decreaseTop (Entry newEntry) |
| void | decreasePos (Entry newEntry, c_iterator pos) |
| void | popPosition (c_iterator pos) |
| size_t | getMemoryUse () const |
Private Types | |
| using | Tree = CompactTree< Entry, Configuration::fastIndex > |
| using | Node = typename Tree::Node |
Private Member Functions | |
| Node | moveHoleDown (Node hole) |
| void | moveValueDown (Node pos, Entry value) |
| void | moveValueUp (Node pos, Entry value) |
| bool | isValid () const |
Private Attributes | |
| Tree | _tree |
| Configuration | _conf |
A heap priority queue.
Configuration serves the same role as for Geobucket. It must have these fields that work as for Geobucket.
A type Entry A type CompareResult A const or static method: CompareResult compare(Entry, Entry) A const or static method: bool cmpLessThan(CompareResult) A static const bool supportDeduplication A static or const method: bool cmpEqual(CompareResult) A static or const method: Entry deduplicate(Entry a, Entry b)
It also has these additional fields:
A static const bool fastIndex If this field is true, then a faster way of calculating indexes is used. This requires sizeof(Entry) to be a power of two! This can be achieved by adding padding to Entry, but this class does not do that for you.
| using carl::Heap< C >::Configuration = C |
| using carl::Heap< C >::const_iterator = c_iterator |
| using carl::Heap< C >::Entry = typename Configuration::Entry |
|
private |
|
private |
|
inlineexplicit |
|
inline |
| void carl::Heap< C >::decreasePos | ( | Entry | newEntry, |
| c_iterator | pos | ||
| ) |
| void carl::Heap< C >::decreaseTop | ( | Entry | newEntry | ) |
|
inline |
|
inline |
| std::string carl::Heap< C >::get_name |
|
inline |
|
inline |
|
inline |
| size_t carl::Heap< C >::getMemoryUse |
|
private |
|
private |
|
private |
|
private |
| Heap< C >::Entry carl::Heap< C >::pop |
|
inline |
| void carl::Heap< C >::print | ( | std::ostream & | out = std::cout | ) | const |
| void carl::Heap< C >::push | ( | const Entry * | begin, |
| const Entry * | end | ||
| ) |
| void carl::Heap< C >::push | ( | Entry | entry | ) |
|
inline |
|
inline |
|
private |
|
private |