dbcsr_min_heap Module



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: keyt = int_4
integer, public, parameter :: valt = int_4

Derived Types

type, private ::  dbcsr_heap_node

Components

Type Visibility Attributes Name Initial
integer(kind=keyt), public :: key = -1_keyt
integer(kind=valt), public :: value = -1_valt

type, private ::  dbcsr_heap_node_e

Components

Type Visibility Attributes Name Initial
type(dbcsr_heap_node), public :: node = dbcsr_heap_node()

type, public ::  dbcsr_heap_type

Components

Type Visibility Attributes Name Initial
integer, public :: n = -1
integer, public, DIMENSION(:), POINTER :: index => NULL()
type(dbcsr_heap_node_e), public, DIMENSION(:), POINTER :: nodes => NULL()

Functions

private elemental function get_parent(n) result(parent)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Return Value integer

private elemental function get_left_child(n) result(child)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Return Value integer

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

Arguments

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
type(dbcsr_heap_type), intent(out) :: heap
integer, intent(in) :: n

public subroutine dbcsr_heap_release(heap)

Arguments

Type IntentOptional Attributes Name
type(dbcsr_heap_type), intent(inout) :: heap

public subroutine dbcsr_heap_fill(heap, values)

Fill heap with given values

Arguments

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
type(dbcsr_heap_type), intent(inout) :: heap
integer(kind=valt), intent(in) :: value

private pure subroutine dbcsr_heap_swap(heap, e1, e2)

Arguments

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
type(dbcsr_heap_type), intent(inout) :: heap
integer, intent(in) :: first
integer, intent(out) :: new_pos