Documentation for module cp_min_heap

...

source: cp_min_heap.F
Loading...

public Types:

cp_heap_type
...

public Subroutines/Functions:

SUBROUTINE
cp_heap_fill (heap, values)
Fill heap with given values
Returns the first heap element without removing it.
SUBROUTINE
cp_heap_new (heap, n)
...
SUBROUTINE
cp_heap_pop (heap, key, value, found)
Returns and removes the first heap element and rebalances the heap.
SUBROUTINE
cp_heap_release (heap)
...
Changes the value of the minimum heap element and rebalances the heap.
Changes the value of the heap element with given key and rebalances the heap.

Parameters:

INTEGER
:: keyt = int_4
INTEGER
:: valt = int_8

public Types:

TYPE :: cp_heap_type

...


INTEGER
:: n ...
INTEGER,
DIMENSION(:), POINTER :: index ...
DIMENSION(:), POINTER :: nodes ...

SUBROUTINEcp_heap_fill(heap, values)

Fill heap with given values

Arguments:
INTENT(inout)
:: heap ...
INTEGER(valt),
INTENT(in)
:: values(:) ...

SUBROUTINEcp_heap_get_first(heap, key, value, found)

Returns the first heap element without removing it.

Arguments:
INTENT(inout)
:: heap ...
INTEGER(keyt),
INTENT(out)
:: key ...
INTEGER(valt),
INTENT(out)
:: value ...
LOGICAL,
INTENT(out)
:: found ...

SUBROUTINEcp_heap_new(heap, n)

...

Arguments:
INTENT(out)
:: heap ...
INTEGER,
INTENT(in)
:: n ...

SUBROUTINEcp_heap_pop(heap, key, value, found)

Returns and removes the first heap element and rebalances the heap.

Arguments:
INTENT(inout)
:: heap ...
INTEGER(keyt),
INTENT(out)
:: key ...
INTEGER(valt),
INTENT(out)
:: value ...
LOGICAL,
INTENT(out)
:: found ...

SUBROUTINEcp_heap_release(heap)

...

Arguments:
INTENT(inout)
:: heap ...

SUBROUTINEcp_heap_reset_first(heap, value)

Changes the value of the minimum heap element and rebalances the heap.

Arguments:
INTENT(inout)
:: heap ...
INTEGER(valt),
INTENT(in)
:: value ...

SUBROUTINEcp_heap_reset_node(heap, key, value)

Changes the value of the heap element with given key and rebalances the heap.

Arguments:
INTENT(inout)
:: heap ...
INTEGER(keyt),
INTENT(in)
:: key ...
INTEGER(valt),
INTENT(in)
:: value ...

private Parameters/Types:

private Types:

TYPE :: cp_heap_node

...


INTEGER(keyt)
:: key ...
INTEGER(valt)
:: value ...

TYPE :: cp_heap_node_e

...


:: node ...