add an edge index for this vertex
Type | Intent | Optional | 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 |
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