dbcsr_heap_get_first Subroutine

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

Source Code

   SUBROUTINE dbcsr_heap_get_first(heap, key, value, found)
      !! Returns the first heap element without removing it.
      TYPE(dbcsr_heap_type), INTENT(INOUT)               :: heap
      INTEGER(KIND=keyt), INTENT(OUT)                    :: key
      INTEGER(KIND=valt), INTENT(OUT)                    :: value
      LOGICAL, INTENT(OUT)                               :: found

      IF (heap%n .LT. 1) THEN
         found = .FALSE.
      ELSE
         found = .TRUE.
         key = heap%nodes(1)%node%key
         value = heap%nodes(1)%node%value
      END IF
   END SUBROUTINE dbcsr_heap_get_first