add_edge Subroutine

private subroutine add_edge(me, e, label, attributes, metadata)

add an edge index for this vertex

Type Bound

vertex

Arguments

Type IntentOptional Attributes Name
class(vertex), intent(inout) :: me
integer(kind=ip), intent(in) :: e
character(len=*), intent(in), optional :: label
character(len=*), intent(in), optional :: attributes

other attributes when saving as a diagraph.

class(*), intent(in), optional :: metadata

optional user-defined metadata


Calls

proc~~add_edge~~CallsGraph proc~add_edge dag_module::vertex%add_edge proc~sort_ascending dag_module::sort_ascending proc~add_edge->proc~sort_ascending proc~swap dag_module::swap proc~sort_ascending->proc~swap

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~dag_add_edge dag_module::dag%dag_add_edge proc~dag_add_edge->none~set_edges proc~dag_set_edges_no_atts dag_module::dag%dag_set_edges_no_atts proc~dag_set_edges_no_atts->none~set_edges proc~dag_set_edges_vector_atts dag_module::dag%dag_set_edges_vector_atts proc~dag_set_edges_vector_atts->none~set_edges

Source Code

    subroutine add_edge(me,e,label,attributes,metadata)

    class(vertex),intent(inout) :: me
    integer(ip),intent(in) :: e
    character(len=*),intent(in),optional :: label
    character(len=*),intent(in),optional :: attributes !! other attributes when
                                                       !! saving as a diagraph.
    class(*),intent(in),optional :: metadata !! optional user-defined metadata

    type(edge) :: edge_

    edge_ = edge(ivertex=e,label=label,&
                 attributes=attributes,metadata=metadata)

    if (allocated(me%edges)) then
        if (.not. any(e==me%edges%ivertex)) then ! don't add if already there
            me%edges = [me%edges, edge_]
            call sort_ascending(me%edges)
        end if
    else
        me%edges = [edge_]
    end if

    end subroutine add_edge