PreviousUpNext

15.4.803  src/lib/graph/update-graph-info.pkg

## Functional (no-side-effect -- copy-and-mutate) update of global info in an odg digraph.
#
#  Update graph info.
#
#  -- Allen Leung

# Compiled by:
#     src/lib/graph/graphs.lib



stipulate
    package odg =  oop_digraph;                                         # oop_digraph   is from   src/lib/graph/oop-digraph.pkg
herein

    api Update_Graph_Info {
        #
        update_graph_info
           :
           odg::Digraph(N,E,G)                                          # Here N,E,G stand stead for the types of client-package-supplied records associated with (respectively) nodes, edges and graphs.
           ->
           G
           ->
           odg::Digraph(N,E,G);

    };
end;



stipulate
    package odg =  oop_digraph;                                         # oop_digraph   is from   src/lib/graph/oop-digraph.pkg
herein

    package   update_graph_info
    : (weak)  Update_Graph_Info                                         # Update_Graph_Info     is from   src/lib/graph/update-graph-info.pkg
    {   
        fun update_graph_info (odg::DIGRAPH graph) info
            =
            odg::DIGRAPH
              {
                name            => graph.name,
                graph_info      => info,
                allot_node_id   => graph.allot_node_id,
                add_node        => graph.add_node,
                add_edge        => graph.add_edge,
                remove_node     => graph.remove_node,
                set_in_edges    => graph.set_in_edges,
                set_out_edges   => graph.set_out_edges,
                set_entries     => graph.set_exits,
                set_exits       => graph.set_entries,
                garbage_collect => graph.garbage_collect,
                nodes           => graph.nodes,
                edges           => graph.edges,
                order           => graph.order,
                size            => graph.size,
                capacity        => graph.capacity,
                out_edges       => graph.out_edges,
                in_edges        => graph.in_edges,
                next            => graph.next,
                prior           => graph.prior,
                has_edge        => graph.has_edge,
                has_node        => graph.has_node,
                node_info       => graph.node_info,
                entries         => graph.entries,
                exits           => graph.exits,
                entry_edges     => graph.entry_edges,
                exit_edges      => graph.exit_edges,
                forall_nodes    => graph.forall_nodes,
                forall_edges    => graph.forall_edges
              };
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext