fdoc

subroutineadd_edgeprivate

subroutine add_edge(s, relation, from, to, places, g)

Add an edge to a description.

Arguments

NameTypeIntentAttributesDescription
stype(settings_t)in

the settings

relationtype(adjacency_t)in

the relation

fromintegerin

where it starts

tointegerin

where it ends

placesintegerindimension(:)

the number in g of each entity

gtype(layout_t)inout

the description

Source

Show the code
subroutine add_edge(s, relation, from, to, places, g)
    type(settings_t), intent(in) :: s           !! the settings
    type(adjacency_t), intent(in) :: relation   !! the relation
    integer, intent(in) :: from                 !! where it starts
    integer, intent(in) :: to                   !! where it ends
    integer, intent(in) :: places(:)            !! the number in `g` of each entity
    type(layout_t), intent(inout) :: g          !! the description
    character(len=:), allocatable :: label
    integer :: k

    label = ''
    do k = 1, size(relation%out(from)%ids)
        if (relation%out(from)%ids(k) /= to) cycle
        label = relation%labels(from)%text(k)%s
        exit
    end do
    if (s%coloured_edges) then
        call g%add_edge(places(from), places(to), colour=EDGE_COLOURS(mod(from, size(EDGE_COLOURS)) + 1), label=label)
    else
        call g%add_edge(places(from), places(to), label=label)
    end if
end subroutine add_edge

Graphs

Called by