Permalink
Browse files

* h_program-lang/dependencies_matrix_code.ml:

  • Loading branch information...
1 parent 3a04f52 commit 4b945ab6fbd1f6790b1fb12f8d71980819dd1829 @aryx aryx committed May 18, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 h_program-lang/dependencies_matrix_code.ml
@@ -34,8 +34,8 @@ module G = Graph_code
(* dependency structure matrix *)
type dm = {
matrix: int array array;
- (* could be a tree *)
- names: Graph_code.node array;
+ name_to_i: (Graph_code.node, int) Hashtbl.t;
+ i_to_name: (int, Graph_code.node) Hashtbl.t;
}
(* list of nodes to expand *)
@@ -68,7 +68,10 @@ let build config g =
let dm = {
matrix = Common.make_matrix_init ~nrow:n ~ncolumn:n (fun i j -> 0);
- names = Array.of_list nodes;
+ name_to_i =
+ Common.index_list_0 nodes +> Common.hash_of_list;
+ i_to_name =
+ Common.index_list_0 nodes +> List.map Common.swap +> Common.hash_of_list;
}
in
dm

0 comments on commit 4b945ab

Please sign in to comment.