|
@@ -7,7 +7,7 @@
|
|
% Graph construction
|
|
% Graph construction
|
|
-export([singleton/1, from_list/3]).
|
|
-export([singleton/1, from_list/3]).
|
|
% Graph manipulation
|
|
% Graph manipulation
|
|
--export([append/2, out_edges/2]).
|
|
|
|
|
|
+-export([append/2, append/1, get_in/1, get_out/1, out_edges/2]).
|
|
% Checks for validity
|
|
% Checks for validity
|
|
-export([valid_edge/1, valid_edge_list/1, valid_graph/1]).
|
|
-export([valid_edge/1, valid_edge_list/1, valid_graph/1]).
|
|
|
|
|
|
@@ -119,6 +119,13 @@ append(FG1 = #flow_graph{in=In1, out=Out1},
|
|
add_edge(#flow_graph{in=In1, out=Out2, graph=G},
|
|
add_edge(#flow_graph{in=In1, out=Out2, graph=G},
|
|
flow(Out1, In2)).
|
|
flow(Out1, In2)).
|
|
|
|
|
|
|
|
+append([FG1|FGs]) ->
|
|
|
|
+ lists:foldl(fun(FG, All) -> append(All, FG) end, FG1, FGs).
|
|
|
|
+
|
|
|
|
+get_in(#flow_graph{in=In}) -> In.
|
|
|
|
+
|
|
|
|
+get_out(#flow_graph{out=Out}) -> Out.
|
|
|
|
+
|
|
out_edges(#flow_graph{graph=G}, #vertex{ref=R}) ->
|
|
out_edges(#flow_graph{graph=G}, #vertex{ref=R}) ->
|
|
?DICT:find(R, G).
|
|
?DICT:find(R, G).
|
|
|
|
|