Added support for building the library with dune.
This commit is contained in:
parent
0f28b98f18
commit
3296b0eb48
|
@ -41,8 +41,8 @@ module Make (Item: Partition.Item) =
|
||||||
|
|
||||||
let repr item partition = (seek item partition).item
|
let repr item partition = (seek item partition).item
|
||||||
|
|
||||||
let is_equiv (i: item) (j: item) (p: partition) =
|
let is_equiv (i: item) (j: item) (p: partition) =
|
||||||
equal (repr i p) (repr j p)
|
equal (repr i p) (repr j p)
|
||||||
|
|
||||||
let get_or_set item (p: partition) =
|
let get_or_set item (p: partition) =
|
||||||
try seek item p, p with
|
try seek item p, p with
|
||||||
|
|
|
@ -8,7 +8,7 @@ symmetric: `alias x y` means that `x` is an alias of `y`, which
|
||||||
translates in the present context as `x` not being the representative
|
translates in the present context as `x` not being the representative
|
||||||
of the equivalence class containing the equivalence between `x` and
|
of the equivalence class containing the equivalence between `x` and
|
||||||
`y`. The function `alias` is useful when managing aliases during the
|
`y`. The function `alias` is useful when managing aliases during the
|
||||||
static analyses of programmning languages, so the representatives of
|
static analyses of programming languages, so the representatives of
|
||||||
the classes are always the original object.
|
the classes are always the original object.
|
||||||
|
|
||||||
The module `PartitionMain` tests each with the same equivalence
|
The module `PartitionMain` tests each with the same equivalence
|
||||||
|
@ -37,4 +37,3 @@ height-balanced forests but without path compression, featuring an
|
||||||
asymptotic worst case of O(n*log(n)). In practice, though, this
|
asymptotic worst case of O(n*log(n)). In practice, though, this
|
||||||
implementation should be faster than the previous ones, due to a
|
implementation should be faster than the previous ones, due to a
|
||||||
smaller multiplicative constant term.
|
smaller multiplicative constant term.
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
let version = "24f4693"
|
|
11
dune
Normal file
11
dune
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
(library
|
||||||
|
(name UnionFind)
|
||||||
|
(public_name partition)
|
||||||
|
(wrapped false)
|
||||||
|
(modules Partition0 Partition1 Partition2 Partition3 Partition)
|
||||||
|
(modules_without_implementation Partition))
|
||||||
|
|
||||||
|
(test
|
||||||
|
(modules PartitionMain)
|
||||||
|
(libraries UnionFind)
|
||||||
|
(name PartitionMain))
|
1
dune-project
Normal file
1
dune-project
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(lang dune 1.7)
|
19
partition.opam
Normal file
19
partition.opam
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
opam-version : "2.0"
|
||||||
|
version : "1.0"
|
||||||
|
maintainer : "rinderknecht@free.fr"
|
||||||
|
authors : [ "Christian Rinderknecht" ]
|
||||||
|
homepage : "https://gitlab.com/rinderknecht/UnionFind"
|
||||||
|
bug-reports : "https://gitlab.com/rinderknecht/UnionFind/issues"
|
||||||
|
dev-repo : "git+https://gitlab.com/rinderknecht/UnionFind.git"
|
||||||
|
license : "MIT"
|
||||||
|
|
||||||
|
depends : [ "dune" ]
|
||||||
|
|
||||||
|
build : [
|
||||||
|
[ "sh" "-c" "printf 'let version = \"%s\"' \"$(git describe --always --dirty --abbrev=0)\" > Version.ml" ]
|
||||||
|
[ "dune" "build" "-p" name "-j" jobs ]
|
||||||
|
]
|
||||||
|
|
||||||
|
url {
|
||||||
|
src: "https://gitlab.com/rinderknecht/UnionFind/-/archive/master/UnionFind.tar.gz"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user