dbcsr_heap_swap Subroutine

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

Contents

Source Code


Source Code

   PURE SUBROUTINE dbcsr_heap_swap(heap, e1, e2)
      TYPE(dbcsr_heap_type), INTENT(INOUT)               :: heap
      INTEGER, INTENT(IN)                                :: e1, e2

      INTEGER(KIND=keyt)                                 :: key1, key2
      TYPE(dbcsr_heap_node)                              :: tmp_node

      key1 = heap%nodes(e1)%node%key
      key2 = heap%nodes(e2)%node%key

      tmp_node = heap%nodes(e1)%node
      heap%nodes(e1)%node = heap%nodes(e2)%node
      heap%nodes(e2)%node = tmp_node

      heap%index(key1) = e2
      heap%index(key2) = e1
   END SUBROUTINE dbcsr_heap_swap