#include <cmr/env.h>
#include "env_internal.h"
#include <limits.h>
Go to the source code of this file.
|
CMR_ERROR | CMRintheapInitStack (CMR *cmr, CMR_INTHEAP *heap, int memKeys) |
| Initializes an empty heap using stack memory. More...
|
|
CMR_ERROR | CMRintheapClearStack (CMR *cmr, CMR_INTHEAP *heap) |
| Clears the given heap . More...
|
|
CMR_ERROR | CMRintheapInsert (CMR_INTHEAP *heap, int key, int value) |
| Inserts a key value pair into the heap. More...
|
|
CMR_ERROR | CMRintheapDecrease (CMR_INTHEAP *heap, int key, int newValue) |
| Decreases the value of key to newValue . More...
|
|
CMR_ERROR | CMRintheapDecreaseInsert (CMR_INTHEAP *heap, int key, int newValue) |
| Decreases the value of key to newValue or inserts it. More...
|
|
static bool | CMRintheapEmpty (CMR_INTHEAP *heap) |
| Returns true if the heap is empty. More...
|
|
static int | CMRintheapMinimumKey (CMR_INTHEAP *heap) |
| Returns the key of the minimum element. More...
|
|
static int | CMRintheapMinimumValue (CMR_INTHEAP *heap) |
| Returns the value of the minimum element. More...
|
|
static bool | CMRintheapContains (CMR_INTHEAP *heap, int key) |
| Returns true if an element with key is present in the heap. More...
|
|
static int | CMRintheapGetValue (CMR_INTHEAP *heap, int key) |
|
static int | CMRintheapGetValueInfinity (CMR_INTHEAP *heap, int key) |
| Reutrns the value of key or INT_MAX if there is no such element. More...
|
|
int | CMRintheapExtractMinimum (CMR_INTHEAP *heap) |
| Extracts the minimum element and returns its key. More...
|
|
◆ CMRintheapClearStack()
Clears the given heap
.
- Parameters
-
cmr | CMR environment. |
heap | Heap pointer. |
◆ CMRintheapContains()
static bool CMRintheapContains |
( |
CMR_INTHEAP * |
heap, |
|
|
int |
key |
|
) |
| |
|
inlinestatic |
Returns true
if an element with key
is present in the heap.
- Parameters
-
heap | Heap pointer. |
key | Key whose existence shall be checked. |
◆ CMRintheapDecrease()
Decreases the value of key
to newValue
.
- Parameters
-
heap | Heap pointer. |
key | Key of element. |
newValue | New value of element. |
◆ CMRintheapDecreaseInsert()
Decreases the value of key
to newValue
or inserts it.
- Parameters
-
heap | Heap pointer. |
key | Key of element. |
newValue | New value of element. |
◆ CMRintheapEmpty()
Returns true
if the heap is empty.
- Parameters
-
◆ CMRintheapExtractMinimum()
Extracts the minimum element and returns its key.
- Parameters
-
◆ CMRintheapGetValue()
static int CMRintheapGetValue |
( |
CMR_INTHEAP * |
heap, |
|
|
int |
key |
|
) |
| |
|
inlinestatic |
◆ CMRintheapGetValueInfinity()
static int CMRintheapGetValueInfinity |
( |
CMR_INTHEAP * |
heap, |
|
|
int |
key |
|
) |
| |
|
inlinestatic |
Reutrns the value of key
or INT_MAX
if there is no such element.
- Parameters
-
heap | Heap pointer. |
key | Key to be searched. |
◆ CMRintheapInitStack()
Initializes an empty heap using stack memory.
- Parameters
-
cmr | CMR environment. |
heap | Heap pointer. |
memKeys | Maximum number of elements and bound on key entries. |
◆ CMRintheapInsert()
Inserts a key
value
pair into the heap.
- Parameters
-
heap | Heap pointer. |
key | Key of new element. |
value | Value of new element. |
◆ CMRintheapMinimumKey()
Returns the key of the minimum element.
- Parameters
-
◆ CMRintheapMinimumValue()
static int CMRintheapMinimumValue |
( |
CMR_INTHEAP * |
heap | ) |
|
|
inlinestatic |
Returns the value of the minimum element.
- Parameters
-