Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /MLRISC/trunk/graphs/graph-contraction.sml
ViewVC logotype

Annotation of /MLRISC/trunk/graphs/graph-contraction.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 409 - (view) (download)
Original Path: sml/trunk/src/MLRISC/graphs/graph-contraction.sml

1 : monnier 409 (*
2 :     * Allows contraction of a set of nodes and replace it by a new node
3 :     *
4 :     * -- Allen
5 :     *)
6 :    
7 :     signature GRAPH_MINOR =
8 :     sig
9 :    
10 :     val minor_view :
11 :     ('n,'e,'g) Graph.graph ->
12 :     { minor : ('n,'e,'g) Graph.graph,
13 :     contract : Graph.node_id list * 'n Graph.node -> unit
14 :     }
15 :     end
16 :    
17 :     structure GraphMinor : GRAPH_MINOR =
18 :     struct
19 :    
20 :     structure G = Graph
21 :    
22 :     datatype node =
23 :    
24 :     fun minor_view(G.GRAPH G) =
25 :     let fun get n =
26 :     val minor =
27 :     G.GRAPH
28 :     { name = #name G,
29 :     graph_info = #graph_info G,
30 :     new_id = #new_id G,
31 :     add_node = #add_node G,
32 :     add_edge = #add_edge G,
33 :     remove_node = #remove_node G,
34 :     set_in_edges = #set_in_edges G,
35 :     set_out_edges = #set_out_edges G,
36 :     set_entries = #set_exits G,
37 :     set_exits = #set_entries G,
38 :     garbage_collect = #garbage_collect G,
39 :     nodes = #nodes G,
40 :     edges = #edges G,
41 :     order = #order G,
42 :     size = #size G,
43 :     capacity = #capacity G,
44 :     out_edges = #out_edges G,
45 :     in_edges = #in_edges G,
46 :     succ = #succ G,
47 :     pred = #pred G,
48 :     has_edge = #has_edge G,
49 :     has_node = #has_node G,
50 :     node_info = #node_info G,
51 :     entries = #entries G,
52 :     exits = #exits G,
53 :     entry_edges = #entry_edges G,
54 :     exit_edges = #exit_edges G,
55 :     forall_nodes = #forall_nodes G,
56 :     forall_edges = #forall_edges G
57 :     }
58 :     in { minor = minor,
59 :     contract = contract
60 :     }
61 :     end
62 :     end
63 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0