a vertex (or node) of a directed acyclic graph (DAG)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(edge), | private, | dimension(:), allocatable | :: | edges |
these are the vertices that this vertex depends on. (edges of the graph). |
||
integer(kind=ip), | private | :: | ivertex | = | 0 |
vertex number (the index in the dag |
|
logical, | private | :: | checking | = | .false. |
used for toposort |
|
logical, | private | :: | marked | = | .false. |
used for toposort |
|
character(len=:), | private, | allocatable | :: | label |
used for diagraph |
||
character(len=:), | private, | allocatable | :: | attributes |
used for diagraph |
||
class(*), | private, | allocatable | :: | metadata |
user-defined metadata |
specify the edge indices for this vertex
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vertex), | intent(inout) | :: | me | |||
integer(kind=ip), | intent(in), | dimension(:) | :: | edges | ||
character(len=*), | intent(in), | optional, | dimension(:) | :: | label | |
character(len=*), | intent(in), | optional, | dimension(:) | :: | attributes |
other attributes when saving as a diagraph. |
class(*), | intent(in), | optional | :: | metadata |
optional user-defined metadata |
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 |
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 |
specify the edge indices for this vertex
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vertex), | intent(inout) | :: | me | |||
integer(kind=ip), | intent(in), | dimension(:) | :: | edges | ||
character(len=*), | intent(in), | optional, | dimension(:) | :: | label | |
character(len=*), | intent(in), | optional, | dimension(:) | :: | attributes |
other attributes when saving as a diagraph. |
class(*), | intent(in), | optional | :: | metadata |
optional user-defined metadata |
remove an edge index from this vertex
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vertex), | intent(inout) | :: | me | |||
integer(kind=ip), | intent(in) | :: | e |
type :: vertex !! a vertex (or node) of a directed acyclic graph (DAG) private type(edge),dimension(:),allocatable :: edges !! these are the vertices that this vertex !! depends on. (edges of the graph). integer(ip) :: ivertex = 0 !! vertex number (the index in the [[dag]] `vertices` array) logical :: checking = .false. !! used for toposort logical :: marked = .false. !! used for toposort character(len=:),allocatable :: label !! used for diagraph character(len=:),allocatable :: attributes !! used for diagraph class(*),allocatable :: metadata !! user-defined metadata contains private generic :: set_edges => set_edge_vector_vector, add_edge procedure :: set_edge_vector_vector, add_edge procedure :: remove_edge end type vertex