dbcsr_min_heap Module



Contents


Variables

TypeVisibilityAttributesNameInitial
integer, public, parameter:: keyt =int_4
integer, public, parameter:: valt =int_4

Derived Types

type, private :: dbcsr_heap_node

Components

TypeVisibilityAttributesNameInitial
integer(kind=keyt), public :: key
integer(kind=valt), public :: value

type, private :: dbcsr_heap_node_e

Components

TypeVisibilityAttributesNameInitial
type(dbcsr_heap_node), public :: node

type, public :: dbcsr_heap_type

Components

TypeVisibilityAttributesNameInitial
integer, public :: n
integer, public, DIMENSION(:), POINTER:: index
type(dbcsr_heap_node_e), public, DIMENSION(:), POINTER:: nodes

Functions

private elemental function get_parent(n) result(parent)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: n

Return Value integer

private elemental function get_left_child(n) result(child)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: n

Return Value integer

private elemental function get_value(heap, n) result(value)

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(in) :: heap
integer, intent(in) :: n

Return Value integer(kind=valt)


Subroutines

public subroutine dbcsr_heap_new(heap, n)

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(out) :: heap
integer, intent(in) :: n

public subroutine dbcsr_heap_release(heap)

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap

public subroutine dbcsr_heap_fill(heap, values)

Fill heap with given values

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer(kind=valt), intent(in), DIMENSION(:):: values

public subroutine dbcsr_heap_get_first(heap, key, value, found)

Returns the first heap element without removing it.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer(kind=keyt), intent(out) :: key
integer(kind=valt), intent(out) :: value
logical, intent(out) :: found

public subroutine dbcsr_heap_pop(heap, key, value, found)

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

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer(kind=keyt), intent(out) :: key
integer(kind=valt), intent(out) :: value
logical, intent(out) :: found

public subroutine dbcsr_heap_reset_node(heap, key, value)

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

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer(kind=keyt), intent(in) :: key
integer(kind=valt), intent(in) :: value

public subroutine dbcsr_heap_reset_first(heap, value)

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

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer(kind=valt), intent(in) :: value

private pure subroutine dbcsr_heap_swap(heap, e1, e2)

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer, intent(in) :: e1
integer, intent(in) :: e2

private pure subroutine dbcsr_heap_copy_node(heap, e1, e2)

Sets node e1 to e2

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer, intent(in) :: e1
integer, intent(in) :: e2

private subroutine bubble_down(heap, first)

Balances a heap by bubbling down from the given element.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer, intent(in) :: first

private subroutine bubble_up(heap, first, new_pos)

Balances a heap by bubbling up from the given element.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_heap_type), intent(inout) :: heap
integer, intent(in) :: first
integer, intent(out) :: new_pos