Skip to content
Snippets Groups Projects
Commit a7b23332 authored by Gwennan Eliezer's avatar Gwennan Eliezer
Browse files

Corrected spelling and replaced "failwith" by "assert false".

parent 7bfd23d6
No related branches found
No related tags found
1 merge request!4WIP: Resolve "Compute the graph degree, diameter, etc."
Pipeline #26589 passed
......@@ -5,7 +5,7 @@ let (pos:string -> Topology.node list -> int) =
fst (List.fold_left (fun (found_i,i) lid -> if (nid=lid.Topology.id) then (i,i+1) else (found_i,i+1) ) (-1, 0) lid)
(* take a graph t and returns the Adjacency matrix of t *)
let (graph_to_ajency: Topology.t -> int array array) =
let (graph_to_adjency: Topology.t -> int array array) =
fun t->
let taille = List.length t.nodes in
let mat = Array.make_matrix (taille) (taille) 0 in
......@@ -58,5 +58,5 @@ let (max_mat: int array array -> int) =
(* takes a graph t in argument and returns the diameter *)
let (get: Topology.t -> int ) =
fun t ->
(max_mat(floydwarshall (graph_to_ajency t)))
(max_mat(floydwarshall (graph_to_adjency t)))
\ No newline at end of file
......@@ -33,7 +33,7 @@ type 's internal_tables = {
mutable diameter : int;
}
type properities_functions = {
type properties_functions = {
mutable card : unit -> int;
mutable min_max : unit -> int*int;
mutable mean_deg : unit -> float;
......@@ -65,7 +65,7 @@ let (tbls:'s internal_tables) = {
diameter = (-1)
}
let (prop_funs:properities_functions) = {
let (prop_funs:properties_functions) = {
card = (fun () -> -1);
min_max = (fun () -> (-1,-1));
mean_deg = (fun () -> -1.);
......@@ -202,7 +202,7 @@ let (is_cyclic : unit -> bool) =
| None -> (set_connec_cycl ();
match tbls.is_cyclic with
| Some b -> b
| _ -> failwith "unexpected error in Register.is_cyclic")
| _ -> assert false)
| Some b -> b
let (is_connected : unit -> bool) =
......@@ -210,7 +210,7 @@ let (is_connected : unit -> bool) =
| None -> (set_connec_cycl ();
match tbls.is_connected with
| Some b -> b
| _ -> failwith "unexpected error in Register.is_connected")
| _ -> assert false)
| Some b -> b
let (is_tree : unit -> bool) =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment