index_in_queue Function

function index_in_queue(state) result(idx)

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(in), dimension(NSTATE) :: state

Return Value integer(kind=ip)

index in the queue. -1 if not present


Called by

proc~~index_in_queue~~CalledByGraph proc~index_in_queue problem_17::index_in_queue proc~check problem_17::check proc~check->proc~index_in_queue program~problem_17 problem_17 program~problem_17->proc~check

Source Code

    function index_in_queue(state) result(idx)
        integer(ip),dimension(NSTATE),intent(in) :: state
        integer(ip) :: idx !! index in the queue. -1 if not present
        integer :: i
        idx = -1
        if (.not. allocated(queue)) error stop 'error: queue not allocated'
        do i = 1, size(queue)
            if (all(state == queue(i)%state)) then
                idx = i
                return
            end if
        end do
    end function index_in_queue