diff --git a/bin/bench/dune b/bin/bench/dune index 17b555687988dcb56e3c5c90bff42336ec39f5ba..b14186b46642603b5cccc86bb9a50fa4f2085d77 100644 --- a/bin/bench/dune +++ b/bin/bench/dune @@ -7,6 +7,7 @@ DissimilarityLib RandomDissimilarity Recognition + ChainLib core core_unix.command_unix core_bench ) ) diff --git a/bin/bench/robench.ml b/bin/bench/robench.ml index c1c3c67f06f1470099685fa852fa3835fd3969c6..78f032eeef23af922c66e320e05e15001c348b82 100644 --- a/bin/bench/robench.ml +++ b/bin/bench/robench.ml @@ -2,7 +2,7 @@ open! Core_bench open! CopointLib open! RandomDissimilarity open! DissimilarityLib - +open! ChainLib let imperative_copoint_algorithm diss = diss @@ -19,6 +19,12 @@ let pivotpair_algorithm diss = Recognition.Pivotpair.algo diss (fun i -> i) |> ignore +let chain_insertion_algorithm diss = + diss + |> RobinsonByChain.find_compatible_order + |> ignore + + let toeplitz ~k dim = Toeplitz.toeplitz012 ~n:dim ~k:(min k (dim-2)) @@ -45,7 +51,8 @@ let algorithms = [ Y ("copoint-imp", imperative_copoint_algorithm); Y ("copoint-fun", functional_copoint_algorithm); - Y ("pivotpair", pivotpair_algorithm) + Y ("pivotpair", pivotpair_algorithm); + Y ("chain-insertion", chain_insertion_algorithm) ] diff --git a/bin/dune b/bin/dune index 4e1f2a225506615951b85d4fcfcdf590297fbcc2..7a63a050680ebf4dcbc538fef7fdce8df538ed1e 100644 --- a/bin/dune +++ b/bin/dune @@ -1,4 +1,4 @@ (executable (public_name copoint) (name main) - (libraries RobinsonLib CopointLib DissimilarityLib Recognition)) + (libraries RobinsonLib CopointLib DissimilarityLib Recognition ChainLib)) diff --git a/bin/main.ml b/bin/main.ml index 4a7664f0de4c4487293082a616841aba097d9b76..4d1b7376e033c3f3453e5d91acbd8bc348d0c19a 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -16,7 +16,7 @@ open CopointLib * ) * order; * Printf.printf "\n" - * ) + * ) * order *) @@ -46,4 +46,5 @@ let _main = let _algo1 diss = RobinsonCCNP.find_compatible_order diss in let _algo2 diss = ImperativeCCNP.find_compatible_order diss |> Option.map Array.to_list in let _algo3 diss = Recognition.Pivotpair.algo diss (fun i -> i) in - _from_stdin _algo1 + let _algo4 diss = ChainLib.RobinsonByChain.find_compatible_order diss in + _from_stdin _algo3 diff --git a/test/propertytest/pqtree.ml b/test/propertytest/pqtree.ml index 95c47b50b7dbba7080d699c6995348df66c1cf37..7f9c0a2b1d71ac68f1152a5a4270d080c78c73e1 100644 --- a/test/propertytest/pqtree.ml +++ b/test/propertytest/pqtree.ml @@ -12,7 +12,7 @@ let frontier_is_a_contained_permutation pqtree = let test_frontier_is_a_contained_permutation = QCheck2.Test.make - ~name:"The frontier of a PQ-tree is a contained in that PQ-tree" + ~name:"The frontier of a PQ-tree is contained in that PQ-tree" ~print pqtree_gen frontier_is_a_contained_permutation