Returns the index in the edge array of the vertex.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dag), | intent(in) | :: | me | |||
integer(kind=ip), | intent(in) | :: | ivertex |
vertex number |
||
integer(kind=ip), | intent(in) | :: | iedge |
edge vertex number |
the index of the iedge
vertex in
the edge array (0 if not found)
pure function get_edge_index(me,ivertex,iedge) result(edge_index) class(dag),intent(in) :: me integer(ip),intent(in) :: ivertex !! vertex number integer(ip),intent(in) :: iedge !! edge vertex number integer(ip) :: edge_index !! the index of the `iedge` vertex in !! the edge array (0 if not found) integer(ip),dimension(1) :: idx if (allocated(me%vertices(ivertex)%edges)) then idx = findloc(me%vertices(ivertex)%edges%ivertex, iedge) edge_index = idx(1) else edge_index = 0_ip end if end function get_edge_index