dag_t Derived Type

type, public :: dag_t

Encapsulate a graph as an array of vertices, each storing dependency information


Inherits

type~~dag_t~~InheritsGraph type~dag_t dag_t type~vertex_t vertex_t type~dag_t->type~vertex_t vertices varying_string varying_string type~vertex_t->varying_string label_, attributes_

Contents


Components

Type Visibility Attributes Name Initial
integer, private, allocatable :: order(:)
type(vertex_t), private, allocatable :: vertices(:)

Constructor

public interface dag_t

  • private pure module function construct_from_components(vertices) result(dag)

    Construct a dag_t object from an array of (unsorted) vertex_t objects (result contains a topologically sorted index array)

    Arguments

    Type IntentOptional Attributes Name
    type(vertex_t), intent(in) :: vertices(:)

    Return Value type(dag_t)

  • private module function construct_from_json(json_object) result(dag)

    Construct a dag_t object from a JSON object (result contains a topologically sorted index array)

    Arguments

    Type IntentOptional Attributes Name
    type(json_object_t), intent(in) :: json_object

    Return Value type(dag_t)


Type-Bound Procedures

procedure, public, :: dependencies_for

  • interface

    private pure module function dependencies_for(self, vertex_id) result(dependency_ids)

    Result is an array of the ids on which vertex_id depends

    Arguments

    Type IntentOptional Attributes Name
    class(dag_t), intent(in) :: self
    integer, intent(in) :: vertex_id

    Return Value integer, allocatable, (:)

procedure, public, :: depends_on

  • interface

    private pure module function depends_on(self, vertex_num) result(dependencies)

    Result is an array of the vertex numbers that depend on on vertex vertex_num

    Arguments

    Type IntentOptional Attributes Name
    class(dag_t), intent(in) :: self
    integer, intent(in) :: vertex_num

    Return Value integer, allocatable, (:)

procedure, public, :: graphviz_digraph

  • interface

    private pure module function graphviz_digraph(self) result(digraph)

    Result contains a Graphviz .dot file descriptoin of the dag_t object

    Arguments

    Type IntentOptional Attributes Name
    class(dag_t), intent(in) :: self

    Return Value character(len=:), allocatable

procedure, public, :: is_sorted_and_acyclic

  • interface

    private elemental module function is_sorted_and_acyclic(self)

    Result is true if dag%order contains a topological sorting of vertex identifiers

    Arguments

    Type IntentOptional Attributes Name
    class(dag_t), intent(in) :: self

    Return Value logical

procedure, public, :: num_vertices

  • interface

    private elemental module function num_vertices(self)

    Result is the size of the vertex array

    Arguments

    Type IntentOptional Attributes Name
    class(dag_t), intent(in) :: self

    Return Value integer

procedure, public, :: to_json

  • interface

    private module function to_json(self) result(json_object)

    Result is a JSON representation of the dag_t object

    Arguments

    Type IntentOptional Attributes Name
    class(dag_t), intent(in) :: self

    Return Value type(json_object_t)