PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
|
Fixed-size max heap. More...
#include <Heap.h>
Public Member Functions | |
PBAT_HOST_DEVICE | Heap (Less _less=Less{}) |
Construct a new Heap object. | |
PBAT_HOST_DEVICE void | Push (T value) |
Push an element to the heap. | |
PBAT_HOST_DEVICE T | Pop () |
Pop the top element from the heap. | |
PBAT_HOST_DEVICE T const & | Top () const |
Get the top element of the heap. | |
PBAT_HOST_DEVICE auto | Size () const |
Get the size of the heap. | |
PBAT_HOST_DEVICE bool | IsEmpty () const |
Check if the heap is empty. | |
PBAT_HOST_DEVICE bool | IsFull () const |
Check if the heap is full. | |
Fixed-size max heap.
T | Type of the elements |
Less | Less-than comparator |
kCapacity | Capacity of the heap |
|
inline |
Construct a new Heap object.
_less | Comparator for the heap |
|
inline |
Check if the heap is empty.
|
inline |
Check if the heap is full.
|
inline |
Pop the top element from the heap.
|
inline |
Push an element to the heap.
value | Element to push |
|
inline |
Get the size of the heap.
|
inline |
Get the top element of the heap.