given as input the integer i and the vector h of logical, compute the the minimum integer ir such that ir>i and h(il) is true.
Type | Intent | Optional | 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) | :: | ir |
minimum integer such that ir>i, h(ir)=.true. |
subroutine right(n, h, i, ir) !! given as input the integer i and the vector h of logical, compute the !! the minimum integer ir such that ir>i and h(il) is true. implicit none 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) :: ir !! minimum integer such that ir>i, h(ir)=.true. do ir = i + 1, n if (h(ir)) return end do end subroutine right