dag_m Module

  • Jacob Williams, Damian Rouson, Robert Singleterry, Brad Richardson
  • 2020-Nov-30
  • Copyright (c) 2020, Sourcery Institute, BSD 3-clause license Copyright (c) 2018 Jacob Williams
  • v1.0
  • 64 statements
  • Source File

Uses

  • module~~dag_m~~UsesGraph module~dag_m dag_m module~vertex_m vertex_m module~dag_m->module~vertex_m rojff rojff module~dag_m->rojff module~vertex_m->rojff iso_varying_string iso_varying_string module~vertex_m->iso_varying_string

Used by

  • module~~dag_m~~UsedByGraph module~dag_m dag_m module~dag_s dag_s module~dag_s->module~dag_m

Contents


Interfaces

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)

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, (:)

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, (:)

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

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

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

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)


Derived Types

type, public ::  dag_t

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

Components

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

Constructor

private pure, module function construct_from_components (vertices)

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

private module function construct_from_json (json_object)

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

Type-Bound Procedures

procedure , public , :: dependencies_for Interface
procedure , public , :: depends_on Interface
procedure , public , :: graphviz_digraph Interface
procedure , public , :: is_sorted_and_acyclic Interface
procedure , public , :: num_vertices Interface
procedure , public , :: to_json Interface