left Subroutine

private subroutine left(n, h, i, il)

given as input the integer i and the vector h of logical, compute the the maximum integer il such that il<i and h(il) is true.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

length of the vector h

logical, intent(in) :: h(n)

vector of logical

integer, intent(in) :: i

integer

integer, intent(out) :: il

maximum integer such that il<i, h(il)=.true.


Called by

proc~~left~~CalledByGraph proc~left polyroots_module::left proc~cmerge polyroots_module::cmerge proc~cmerge->proc~left proc~cnvex polyroots_module::cnvex proc~cnvex->proc~cmerge proc~start polyroots_module::start proc~start->proc~cnvex proc~polzeros polyroots_module::polzeros proc~polzeros->proc~start

Source Code

    subroutine left(n, h, i, il)

        !! given as input the integer i and the vector h of logical, compute the
        !! the maximum integer il such that il<i and h(il) is true.

        implicit none

        integer,intent(in) :: n !! length of the vector h
        integer,intent(in) :: i !! integer
        logical,intent(in) :: h(n) !! vector of logical
        integer,intent(out) :: il !! maximum integer such that il<i, h(il)=.true.

        do il = i - 1, 0, -1
            if (h(il)) return
        end do

    end subroutine left