Go to the documentation of this file.
48 heap_ptr() : recptr(NULL), run_id(0) {};
49 heap_ptr(
const REC * a,
size_t b) : recptr(a), run_id(b) {};
58 template<
class REC,
class comp_t=std::less<REC> >
63 comp(comp_t & _): c(_) {}
65 return c(*a.recptr, *b.recptr);
101 run_id=*pq.
top().run_id();
119 inline void delete_min_and_insert(
const REC *nextelement_same_run) {
120 if (nextelement_same_run)
140 template<
class REC,
class CMPR>
165 template<
class REC,
class comp_t=std::less<REC> >
170 comp(comp_t & _): c(_) {}
172 return c(a.key, b.key);
208 run_id=pq.
top().run_id;
226 inline void delete_min_and_insert(
const REC *nextelement_same_run) {
227 if (nextelement_same_run)
248 template<
class REC,
class Compare>
258 #endif // _MERGE_HEAP_H
void deallocate()
Deallocates the space used by the heap.
size_type size() const
Returns the size of the queue.
void unsafe_push(const T &v)
Insert an element into the priority queue, possibly destroying ordering information.
void pop()
Remove the minimum element from heap.
size_t sizeofheap()
Reports the size of Heap (number of elements).
Standard binary internal heap.
void initialize()
Heapifies an initial array of elements;.
This is a record pointer element.
size_t space_per_item()
Returns the main memory space usage per item.
void allocate(size_t size)
Allocates space for the heap.
void make_safe()
Make the priority queue safe after a sequence of calls to unsafe_push.
size_t space_overhead()
Returns the fixed main memory space overhead, regardless of item count.
void resize(size_t s)
Resize priority queue to given size.
void insert(const REC *ptr, size_t run_id)
Copies an (initial) element into the heap array.
A record pointer heap base class - also serves as the full implementation for objects with a < compar...
size_t get_min_run_id()
Returns the run with the minimum key.
static constexpr double memory_coefficient() noexcept
Return the memory coefficient of the structure.
void initialize(void)
Heapifies an initial array of elements.
A record pointer heap that uses a comparison object.
void deallocate()
Deallocates the space used by the heap.
size_t space_per_item(void)
Returns the main memory space usage per item.
Simple heap based priority queue implementation.
A merge heap object base class - also serves as the full implementation for objects with a < comparis...
void extract_min(REC &el, size_t &run_id)
Extracts minimum element from heap array.
void pop_and_push(const T &v)
Remove the minimum element and insert a new element.
void insert(const REC *ptr, size_t run_id)
Copies an (initial) element into the heap array/.
void allocate(size_t size)
Allocates space for the heap.
size_t get_min_run_id()
Returns the run with the minimum key.
size_t space_overhead(void)
Returns the fixed main memory space overhead, regardless of item count.
static constexpr double memory_overhead() noexcept
Return the memory overhead of the structure.
size_t sizeofheap()
Reports the size of Heap (number of elements).
void extract_min(REC &el, size_t &run_id)
Extracts minimum element from heap array.
const T & top() const
Return the minimum element.