Lines Matching refs:heap
467 subroutine ramg_initheap(heap,invMap,wght,nheaps,ilen) argument
470 integer,dimension(0:ilen-1),intent(inout) :: heap,invMap local
476 heap(i) = i
482 do while ( ( k.gt.0 ).and.(wght(heap(k)).gt.wght(heap(j))) )
483 t = heap(j)
484 heap(j) = heap(k)
485 heap(k) = t
492 invmap(heap(i)) = i
497 subroutine ramg_popheap(heap,invmap,wght,nheaps,popid,ilen) argument
502 integer,dimension(0:ilen-1),intent(inout) :: heap,invmap local
506 heap(popid) = heap(nheaps)
507 invmap(heap(popid)) = popid
508 call ramg_adjheap(heap,invmap,wght,nheaps,popid,ilen)
512 subroutine ramg_adjheap(heap,invmap,wght,nheaps,popid,ilen) argument
515 integer,dimension(0:ilen-1),intent(inout) :: heap,invmap local
523 do while ( (i.gt.0).and.(wght(heap(j)).lt.wght(heap(i))))
524 t = heap(i)
525 heap(i) = heap(j)
526 heap(j) = t
527 invmap(heap(i)) = i
528 invmap(heap(j)) = j
536 if ((j.lt.(nheaps-1)).and.(wght(heap(j)).lt.wght(heap(j+1))))
540 if (wght(heap(i)).gt.wght(heap(j))) then
543 t = heap(i)
544 heap(i) = heap(j)
545 heap(j) = t
546 invmap(heap(i)) = i
547 invmap(heap(j)) = j