subroutineadd_edgeprivate
subroutine add_edge(s, relation, from, to, places, g)
Add an edge to a description.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| s | type(settings_t) | in | the settings | |
| relation | type(adjacency_t) | in | the relation | |
| from | integer | in | where it starts | |
| to | integer | in | where it ends | |
| places | integer | in | dimension(:) | the number in |
| g | type(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