GitHub link
The Polygon Mesh Processing Library
Heap< HeapEntry, HeapInterface > Class Template Reference

A class implementing a heap.

#include <pmp/algorithms/Heap.h>

Inherits vector< HeapEntry >.

Public Member Functions

 Heap ()
 Heap (const HeapInterface &i)
 Construct with a given HeapInterface.
 ~Heap ()
void clear ()
 clear the heap
bool empty ()
 is heap empty?
unsigned int size ()
 returns the size of heap
void reserve (unsigned int n)
 reserve space for N entries
void reset_heap_position (HeapEntry h)
 reset heap position to -1 (not in heap)
bool is_stored (HeapEntry h)
 is an entry in the heap?
void insert (HeapEntry h)
 insert the entry h
HeapEntry front ()
 get the first entry
void pop_front ()
 delete the first entry
void remove (HeapEntry h)
 remove an entry
void update (HeapEntry h)
 update an entry: change the key and update the position to reestablish the heap property.
bool check ()
 Check heap condition. More...

Member Function Documentation

◆ check()

bool check ( )
true if heap condition is satisfied, false if not.