package ocaml-solo5

  1. Overview
  2. Docs
OCaml cross-compiler to the freestanding Solo5 backend

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.3.3.tar.gz
md5=47876167068345542f49279e8fd28896
sha512=272081ec51a6ed69c08e4e8fa64fee3df53fd84c66c0c07a653891c88b342cf74553e1c95711e4fbc18922c899a3448a649f3bd9858f8d89cae834ad2b67fffb

doc/compiler-libs.common/Stable_matching/index.html

Module Stable_matching

module Item : sig ... end
type left_index = int
type right_index = int
type rank = int
type ('a, 'v) matches = {
  1. left : 'a list;
  2. pairs : ('v * 'v) list;
  3. right : 'a list;
}
type ('v, 'k) item_matches = (('v, 'k) Item.t, 'v) matches
type unstable_matching = {
  1. first : left_index * right_index;
  2. second : left_index * right_index;
  3. current_rank : rank * rank;
  4. optimal : rank * rank;
}
val stable_matches : distance:(int -> int -> int) -> (_, int) matches -> (unit, unstable_matching) Result.t
val strong_stable_matches : distance:(int -> int -> int) -> (_, int) matches -> (unit, unstable_matching) Result.t
val matches : compatible:(left_index -> right_index -> bool) -> preferences:(right_index -> (left_index * rank) array) -> size:(int * int) -> (int, int) matches

matches ~compatible ~preferences ~size:(ls,rs) computes a matching between a set of ls left items and rs right items favoring the right side. The matches are compatible and weakly stable according to the preferences matrix. The size of the matching is at least 2/3 of the optimal matching size (computing optimal matching with partial preferences and ties is in NP).

val fuzzy_match_names : compatibility:('k -> 'k -> bool) -> max_right_items:int -> cutoff:(string -> int) -> ('v, 'k) Item.t list -> ('v, 'k) Item.t list -> ('v, 'k) item_matches

fuzzy_match_names ~compatibility ~max_right_item ~cutoff left right calls the matches function using the OSA edit distance to compute preferences with a cutoff function. To avoid quadratic complexity on large module size we limit the right side to the first max_right_item items