I removed the useless module Item.
This commit is contained in:
parent
9acfbfc781
commit
24f4693595
6
Item.mli
6
Item.mli
|
@ -1,6 +0,0 @@
|
||||||
module type S =
|
|
||||||
sig
|
|
||||||
type t
|
|
||||||
val compare : t -> t -> int
|
|
||||||
val to_string : t -> string
|
|
||||||
end
|
|
|
@ -1,11 +1,11 @@
|
||||||
(** This module offers the abstract data type of a partition of
|
(** This module offers the abstract data type of a partition of
|
||||||
classes of equivalent items (Union & Find). *)
|
classes of equivalent items (Union & Find). *)
|
||||||
|
|
||||||
(** The items are of type [PrintOrdType.t], that is, they have to obey
|
(** The items are of type [Item.t], that is, they have to obey
|
||||||
a total order, but also they must be printable to ease
|
a total order, but also they must be printable to ease
|
||||||
debugging. The signature [PrintOrdType] is the input signature of
|
debugging. The signature [Item] is the input signature of
|
||||||
the functor {!Partition.Make}. *)
|
the functor {!Partition.Make}. *)
|
||||||
module type PrintOrdType =
|
module type Item =
|
||||||
sig
|
sig
|
||||||
(** Type of items *)
|
(** Type of items *)
|
||||||
type t
|
type t
|
||||||
|
@ -61,4 +61,4 @@ module type S =
|
||||||
val is_equiv : item -> item -> partition -> bool
|
val is_equiv : item -> item -> partition -> bool
|
||||||
end
|
end
|
||||||
|
|
||||||
module Make (Ord : PrintOrdType) : S with type item = Ord.t
|
module Make (Ord : Item) : S with type item = Ord.t
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(* Naive persistent implementation of Union/Find: O(n^2) worst case *)
|
(* Naive persistent implementation of Union/Find: O(n^2) worst case *)
|
||||||
|
|
||||||
module Make (Item: Item.S) =
|
module Make (Item: Partition.Item) =
|
||||||
struct
|
struct
|
||||||
|
|
||||||
type item = Item.t
|
type item = Item.t
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
height of [i] (_not_ [j]).
|
height of [i] (_not_ [j]).
|
||||||
*)
|
*)
|
||||||
|
|
||||||
module Make (Item: Item.S) =
|
module Make (Item: Partition.Item) =
|
||||||
struct
|
struct
|
||||||
|
|
||||||
type item = Item.t
|
type item = Item.t
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(** Persistent implementation of the Union/Find algorithm with
|
(** Persistent implementation of the Union/Find algorithm with
|
||||||
height-balanced forests and without path compression. *)
|
height-balanced forests and without path compression. *)
|
||||||
|
|
||||||
module Make (Item: Item.S) =
|
module Make (Item: Partition.Item) =
|
||||||
struct
|
struct
|
||||||
|
|
||||||
type item = Item.t
|
type item = Item.t
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(* Destructive implementation of union/find with height-balanced
|
(* Destructive implementation of union/find with height-balanced
|
||||||
forests but without path compression: O(n*log(n)). *)
|
forests but without path compression: O(n*log(n)). *)
|
||||||
|
|
||||||
module Make (Item: Item.S) =
|
module Make (Item: Partition.Item) =
|
||||||
struct
|
struct
|
||||||
|
|
||||||
type item = Item.t
|
type item = Item.t
|
||||||
|
|
1
build.sh
1
build.sh
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -x
|
set -x
|
||||||
ocamlfind ocamlc -strict-sequence -w +A-48-4 -c Item.mli
|
|
||||||
ocamlfind ocamlc -strict-sequence -w +A-48-4 -c Partition.mli
|
ocamlfind ocamlc -strict-sequence -w +A-48-4 -c Partition.mli
|
||||||
ocamlfind ocamlopt -strict-sequence -w +A-48-4 -c Partition0.ml
|
ocamlfind ocamlopt -strict-sequence -w +A-48-4 -c Partition0.ml
|
||||||
ocamlfind ocamlopt -strict-sequence -w +A-48-4 -c Partition2.ml
|
ocamlfind ocamlopt -strict-sequence -w +A-48-4 -c Partition2.ml
|
||||||
|
|
Loading…
Reference in New Issue
Block a user