Hinsert Subroutine

private subroutine Hinsert(Ha, Hj, Hk, N, Nk, v, jv, hops)

Arguments

Type IntentOptional Attributes Name
real(kind=rp), intent(inout) :: Ha(N)
integer(kind=ip), intent(inout) :: Hj(N)
integer(kind=ip), intent(inout) :: Hk(Nk)
integer(kind=ip), intent(inout) :: N
integer(kind=ip), intent(in) :: Nk
real(kind=rp), intent(in) :: v
integer(kind=ip), intent(in) :: jv
integer(kind=ip), intent(out) :: hops

Calls

proc~~hinsert~~CallsGraph proc~hinsert lusol::Hinsert proc~hup lusol::Hup proc~hinsert->proc~hup

Called by

proc~~hinsert~~CalledByGraph proc~hinsert lusol::Hinsert proc~hbuild lusol::Hbuild proc~hbuild->proc~hinsert proc~lu1fad lusol::lu1fad proc~lu1fad->proc~hbuild proc~lu1fac lusol::lu1fac proc~lu1fac->proc~lu1fad proc~solve lusol_ez_module::solve proc~solve->proc~lu1fac proc~test_1 main::test_1 proc~test_1->proc~solve proc~test_2 main::test_2 proc~test_2->proc~solve program~main~2 main program~main~2->proc~test_1 program~main~2->proc~test_2

Source Code

  subroutine Hinsert( Ha, Hj, Hk, N, Nk, v, jv, hops )

    integer(ip),   intent(in)    :: Nk, jv
    real(rp),      intent(in)    :: v
    integer(ip),   intent(inout) :: N
    integer(ip),   intent(inout) :: Hj(N), Hk(Nk)
    real(rp),      intent(inout) :: Ha(N)
    integer(ip),   intent(out)   :: hops

    !==================================================================
    ! Hinsert inserts (v,jv) into heap of length N-1
    ! to make heap of length N.
    !
    ! 03 Apr 2002: First version of Hinsert.
    ! 01 May 2002: Require N to be final length, not old length.
    !              Need Nk for length of Hk.
    ! 07 May 2002: Protect input parameters N, Nk.
    ! 07 May 2002: Current version of Hinsert.
    ! 12 Dec 2011: First f90 version.
    !==================================================================

    integer(ip) :: kk, Nkk, Nnew

    Nnew     = N
    Nkk      = Nk
    kk       = Nnew
    Ha(Nnew) =  v
    Hj(Nnew) = jv
    Hk(jv)   = Nnew
    call Hup   ( Ha, Hj, Hk, Nnew, Nkk, kk, hops )

  end subroutine Hinsert