add_edge Subroutine

private subroutine add_edge(me, edge)

add an edge index for this vertex

Type Bound

vertex

Arguments

Type IntentOptional Attributes Name
class(vertex), intent(inout) :: me
integer, intent(in) :: edge

Called by

proc~~add_edge~~CalledByGraph proc~add_edge dag_module::vertex%add_edge none~set_edges dag_module::vertex%set_edges none~set_edges->proc~add_edge proc~set_edge_vector dag_module::vertex%set_edge_vector none~set_edges->proc~set_edge_vector proc~set_edge_vector->proc~add_edge proc~dag_set_edges dag_module::dag%dag_set_edges proc~dag_set_edges->none~set_edges program~dag_example dag_example program~dag_example->proc~dag_set_edges program~problem_25 problem_25 program~problem_25->proc~dag_set_edges

Source Code

    subroutine add_edge(me,edge)

    class(vertex),intent(inout) :: me
    integer,intent(in) :: edge

    if (allocated(me%edges)) then
        if (.not. any (edge==me%edges)) then
            me%edges = [me%edges, edge]  ! auto lhs reallocation
        end if
    else
        allocate(me%edges(1))
        me%edges = [edge]
    end if

    end subroutine add_edge