clear Subroutine

private pure subroutine clear(pq)

The clear subroutine deallocates the queue.

Type Bound

priority_queue_t

Arguments

Type IntentOptional Attributes Name
class(priority_queue_t), intent(inout) :: pq

Source Code

   pure subroutine clear(pq)
      implicit none
      class(priority_queue_t), intent(inout) :: pq

      if (allocated(pq%heap)) deallocate(pq%heap)
      pq%number = 0
   end subroutine clear