From c6013cd62e1ca9aa1b4c1b9e6955d84e35a43c9e Mon Sep 17 00:00:00 2001 From: Kosuke Tahara Date: Sat, 6 Nov 2021 16:57:17 +0900 Subject: [PATCH 1/7] lp-glpk: use stubgen instead of dynamic foreign --- src/lp-glpk/ffi/bindings/dune | 5 + src/lp-glpk/ffi/bindings/lp_glpk_bindings.ml | 129 +++++ src/lp-glpk/ffi/lib/dune | 30 ++ src/lp-glpk/ffi/lib/m.ml | 1 + src/lp-glpk/ffi/stubgen/dune | 4 + src/lp-glpk/ffi/stubgen/ffi_stubgen.ml | 22 + src/lp-glpk/{ => lib}/dune | 2 +- src/lp-glpk/{ => lib}/lp_glpk.ml | 114 +++-- src/lp-glpk/{ => lib}/lp_glpk.mli | 0 src/lp-glpk/lp_glp.ml | 472 ------------------ src/lp-glpk/lp_glp.mli | 342 ------------- src/lp-glpk/types/bindings/dune | 4 + .../types/bindings/lp_glpk_bindings_types.ml | 385 ++++++++++++++ src/lp-glpk/types/lib/dune | 11 + src/lp-glpk/types/lib/m.ml | 1 + src/lp-glpk/types/stubgen/dune | 14 + .../types/stubgen/ffi_types_stubgen.ml | 7 + test/lp-glpk/dune | 1 - test/lp-glpk/test_glp.ml | 3 +- 19 files changed, 676 insertions(+), 871 deletions(-) create mode 100644 src/lp-glpk/ffi/bindings/dune create mode 100644 src/lp-glpk/ffi/bindings/lp_glpk_bindings.ml create mode 100644 src/lp-glpk/ffi/lib/dune create mode 100644 src/lp-glpk/ffi/lib/m.ml create mode 100644 src/lp-glpk/ffi/stubgen/dune create mode 100644 src/lp-glpk/ffi/stubgen/ffi_stubgen.ml rename src/lp-glpk/{ => lib}/dune (56%) rename src/lp-glpk/{ => lib}/lp_glpk.ml (58%) rename src/lp-glpk/{ => lib}/lp_glpk.mli (100%) delete mode 100644 src/lp-glpk/lp_glp.ml delete mode 100644 src/lp-glpk/lp_glp.mli create mode 100644 src/lp-glpk/types/bindings/dune create mode 100644 src/lp-glpk/types/bindings/lp_glpk_bindings_types.ml create mode 100644 src/lp-glpk/types/lib/dune create mode 100644 src/lp-glpk/types/lib/m.ml create mode 100644 src/lp-glpk/types/stubgen/dune create mode 100644 src/lp-glpk/types/stubgen/ffi_types_stubgen.ml diff --git a/src/lp-glpk/ffi/bindings/dune b/src/lp-glpk/ffi/bindings/dune new file mode 100644 index 0000000..161a651 --- /dev/null +++ b/src/lp-glpk/ffi/bindings/dune @@ -0,0 +1,5 @@ +(library + (name lp_glpk_bindings) + (synopsis "Ctypes bindings that describe the libglpk FFI") + (public_name lp-glpk.bindings) + (libraries lp-glpk.types ctypes.stubs ctypes)) diff --git a/src/lp-glpk/ffi/bindings/lp_glpk_bindings.ml b/src/lp-glpk/ffi/bindings/lp_glpk_bindings.ml new file mode 100644 index 0000000..717e268 --- /dev/null +++ b/src/lp-glpk/ffi/bindings/lp_glpk_bindings.ml @@ -0,0 +1,129 @@ +open Ctypes + +module T = Lp_glpk_types.M + +module M (F : Ctypes.FOREIGN) = struct + open F + + let set_term_out = foreign "glp_term_out" (T.BoolInt.t @-> returning void) + + type prob = unit ptr + + let prob : prob typ = ptr void + + let create_prob = foreign "glp_create_prob" (void @-> returning prob) + + let delete_prob = foreign "glp_delete_prob" (prob @-> returning void) + + let set_prob_name = + foreign "glp_set_prob_name" (prob @-> string @-> returning void) + + let get_prob_name = foreign "glp_get_prob_name" (prob @-> returning string) + + let set_obj_dir = foreign "glp_set_obj_dir" (prob @-> T.Dir.t @-> returning void) + + let get_obj_dir = foreign "glp_get_obj_dir" (prob @-> returning T.Dir.t) + + let add_rows = foreign "glp_add_rows" (prob @-> int @-> returning int) + + let add_cols = foreign "glp_add_cols" (prob @-> int @-> returning int) + + let set_row_name = + foreign "glp_set_row_name" (prob @-> int @-> string @-> returning void) + + let get_row_name = + foreign "glp_get_row_name" (prob @-> int @-> returning string) + + let set_col_name = + foreign "glp_set_col_name" (prob @-> int @-> string @-> returning void) + + let get_col_name = + foreign "glp_get_col_name" (prob @-> int @-> returning string) + + (** set_row_bnds [prob] [i] [bnd] [lb] [ub] sets bounds of i-th row (constraint). + If the row is not lower (upper) bounded, lb (ub) is just ignored. + If the row is equality constraint (Bnd.FX), + only [lb] is used and [ub] is ignored. +*) + let set_row_bnds = + foreign "glp_set_row_bnds" + (prob @-> int @-> T.Bnd.t @-> double @-> double @-> returning void) + + (** set_col_bnds [prob] [j] [bnd] [lb] [ub] sets bounds of j-th col (variable). + If the col is not lower (upper) bounded, lb (ub) is just ignored. + If the col is equality constraint (Bnd.FX), + only [lb] is used and [ub] is ignored. +*) + let set_col_bnds = + foreign "glp_set_col_bnds" + (prob @-> int @-> T.Bnd.t @-> double @-> double @-> returning void) + + (** set_obj_coef [prob] [j] sets the objective coefficient at j-th col (variable) *) + let set_obj_coef = + foreign "glp_set_obj_coef" (prob @-> int @-> double @-> returning void) + + (** set_mat_row [prob] [i] [len] [indices] [vals] sets the i-th row of constraint matrix. *) + let set_mat_row = + foreign "glp_set_mat_row" + (prob @-> int @-> int @-> ptr void @-> ptr void @-> returning void) + + (** set_mat_col [prob] [j] [len] [indices] [vals] sets the j-th column of constraint matrix. *) + let set_mat_col = + foreign "glp_set_mat_col" + (prob @-> int @-> int @-> ptr void @-> ptr void @-> returning void) + + (** load_matrix [prob] [ne] [ia] [ja] [ar] sets the constraint matrix. + The matrix is represented as an sparce matrix. + for k=1 .. [ne], value [ar][k] is set at ([ia][k], [ja][k]) element. +*) + let load_matrix = + foreign "glp_load_matrix" + (prob @-> int @-> ptr void @-> ptr void @-> ptr void @-> returning void) + + let set_col_kind = + foreign "glp_set_col_kind" (prob @-> int @-> T.Vt.t @-> returning void) + + let get_col_kind = foreign "glp_get_col_kind" (prob @-> int @-> returning T.Vt.t) + + let get_num_rows = foreign "glp_get_num_rows" (prob @-> returning int) + + let get_num_cols = foreign "glp_get_num_cols" (prob @-> returning int) + + let get_num_nz = foreign "glp_get_num_nz" (prob @-> returning int) + + let get_num_int = foreign "glp_get_num_int" (prob @-> returning int) + + let get_num_bin = foreign "glp_get_num_bin" (prob @-> returning int) + + let init_smcp = foreign "glp_init_smcp" (ptr T.Smcp.t @-> returning void) + + let init_iocp = foreign "glp_init_iocp" (ptr T.Iocp.t @-> returning void) + + let simplex = foreign "glp_simplex" (prob @-> ptr T.Smcp.t @-> returning int) + + let intopt = foreign "glp_intopt" (prob @-> ptr T.Iocp.t @-> returning int) + + let get_status = foreign "glp_get_status" (prob @-> returning T.Stat.t) + + let mip_status = foreign "glp_mip_status" (prob @-> returning T.Stat.t) + + let get_obj_val = foreign "glp_get_obj_val" (prob @-> returning double) + + let mip_obj_val = foreign "glp_mip_obj_val" (prob @-> returning double) + + let get_row_prim = + foreign "glp_get_row_prim" (prob @-> int @-> returning double) + + let get_row_dual = + foreign "glp_get_row_dual" (prob @-> int @-> returning double) + + let mip_row_val = foreign "glp_mip_row_val" (prob @-> int @-> returning double) + + let get_col_prim = + foreign "glp_get_col_prim" (prob @-> int @-> returning double) + + let get_col_dual = + foreign "glp_get_col_dual" (prob @-> int @-> returning double) + + let mip_col_val = foreign "glp_mip_col_val" (prob @-> int @-> returning double) +end diff --git a/src/lp-glpk/ffi/lib/dune b/src/lp-glpk/ffi/lib/dune new file mode 100644 index 0000000..806eb67 --- /dev/null +++ b/src/lp-glpk/ffi/lib/dune @@ -0,0 +1,30 @@ +(rule + (targets g.ml) + (deps ../stubgen/ffi_stubgen.exe) + (action + (with-stdout-to + %{targets} + (run %{deps} -ml)))) + +(rule + (targets lp_glpk_stubs.c) + (deps + (:stubgen ../stubgen/ffi_stubgen.exe)) + (action + (with-stdout-to + %{targets} + (run %{stubgen} -c)))) + +(library + (name lp_glpk_ffi) + (public_name lp-glpk.ffi) + (modules g m) + (foreign_stubs + (language c) + (names lp_glpk_stubs) + ; supress warnings due to following issue of ctypes: + ; https://github.com/ocamllabs/ocaml-ctypes/issues/134 + (flags -Wno-discarded-qualifiers)) + (c_library_flags + (:standard -lglpk)) + (libraries lp-glpk.bindings lp-glpk.types ctypes.stubs ctypes)) diff --git a/src/lp-glpk/ffi/lib/m.ml b/src/lp-glpk/ffi/lib/m.ml new file mode 100644 index 0000000..07229f7 --- /dev/null +++ b/src/lp-glpk/ffi/lib/m.ml @@ -0,0 +1 @@ +include Lp_glpk_bindings.M(G) diff --git a/src/lp-glpk/ffi/stubgen/dune b/src/lp-glpk/ffi/stubgen/dune new file mode 100644 index 0000000..4e5d0ba --- /dev/null +++ b/src/lp-glpk/ffi/stubgen/dune @@ -0,0 +1,4 @@ +(executable + (name ffi_stubgen) + (modules ffi_stubgen) + (libraries lp_glpk_bindings lp_glpk_types ctypes.stubs ctypes)) diff --git a/src/lp-glpk/ffi/stubgen/ffi_stubgen.ml b/src/lp-glpk/ffi/stubgen/ffi_stubgen.ml new file mode 100644 index 0000000..27f9981 --- /dev/null +++ b/src/lp-glpk/ffi/stubgen/ffi_stubgen.ml @@ -0,0 +1,22 @@ +let prefix = "lp_glpk_stub" + +let prologue = "#include " + +let () = + let generate_ml, generate_c = (ref false, ref false) in + let () = + Arg.( + parse + [ ("-ml", Set generate_ml, "Generate ML") + ; ("-c", Set generate_c, "Generate C") ]) + (fun _ -> failwith "unexpected anonymous argument") + "stubgen [-ml|-c]" + in + match (!generate_ml, !generate_c) with + | false, false | true, true -> + failwith "Exactly one of -ml and -c must be specified" + | true, false -> + Cstubs.write_ml Format.std_formatter ~prefix (module Lp_glpk_bindings.M) + | false, true -> + print_endline prologue ; + Cstubs.write_c Format.std_formatter ~prefix (module Lp_glpk_bindings.M) diff --git a/src/lp-glpk/dune b/src/lp-glpk/lib/dune similarity index 56% rename from src/lp-glpk/dune rename to src/lp-glpk/lib/dune index f2bd4e6..ad4f9c2 100644 --- a/src/lp-glpk/dune +++ b/src/lp-glpk/lib/dune @@ -2,4 +2,4 @@ (name lp_glpk) (public_name lp-glpk) (wrapped false) - (libraries lp ctypes ctypes.foreign)) + (libraries lp lp-glpk.ffi lp-glpk.types ctypes)) diff --git a/src/lp-glpk/lp_glpk.ml b/src/lp-glpk/lib/lp_glpk.ml similarity index 58% rename from src/lp-glpk/lp_glpk.ml rename to src/lp-glpk/lib/lp_glpk.ml index 95f7a45..2f25f0a 100644 --- a/src/lp-glpk/lp_glpk.ml +++ b/src/lp-glpk/lib/lp_glpk.ml @@ -1,7 +1,8 @@ (* solve LP and MILP using glpk *) module C = Ctypes -open Lp_glp +module T = Lp_glpk_types.M +module B = Lp_glpk_ffi.M open Lp let make_pmap vars f = @@ -23,10 +24,10 @@ let rec idx_var (v : Var.t) = function if hd = v then 1 else 1 + idx_var v rest let set_obj prob vars obj = - if Objective.is_max obj then set_obj_dir prob Dir.MAX - else set_obj_dir prob Dir.MIN ; + if Objective.is_max obj then B.set_obj_dir prob T.Dir.MAX + else B.set_obj_dir prob T.Dir.MIN ; Poly.iter_linear_exn - (fun c v -> set_obj_coef prob (idx_var v vars) c) + (fun c v -> B.set_obj_coef prob (idx_var v vars) c) (Objective.to_poly obj) let set_cnstr prob vars i cnstr = @@ -46,13 +47,13 @@ let set_cnstr prob vars i cnstr = (0.0 :: Poly.take_linear_coeffs poly) (* 0-th element is dummy *) in - set_mat_row prob ri (Poly.length poly) + B.set_mat_row prob ri (Poly.length poly) (C.to_voidp (C.CArray.start aindices)) (C.to_voidp (C.CArray.start acoeffs)) in let lhs, rhs = Cnstr.sides cnstr in - if Cnstr.is_eq cnstr then set_row_bnds prob ri Bnd.FX rhs 0.0 - else set_row_bnds prob ri Bnd.UP 0.0 rhs ; + if Cnstr.is_eq cnstr then B.set_row_bnds prob ri T.Bnd.FX rhs 0.0 + else B.set_row_bnds prob ri T.Bnd.UP 0.0 rhs ; coeff lhs let set_cnstrs prob vars = List.iteri (set_cnstr prob vars) @@ -64,48 +65,49 @@ module Simplex = struct match var with | {Var.attr= Var.Continuous (lb, ub); _} -> if lb = Float.neg_infinity && ub = Float.infinity then - set_col_bnds prob cj Bnd.FR 0.0 0.0 - else if ub = Float.infinity then set_col_bnds prob cj Bnd.LO lb 0.0 + B.set_col_bnds prob cj T.Bnd.FR 0.0 0.0 + else if ub = Float.infinity then + B.set_col_bnds prob cj T.Bnd.LO lb 0.0 else if lb = Float.neg_infinity then - set_col_bnds prob cj Bnd.UP 0.0 ub - else if lb <> ub then set_col_bnds prob cj Bnd.DB lb ub - else set_col_bnds prob cj Bnd.FX lb ub + B.set_col_bnds prob cj T.Bnd.UP 0.0 ub + else if lb <> ub then B.set_col_bnds prob cj T.Bnd.DB lb ub + else B.set_col_bnds prob cj T.Bnd.FX lb ub | _ -> - failwith "set_cols: integer variable found") + failwith "set_cols: integer variable found" ) let solve_main p = let obj, cnstrs = Problem.obj_cnstrs p in let vars = Problem.uniq_vars p in let nrows = List.length cnstrs in let ncols = List.length vars in - let prob = create_prob () in - ignore @@ add_rows prob nrows ; - ignore @@ add_cols prob ncols ; - let smcp = C.make Smcp.t in + let prob = B.create_prob () in + ignore @@ B.add_rows prob nrows ; + ignore @@ B.add_cols prob ncols ; + let smcp = C.make T.Smcp.t in try - init_smcp (C.addr smcp) ; + B.init_smcp (C.addr smcp) ; (* TODO set solver parameters *) set_obj prob vars obj ; set_cnstrs prob vars cnstrs ; set_cols prob vars ; - let ret = simplex prob (C.addr smcp) in + let ret = B.simplex prob (C.addr smcp) in (* TODO handle some of non-zero return values *) if ret <> 0 then failwith "non-zero return value from simplex" else - match get_status prob with - | Stat.OPT -> - let obj = get_obj_val prob in - let xs = make_pmap vars (fun i -> get_col_prim prob (i + 1)) in - delete_prob prob ; + match B.get_status prob with + | T.Stat.OPT -> + let obj = B.get_obj_val prob in + let xs = make_pmap vars (fun i -> B.get_col_prim prob (i + 1)) in + B.delete_prob prob ; Ok (obj, xs) | status -> - failwith ("Problem is " ^ Stat.to_string status) - with Failure msg -> delete_prob prob ; Error msg + failwith ("Problem is " ^ T.Stat.to_string status) + with Failure msg -> B.delete_prob prob ; Error msg let solve ?(term_output = true) p = match Problem.classify p with | Pclass.LP -> - set_term_out term_output ; solve_main p + B.set_term_out term_output ; solve_main p | _ -> Error "Lp_glpk.Simplex is only for LP" end @@ -114,11 +116,12 @@ module Milp = struct let set_cols prob = let set_bounds cj lb ub = if lb = Float.neg_infinity && ub = Float.infinity then - set_col_bnds prob cj Bnd.FR 0.0 0.0 - else if ub = Float.infinity then set_col_bnds prob cj Bnd.LO lb 0.0 - else if lb = Float.neg_infinity then set_col_bnds prob cj Bnd.UP 0.0 ub - else if lb <> ub then set_col_bnds prob cj Bnd.DB lb ub - else set_col_bnds prob cj Bnd.FX lb ub + B.set_col_bnds prob cj T.Bnd.FR 0.0 0.0 + else if ub = Float.infinity then B.set_col_bnds prob cj T.Bnd.LO lb 0.0 + else if lb = Float.neg_infinity then + B.set_col_bnds prob cj T.Bnd.UP 0.0 ub + else if lb <> ub then B.set_col_bnds prob cj T.Bnd.DB lb ub + else B.set_col_bnds prob cj T.Bnd.FX lb ub in List.iteri (fun j var -> let cj = 1 + j in @@ -126,54 +129,57 @@ module Milp = struct | {Var.attr= Var.Continuous (lb, ub); _} -> set_bounds cj lb ub | {Var.attr= Var.General (lb, ub); _} -> - set_bounds cj lb ub ; set_col_kind prob cj Vt.IV + set_bounds cj lb ub ; + B.set_col_kind prob cj T.Vt.IV | {Var.attr= Var.Binary; _} -> set_bounds cj Float.zero Float.one ; - set_col_kind prob cj Vt.BV) + B.set_col_kind prob cj T.Vt.BV ) let solve_main p = let obj, cnstrs = Problem.obj_cnstrs p in let vars = Problem.uniq_vars p in let nrows = List.length cnstrs in let ncols = List.length vars in - let prob = create_prob () in - ignore @@ add_rows prob nrows ; - ignore @@ add_cols prob ncols ; - let smcp = C.make Smcp.t in - let iocp = C.make Iocp.t in + let prob = B.create_prob () in + ignore @@ B.add_rows prob nrows ; + ignore @@ B.add_cols prob ncols ; + let smcp = C.make T.Smcp.t in + let iocp = C.make T.Iocp.t in try - init_smcp (C.addr smcp) ; - init_iocp (C.addr iocp) ; + B.init_smcp (C.addr smcp) ; + B.init_iocp (C.addr iocp) ; (* TODO set solver parameters *) set_obj prob vars obj ; set_cnstrs prob vars cnstrs ; set_cols prob vars ; - let ret = simplex prob (C.addr smcp) in + let ret = B.simplex prob (C.addr smcp) in (* TODO handle some of non-zero return values *) if ret <> 0 then failwith "non-zero return value from simplex" else - match get_status prob with - | Stat.OPT -> ( - let ret = intopt prob (C.addr iocp) in + match B.get_status prob with + | T.Stat.OPT -> ( + let ret = B.intopt prob (C.addr iocp) in (* TODO handle some of non-zero return values *) if ret <> 0 then failwith "non-zero return value from intopt" else - match mip_status prob with - | Stat.OPT -> - let obj = mip_obj_val prob in - let xs = make_pmap vars (fun i -> mip_col_val prob (i + 1)) in - delete_prob prob ; + match B.mip_status prob with + | T.Stat.OPT -> + let obj = B.mip_obj_val prob in + let xs = + make_pmap vars (fun i -> B.mip_col_val prob (i + 1)) + in + B.delete_prob prob ; Ok (obj, xs) | status -> - failwith ("MILP is " ^ Stat.to_string status) ) + failwith ("MILP is " ^ T.Stat.to_string status) ) | status -> - failwith ("LP relaxation is " ^ Stat.to_string status) - with Failure msg -> delete_prob prob ; Error msg + failwith ("LP relaxation is " ^ T.Stat.to_string status) + with Failure msg -> B.delete_prob prob ; Error msg let solve ?(term_output = true) p = match Problem.classify p with | Pclass.MILP -> - set_term_out term_output ; solve_main p + B.set_term_out term_output ; solve_main p | _ -> Error "Lp_glpk.Milp is only for MILP" end diff --git a/src/lp-glpk/lp_glpk.mli b/src/lp-glpk/lib/lp_glpk.mli similarity index 100% rename from src/lp-glpk/lp_glpk.mli rename to src/lp-glpk/lib/lp_glpk.mli diff --git a/src/lp-glpk/lp_glp.ml b/src/lp-glpk/lp_glp.ml deleted file mode 100644 index 63d639d..0000000 --- a/src/lp-glpk/lp_glp.ml +++ /dev/null @@ -1,472 +0,0 @@ -open Ctypes -open Foreign - -(* integer constants which are #defined in glpk.h version 4.65 and 5+ *) - -module Dir = struct - type t = MIN | MAX - - let of_int = function - | 1 -> - MIN - | 2 -> - MAX - | _ -> - failwith "Unexpected Direction flag" - - let to_int = function MIN -> 1 | MAX -> 2 - - let t = view ~read:of_int ~write:to_int int -end - -module Vt = struct - type t = CV | IV | BV - - let of_int = function - | 1 -> - CV - | 2 -> - IV - | 3 -> - BV - | _ -> - failwith "Unexpected Vtype flag" - - let to_int = function CV -> 1 | IV -> 2 | BV -> 3 - - let t = view ~read:of_int ~write:to_int int -end - -module Bnd = struct - type t = FR | LO | UP | DB | FX - - let of_int = function - | 1 -> - FR - | 2 -> - LO - | 3 -> - UP - | 4 -> - DB - | 5 -> - FX - | _ -> - failwith "Unexpected Bound flag" - - let to_int = function FR -> 1 | LO -> 2 | UP -> 3 | DB -> 4 | FX -> 5 - - let t = view ~read:of_int ~write:to_int int -end - -module Stat = struct - type t = UNDEF | FEAS | INFEAS | NOFEAS | OPT | UNBND - - let of_int = function - | 1 -> - UNDEF - | 2 -> - FEAS - | 3 -> - INFEAS - | 4 -> - NOFEAS - | 5 -> - OPT - | 6 -> - UNBND - | _ -> - failwith "Unexpected Status flag" - - let to_int = function - | UNDEF -> - 1 - | FEAS -> - 2 - | INFEAS -> - 3 - | NOFEAS -> - 4 - | OPT -> - 5 - | UNBND -> - 6 - - let to_string = function - | UNDEF -> - "Undefined" - | FEAS -> - "Feasible" - | INFEAS -> - "Infeasible" - | NOFEAS -> - "NoFeasible" - | OPT -> - "Optimal" - | UNBND -> - "Unbounded" - - let t = view ~read:of_int ~write:to_int int -end - -(* GLP_ON = 1 and GLP_OFF = 0 *) -module BoolInt = struct - let of_int i = if i = 0 then false else true - - let to_int b = if b then 1 else 0 - - let t = view ~read:of_int ~write:to_int int -end - -module Msg = struct - type t = OFF | ERR | ON | ALL | DBG - - let of_int = function - | 0 -> - OFF - | 1 -> - ERR - | 2 -> - ON - | 3 -> - ALL - | 4 -> - DBG - | _ -> - failwith "Unexpected Msg flag" - - let to_int = function OFF -> 0 | ERR -> 1 | ON -> 2 | ALL -> 3 | DBG -> 4 - - let t = view ~read:of_int ~write:to_int int -end - -module Smcp = struct - module Meth = struct - type t = PRIMAL | DUALP | DUAL - - let of_int = function - | 1 -> - PRIMAL - | 2 -> - DUALP - | 3 -> - DUAL - | _ -> - failwith "Unexpected Method flag" - - let to_int = function PRIMAL -> 1 | DUALP -> 2 | DUAL -> 3 - - let t = view ~read:of_int ~write:to_int int - end - - module Pt = struct - type t = STD | PSE - - let of_int = function - | 0x11 -> - STD - | 0x22 -> - PSE - | _ -> - failwith "Unexpected Pricing flag" - - let to_int = function STD -> 0x11 | PSE -> 0x22 - - let t = view ~read:of_int ~write:to_int int - end - - module Rt = struct - type t = STD | HAR | FLIP - - let of_int = function - | 0x11 -> - STD - | 0x22 -> - HAR - | 0x33 -> - FLIP - | _ -> - failwith "Unexpected Ratio Test flag" - - let to_int = function STD -> 0x11 | HAR -> 0x22 | FLIP -> 0x33 - - let t = view ~read:of_int ~write:to_int int - end - - module An = struct - type t = AT | NT - - let of_int = function - | 1 -> - AT - | 2 -> - NT - | _ -> - failwith "Unexpected A or N flag" - - let to_int = function AT -> 1 | NT -> 2 - - let t = view ~read:of_int ~write:to_int int - end - - type t - - let t : t structure typ = structure "smcp" - - let msg_lev = field t "msg_lev" Msg.t - - let meth = field t "meth" Meth.t - - let pricing = field t "pricing" Pt.t - - let r_test = field t "r_test" Rt.t - - let tol_bnd = field t "tol_bnd" double - - let tol_dj = field t "tol_dj" double - - let tol_piv = field t "tol_piv" double - - let obj_ll = field t "obj_ll" double - - let obj_ul = field t "obj_ul" double - - let it_lim = field t "it_lim" int - - let tm_lim = field t "tm_lim" int - - let out_frq = field t "out_frq" int - - let out_dly = field t "out_dly" int - - let presolve = field t "presolve" BoolInt.t - - let excl = field t "excl" BoolInt.t - - let shift = field t "shift" BoolInt.t - - let aorn = field t "aorn" An.t - - let () = seal t -end - -module Iocp = struct - module Br = struct - type t = FFV | LFV | MFV | DTH | PCH - - let of_int = function - | 1 -> - FFV - | 2 -> - LFV - | 3 -> - MFV - | 4 -> - DTH - | 5 -> - PCH - | _ -> - failwith "Unexpected Branching Technique flag" - - let to_int = function FFV -> 1 | LFV -> 2 | MFV -> 3 | DTH -> 4 | PCH -> 5 - - let t = view ~read:of_int ~write:to_int int - end - - module Bt = struct - type t = DFS | BFS | BLB | BPH - - let of_int = function - | 1 -> - DFS - | 2 -> - BFS - | 3 -> - BLB - | 4 -> - BPH - | _ -> - failwith "Unexpected Backtracking Technique flag" - - let to_int = function DFS -> 1 | BFS -> 2 | BLB -> 3 | BPH -> 4 - - let t = view ~read:of_int ~write:to_int int - end - - module Pp = struct - type t = NONE | ROOT | ALL - - let of_int = function - | 0 -> - NONE - | 1 -> - ROOT - | 2 -> - ALL - | _ -> - failwith "Unexpected Preprocessing flag" - - let to_int = function NONE -> 0 | ROOT -> 1 | ALL -> 2 - - let t = view ~read:of_int ~write:to_int int - end - - type t - - let t : t structure typ = structure "iocp" - - let msg_lev = field t "msg_lev" Msg.t - - let br_tech = field t "br_tech" Br.t - - let bt_tech = field t "bt_tech" Bt.t - - let tol_int = field t "tol_int" double - - let tol_obj = field t "tol_obj" double - - let tm_lim = field t "tm_lim" int - - let out_frq = field t "out_frq" int - - let out_dly = field t "out_dly" int - - let cb_func = field t "cb_func" (ptr void) - - let cb_info = field t "cb_info" (ptr void) - - let cb_size = field t "cb_size" int - - let pp_tech = field t "pp_tech" Pp.t - - let mip_gap = field t "mip_gap" double - - let mir_cuts = field t "mir_cuts" BoolInt.t - - let gmi_cuts = field t "gmi_cuts" BoolInt.t - - let cov_cuts = field t "cov_cuts" BoolInt.t - - let clq_cuts = field t "clq_cuts" BoolInt.t - - let presolve = field t "presolve" BoolInt.t - - let binarize = field t "binarize" BoolInt.t - - let fp_heur = field t "fp_heur" BoolInt.t - - let ps_heur = field t "ps_heur" BoolInt.t - - let ps_tm_lim = field t "ps_tm_lim" int - - let sr_heur = field t "sr_heur" BoolInt.t - - let use_sol = field t "use_sol" BoolInt.t - - let save_sol = field t "save_sol" string - - let alien = field t "alien" BoolInt.t - - let flip = field t "flip" BoolInt.t - - let () = seal t -end - -let set_term_out = foreign "glp_term_out" (BoolInt.t @-> returning void) - -type prob = unit ptr - -let prob : prob typ = ptr void - -let create_prob = foreign "glp_create_prob" (void @-> returning prob) - -let delete_prob = foreign "glp_delete_prob" (prob @-> returning void) - -let set_prob_name = - foreign "glp_set_prob_name" (prob @-> string @-> returning void) - -let get_prob_name = foreign "glp_get_prob_name" (prob @-> returning string) - -let set_obj_dir = foreign "glp_set_obj_dir" (prob @-> Dir.t @-> returning void) - -let get_obj_dir = foreign "glp_get_obj_dir" (prob @-> returning Dir.t) - -let add_rows = foreign "glp_add_rows" (prob @-> int @-> returning int) - -let add_cols = foreign "glp_add_cols" (prob @-> int @-> returning int) - -let set_row_name = - foreign "glp_set_row_name" (prob @-> int @-> string @-> returning void) - -let get_row_name = foreign "glp_get_row_name" (prob @-> int @-> returning string) - -let set_col_name = - foreign "glp_set_col_name" (prob @-> int @-> string @-> returning void) - -let get_col_name = foreign "glp_get_col_name" (prob @-> int @-> returning string) - -let set_row_bnds = - foreign "glp_set_row_bnds" - (prob @-> int @-> Bnd.t @-> double @-> double @-> returning void) - -let set_col_bnds = - foreign "glp_set_col_bnds" - (prob @-> int @-> Bnd.t @-> double @-> double @-> returning void) - -let set_obj_coef = - foreign "glp_set_obj_coef" (prob @-> int @-> double @-> returning void) - -let set_mat_row = - foreign "glp_set_mat_row" - (prob @-> int @-> int @-> ptr void @-> ptr void @-> returning void) - -let set_mat_col = - foreign "glp_set_mat_col" - (prob @-> int @-> int @-> ptr void @-> ptr void @-> returning void) - -let load_matrix = - foreign "glp_load_matrix" - (prob @-> int @-> ptr void @-> ptr void @-> ptr void @-> returning void) - -let set_col_kind = - foreign "glp_set_col_kind" (prob @-> int @-> Vt.t @-> returning void) - -let get_col_kind = foreign "glp_get_col_kind" (prob @-> int @-> returning Vt.t) - -let get_num_rows = foreign "glp_get_num_rows" (prob @-> returning int) - -let get_num_cols = foreign "glp_get_num_cols" (prob @-> returning int) - -let get_num_nz = foreign "glp_get_num_nz" (prob @-> returning int) - -let get_num_int = foreign "glp_get_num_int" (prob @-> returning int) - -let get_num_bin = foreign "glp_get_num_bin" (prob @-> returning int) - -let init_smcp = foreign "glp_init_smcp" (ptr Smcp.t @-> returning void) - -let init_iocp = foreign "glp_init_iocp" (ptr Iocp.t @-> returning void) - -let simplex = foreign "glp_simplex" (prob @-> ptr Smcp.t @-> returning int) - -let intopt = foreign "glp_intopt" (prob @-> ptr Iocp.t @-> returning int) - -let get_status = foreign "glp_get_status" (prob @-> returning Stat.t) - -let mip_status = foreign "glp_mip_status" (prob @-> returning Stat.t) - -let get_obj_val = foreign "glp_get_obj_val" (prob @-> returning double) - -let mip_obj_val = foreign "glp_mip_obj_val" (prob @-> returning double) - -let get_row_prim = foreign "glp_get_row_prim" (prob @-> int @-> returning double) - -let get_row_dual = foreign "glp_get_row_dual" (prob @-> int @-> returning double) - -let mip_row_val = foreign "glp_mip_row_val" (prob @-> int @-> returning double) - -let get_col_prim = foreign "glp_get_col_prim" (prob @-> int @-> returning double) - -let get_col_dual = foreign "glp_get_col_dual" (prob @-> int @-> returning double) - -let mip_col_val = foreign "glp_mip_col_val" (prob @-> int @-> returning double) diff --git a/src/lp-glpk/lp_glp.mli b/src/lp-glpk/lp_glp.mli deleted file mode 100644 index ec4f549..0000000 --- a/src/lp-glpk/lp_glp.mli +++ /dev/null @@ -1,342 +0,0 @@ -(** Raw ctypes binding to GLPK. *) - -module Dir : sig - type t = MIN | MAX - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ -end - -module Vt : sig - type t = CV | IV | BV - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ -end - -module Bnd : sig - type t = FR | LO | UP | DB | FX - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ -end - -module Stat : sig - type t = UNDEF | FEAS | INFEAS | NOFEAS | OPT | UNBND - - val of_int : int -> t - - val to_int : t -> int - - val to_string : t -> string - - val t : t Ctypes.typ -end - -module Msg : sig - type t = OFF | ERR | ON | ALL | DBG - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ -end - -(** Simplex method control parameters. *) -module Smcp : sig - module Meth : sig - type t = PRIMAL | DUALP | DUAL - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ - end - - module Pt : sig - type t = STD | PSE - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ - end - - module Rt : sig - type t = STD | HAR | FLIP - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ - end - - module An : sig - type t = AT | NT - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ - end - - type t - - val t : t Ctypes.structure Ctypes.typ - - val msg_lev : (Msg.t, t Ctypes.structure) Ctypes.field - - val meth : (Meth.t, t Ctypes.structure) Ctypes.field - - val pricing : (Pt.t, t Ctypes.structure) Ctypes.field - - val r_test : (Rt.t, t Ctypes.structure) Ctypes.field - - val tol_bnd : (float, t Ctypes.structure) Ctypes.field - - val tol_dj : (float, t Ctypes.structure) Ctypes.field - - val tol_piv : (float, t Ctypes.structure) Ctypes.field - - val obj_ll : (float, t Ctypes.structure) Ctypes.field - - val obj_ul : (float, t Ctypes.structure) Ctypes.field - - val it_lim : (int, t Ctypes.structure) Ctypes.field - - val tm_lim : (int, t Ctypes.structure) Ctypes.field - (** time limit in ms *) - - val out_frq : (int, t Ctypes.structure) Ctypes.field - (** display frequency in ms *) - - val out_dly : (int, t Ctypes.structure) Ctypes.field - (** display delay in ms *) - - val presolve : (bool, t Ctypes.structure) Ctypes.field - (** enable/disable presolver *) - - val excl : (bool, t Ctypes.structure) Ctypes.field - - val shift : (bool, t Ctypes.structure) Ctypes.field - - val aorn : (An.t, t Ctypes.structure) Ctypes.field -end - -(** Integer optimizer control parameters. *) -module Iocp : sig - module Br : sig - type t = FFV | LFV | MFV | DTH | PCH - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ - end - - module Bt : sig - type t = DFS | BFS | BLB | BPH - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ - end - - module Pp : sig - type t = NONE | ROOT | ALL - - val of_int : int -> t - - val to_int : t -> int - - val t : t Ctypes.typ - end - - type t - - val t : t Ctypes.structure Ctypes.typ - - val msg_lev : (Msg.t, t Ctypes.structure) Ctypes.field - - val br_tech : (Br.t, t Ctypes.structure) Ctypes.field - - val bt_tech : (Bt.t, t Ctypes.structure) Ctypes.field - - val tol_int : (float, t Ctypes.structure) Ctypes.field - - val tol_obj : (float, t Ctypes.structure) Ctypes.field - - val tm_lim : (int, t Ctypes.structure) Ctypes.field - (** time limit in ms *) - - val out_frq : (int, t Ctypes.structure) Ctypes.field - (** display frequency in ms *) - - val out_dly : (int, t Ctypes.structure) Ctypes.field - (** display delay in ms *) - - val cb_func : (unit Ctypes_static.ptr, t Ctypes.structure) Ctypes.field - - val cb_info : (unit Ctypes_static.ptr, t Ctypes.structure) Ctypes.field - - val cb_size : (int, t Ctypes.structure) Ctypes.field - - val pp_tech : (Pp.t, t Ctypes.structure) Ctypes.field - - val mip_gap : (float, t Ctypes.structure) Ctypes.field - - val mir_cuts : (bool, t Ctypes.structure) Ctypes.field - - val gmi_cuts : (bool, t Ctypes.structure) Ctypes.field - - val cov_cuts : (bool, t Ctypes.structure) Ctypes.field - - val clq_cuts : (bool, t Ctypes.structure) Ctypes.field - - val presolve : (bool, t Ctypes.structure) Ctypes.field - - val binarize : (bool, t Ctypes.structure) Ctypes.field - - val fp_heur : (bool, t Ctypes.structure) Ctypes.field - - val ps_heur : (bool, t Ctypes.structure) Ctypes.field - - val ps_tm_lim : (int, t Ctypes.structure) Ctypes.field - (** proxy time limit in ms *) - - val sr_heur : (bool, t Ctypes.structure) Ctypes.field - - val use_sol : (bool, t Ctypes.structure) Ctypes.field - - val save_sol : (string, t Ctypes.structure) Ctypes.field - - val alien : (bool, t Ctypes.structure) Ctypes.field - - val flip : (bool, t Ctypes.structure) Ctypes.field -end - -val set_term_out : bool -> unit - -type prob - -val prob : prob Ctypes.typ - -val create_prob : unit -> prob - -val delete_prob : prob -> unit - -val set_prob_name : prob -> string -> unit - -val get_prob_name : prob -> string - -val set_obj_dir : prob -> Dir.t -> unit - -val get_obj_dir : prob -> Dir.t - -val add_rows : prob -> int -> int - -val add_cols : prob -> int -> int - -val set_row_name : prob -> int -> string -> unit - -val get_row_name : prob -> int -> string - -val set_col_name : prob -> int -> string -> unit - -val get_col_name : prob -> int -> string - -val set_row_bnds : prob -> int -> Bnd.t -> float -> float -> unit -(** set_row_bnds [prob] [i] [bnd] [lb] [ub] sets bounds of i-th row (constraint). - If the row is not lower (upper) bounded, lb (ub) is just ignored. - If the row is equality constraint (Bnd.FX), - only [lb] is used and [ub] is ignored. -*) - -val set_col_bnds : prob -> int -> Bnd.t -> float -> float -> unit -(** set_col_bnds [prob] [j] [bnd] [lb] [ub] sets bounds of j-th col (variable). - If the col is not lower (upper) bounded, lb (ub) is just ignored. - If the col is equality constraint (Bnd.FX), - only [lb] is used and [ub] is ignored. -*) - -val set_obj_coef : prob -> int -> float -> unit -(** set_obj_coef [prob] [j] sets the objective coefficient at j-th col (variable) *) - -val set_mat_row : - prob -> int -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit -(** set_mat_row [prob] [i] [len] [indices] [vals] sets the i-th row of constraint matrix. *) - -val set_mat_col : - prob -> int -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit -(** set_mat_col [prob] [j] [len] [indices] [vals] sets the j-th column of constraint matrix. *) - -val load_matrix : - prob - -> int - -> unit Ctypes_static.ptr - -> unit Ctypes_static.ptr - -> unit Ctypes_static.ptr - -> unit -(** load_matrix [prob] [ne] [ia] [ja] [ar] sets the constraint matrix. - The matrix is represented as an sparce matrix. - for k=1 .. [ne], value [ar][k] is set at ([ia][k], [ja][k]) element. -*) - -val set_col_kind : prob -> int -> Vt.t -> unit - -val get_col_kind : prob -> int -> Vt.t - -val get_num_rows : prob -> int - -val get_num_cols : prob -> int - -val get_num_nz : prob -> int - -val get_num_int : prob -> int - -val get_num_bin : prob -> int - -val init_smcp : Smcp.t Ctypes.structure Ctypes_static.ptr -> unit - -val init_iocp : Iocp.t Ctypes.structure Ctypes_static.ptr -> unit - -val simplex : prob -> Smcp.t Ctypes.structure Ctypes_static.ptr -> int - -val intopt : prob -> Iocp.t Ctypes.structure Ctypes_static.ptr -> int - -val get_status : prob -> Stat.t - -val mip_status : prob -> Stat.t - -val get_obj_val : prob -> float - -val mip_obj_val : prob -> float - -val get_row_prim : prob -> int -> float - -val get_row_dual : prob -> int -> float - -val mip_row_val : prob -> int -> float - -val get_col_prim : prob -> int -> float - -val get_col_dual : prob -> int -> float - -val mip_col_val : prob -> int -> float diff --git a/src/lp-glpk/types/bindings/dune b/src/lp-glpk/types/bindings/dune new file mode 100644 index 0000000..0600747 --- /dev/null +++ b/src/lp-glpk/types/bindings/dune @@ -0,0 +1,4 @@ +(library + (name lp_glpk_bindings_types) + (public_name lp-glpk.bindings.types) + (libraries ctypes.stubs ctypes)) diff --git a/src/lp-glpk/types/bindings/lp_glpk_bindings_types.ml b/src/lp-glpk/types/bindings/lp_glpk_bindings_types.ml new file mode 100644 index 0000000..354b1b4 --- /dev/null +++ b/src/lp-glpk/types/bindings/lp_glpk_bindings_types.ml @@ -0,0 +1,385 @@ +(* integer constants which are #defined in glpk.h version 4.65 and 5+ *) + +module M (F : Ctypes.TYPE) = struct + open Ctypes + open F + + module Dir = struct + type t = MIN | MAX + + let of_int = function + | 1 -> + MIN + | 2 -> + MAX + | _ -> + failwith "Unexpected Direction flag" + + let to_int = function MIN -> 1 | MAX -> 2 + + let t = view ~read:of_int ~write:to_int int + end + + module Vt = struct + type t = CV | IV | BV + + let of_int = function + | 1 -> + CV + | 2 -> + IV + | 3 -> + BV + | _ -> + failwith "Unexpected Vtype flag" + + let to_int = function CV -> 1 | IV -> 2 | BV -> 3 + + let t = view ~read:of_int ~write:to_int int + end + + module Bnd = struct + type t = FR | LO | UP | DB | FX + + let of_int = function + | 1 -> + FR + | 2 -> + LO + | 3 -> + UP + | 4 -> + DB + | 5 -> + FX + | _ -> + failwith "Unexpected Bound flag" + + let to_int = function FR -> 1 | LO -> 2 | UP -> 3 | DB -> 4 | FX -> 5 + + let t = view ~read:of_int ~write:to_int int + end + + module Stat = struct + type t = UNDEF | FEAS | INFEAS | NOFEAS | OPT | UNBND + + let of_int = function + | 1 -> + UNDEF + | 2 -> + FEAS + | 3 -> + INFEAS + | 4 -> + NOFEAS + | 5 -> + OPT + | 6 -> + UNBND + | _ -> + failwith "Unexpected Status flag" + + let to_int = function + | UNDEF -> + 1 + | FEAS -> + 2 + | INFEAS -> + 3 + | NOFEAS -> + 4 + | OPT -> + 5 + | UNBND -> + 6 + + let to_string = function + | UNDEF -> + "Undefined" + | FEAS -> + "Feasible" + | INFEAS -> + "Infeasible" + | NOFEAS -> + "NoFeasible" + | OPT -> + "Optimal" + | UNBND -> + "Unbounded" + + let t = view ~read:of_int ~write:to_int int + end + + (* GLP_ON = 1 and GLP_OFF = 0 *) + module BoolInt = struct + let of_int i = if i = 0 then false else true + + let to_int b = if b then 1 else 0 + + let t = view ~read:of_int ~write:to_int int + end + + module Msg = struct + type t = OFF | ERR | ON | ALL | DBG + + let of_int = function + | 0 -> + OFF + | 1 -> + ERR + | 2 -> + ON + | 3 -> + ALL + | 4 -> + DBG + | _ -> + failwith "Unexpected Msg flag" + + let to_int = function OFF -> 0 | ERR -> 1 | ON -> 2 | ALL -> 3 | DBG -> 4 + + let t = view ~read:of_int ~write:to_int int + end + + module Smcp = struct + module Meth = struct + type t = PRIMAL | DUALP | DUAL + + let of_int = function + | 1 -> + PRIMAL + | 2 -> + DUALP + | 3 -> + DUAL + | _ -> + failwith "Unexpected Method flag" + + let to_int = function PRIMAL -> 1 | DUALP -> 2 | DUAL -> 3 + + let t = view ~read:of_int ~write:to_int int + end + + module Pt = struct + type t = STD | PSE + + let of_int = function + | 0x11 -> + STD + | 0x22 -> + PSE + | _ -> + failwith "Unexpected Pricing flag" + + let to_int = function STD -> 0x11 | PSE -> 0x22 + + let t = view ~read:of_int ~write:to_int int + end + + module Rt = struct + type t = STD | HAR | FLIP + + let of_int = function + | 0x11 -> + STD + | 0x22 -> + HAR + | 0x33 -> + FLIP + | _ -> + failwith "Unexpected Ratio Test flag" + + let to_int = function STD -> 0x11 | HAR -> 0x22 | FLIP -> 0x33 + + let t = view ~read:of_int ~write:to_int int + end + + module An = struct + type t = AT | NT + + let of_int = function + | 1 -> + AT + | 2 -> + NT + | _ -> + failwith "Unexpected A or N flag" + + let to_int = function AT -> 1 | NT -> 2 + + let t = view ~read:of_int ~write:to_int int + end + + type t + + let t : t structure typ = typedef (structure "smcp") "glp_smcp" + + let msg_lev = field t "msg_lev" Msg.t + + let meth = field t "meth" Meth.t + + let pricing = field t "pricing" Pt.t + + let r_test = field t "r_test" Rt.t + + let tol_bnd = field t "tol_bnd" double + + let tol_dj = field t "tol_dj" double + + let tol_piv = field t "tol_piv" double + + let obj_ll = field t "obj_ll" double + + let obj_ul = field t "obj_ul" double + + let it_lim = field t "it_lim" int + + let tm_lim = field t "tm_lim" int + + let out_frq = field t "out_frq" int + + let out_dly = field t "out_dly" int + + let presolve = field t "presolve" BoolInt.t + + let excl = field t "excl" BoolInt.t + + let shift = field t "shift" BoolInt.t + + let aorn = field t "aorn" An.t + + let () = seal t + end + + module Iocp = struct + module Br = struct + type t = FFV | LFV | MFV | DTH | PCH + + let of_int = function + | 1 -> + FFV + | 2 -> + LFV + | 3 -> + MFV + | 4 -> + DTH + | 5 -> + PCH + | _ -> + failwith "Unexpected Branching Technique flag" + + let to_int = function + | FFV -> + 1 + | LFV -> + 2 + | MFV -> + 3 + | DTH -> + 4 + | PCH -> + 5 + + let t = view ~read:of_int ~write:to_int int + end + + module Bt = struct + type t = DFS | BFS | BLB | BPH + + let of_int = function + | 1 -> + DFS + | 2 -> + BFS + | 3 -> + BLB + | 4 -> + BPH + | _ -> + failwith "Unexpected Backtracking Technique flag" + + let to_int = function DFS -> 1 | BFS -> 2 | BLB -> 3 | BPH -> 4 + + let t = view ~read:of_int ~write:to_int int + end + + module Pp = struct + type t = NONE | ROOT | ALL + + let of_int = function + | 0 -> + NONE + | 1 -> + ROOT + | 2 -> + ALL + | _ -> + failwith "Unexpected Preprocessing flag" + + let to_int = function NONE -> 0 | ROOT -> 1 | ALL -> 2 + + let t = view ~read:of_int ~write:to_int int + end + + type t + + let t : t structure typ = typedef (structure "iocp") "glp_iocp" + + let msg_lev = field t "msg_lev" Msg.t + + let br_tech = field t "br_tech" Br.t + + let bt_tech = field t "bt_tech" Bt.t + + let tol_int = field t "tol_int" double + + let tol_obj = field t "tol_obj" double + + let tm_lim = field t "tm_lim" int + + let out_frq = field t "out_frq" int + + let out_dly = field t "out_dly" int + + let cb_func = field t "cb_func" (ptr void) + + let cb_info = field t "cb_info" (ptr void) + + let cb_size = field t "cb_size" int + + let pp_tech = field t "pp_tech" Pp.t + + let mip_gap = field t "mip_gap" double + + let mir_cuts = field t "mir_cuts" BoolInt.t + + let gmi_cuts = field t "gmi_cuts" BoolInt.t + + let cov_cuts = field t "cov_cuts" BoolInt.t + + let clq_cuts = field t "clq_cuts" BoolInt.t + + let presolve = field t "presolve" BoolInt.t + + let binarize = field t "binarize" BoolInt.t + + let fp_heur = field t "fp_heur" BoolInt.t + + let ps_heur = field t "ps_heur" BoolInt.t + + let ps_tm_lim = field t "ps_tm_lim" int + + let sr_heur = field t "sr_heur" BoolInt.t + + let use_sol = field t "use_sol" BoolInt.t + + let save_sol = field t "save_sol" string + + let alien = field t "alien" BoolInt.t + + let flip = field t "flip" BoolInt.t + + let () = seal t + end +end diff --git a/src/lp-glpk/types/lib/dune b/src/lp-glpk/types/lib/dune new file mode 100644 index 0000000..6dec1e6 --- /dev/null +++ b/src/lp-glpk/types/lib/dune @@ -0,0 +1,11 @@ +(rule + (targets g.ml) + (deps ../stubgen/ffi_ml_types_stubgen.exe) + (action (with-stdout-to %{targets} (run %{deps})))) + +(library + (name lp_glpk_types) + (public_name lp-glpk.types) + (flags (:standard -w -9-27)) + (synopsis "Ctypes bindings that describe the libglpk FFI constants") + (libraries lp-glpk.bindings.types ctypes.stubs ctypes)) diff --git a/src/lp-glpk/types/lib/m.ml b/src/lp-glpk/types/lib/m.ml new file mode 100644 index 0000000..a0f5ea4 --- /dev/null +++ b/src/lp-glpk/types/lib/m.ml @@ -0,0 +1 @@ +include Lp_glpk_bindings_types.M(G) diff --git a/src/lp-glpk/types/stubgen/dune b/src/lp-glpk/types/stubgen/dune new file mode 100644 index 0000000..d08cc89 --- /dev/null +++ b/src/lp-glpk/types/stubgen/dune @@ -0,0 +1,14 @@ +(executable + (name ffi_types_stubgen) + (modules ffi_types_stubgen) + (libraries lp-glpk.bindings.types ctypes.stubs ctypes)) + +(rule + (targets ffi_ml_types_stubgen.c) + (deps ./ffi_types_stubgen.exe) + (action (with-stdout-to %{targets} (run %{deps})))) + +(rule + (targets ffi_ml_types_stubgen.exe) + (deps (:c ./ffi_ml_types_stubgen.c)) + (action (run %{cc} %{c} -I %{lib:ctypes:.} -I %{ocaml_where} -o %{targets}))) diff --git a/src/lp-glpk/types/stubgen/ffi_types_stubgen.ml b/src/lp-glpk/types/stubgen/ffi_types_stubgen.ml new file mode 100644 index 0000000..6f0d2f6 --- /dev/null +++ b/src/lp-glpk/types/stubgen/ffi_types_stubgen.ml @@ -0,0 +1,7 @@ +let prefix = "lp_glpk_stub" + +let prologue = "#include " + +let () = + print_endline prologue ; + Cstubs.Types.write_c Format.std_formatter (module Lp_glpk_bindings_types.M) diff --git a/test/lp-glpk/dune b/test/lp-glpk/dune index 2fec27e..068bcaa 100644 --- a/test/lp-glpk/dune +++ b/test/lp-glpk/dune @@ -2,7 +2,6 @@ (package lp-glpk) (names test_glp test_glpk) (libraries alcotest lp lp-glpk) - (flags :standard -cclib -lglpk) (deps (glob_files *.lp)) (action diff --git a/test/lp-glpk/test_glp.ml b/test/lp-glpk/test_glp.ml index 73602f2..93a5995 100644 --- a/test/lp-glpk/test_glp.ml +++ b/test/lp-glpk/test_glp.ml @@ -1,4 +1,5 @@ -open Lp_glp +open Lp_glpk_ffi.M +open Lp_glpk_types.M module C = Ctypes let prob = create_prob () From 28c58febfe3bd6a5f6f6a61ddc1b381ae6d0c4f7 Mon Sep 17 00:00:00 2001 From: Kosuke Tahara Date: Sat, 6 Nov 2021 16:58:19 +0900 Subject: [PATCH 2/7] don't fix .ocamlformat version --- test/.ocamlformat | 1 - 1 file changed, 1 deletion(-) diff --git a/test/.ocamlformat b/test/.ocamlformat index 949520b..2d2e2f3 100644 --- a/test/.ocamlformat +++ b/test/.ocamlformat @@ -1,3 +1,2 @@ -version = 0.14.2 profile = ocamlformat module-item-spacing = compact From 3f3570bec2ed7fa00588cb596c6c777a4b38e79d Mon Sep 17 00:00:00 2001 From: Kosuke Tahara Date: Sat, 6 Nov 2021 21:00:20 +0900 Subject: [PATCH 3/7] lp-glpk: cleanup dune files --- src/lp-glpk/ffi/lib/dune | 2 +- src/lp-glpk/types/lib/dune | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lp-glpk/ffi/lib/dune b/src/lp-glpk/ffi/lib/dune index 806eb67..3b1b879 100644 --- a/src/lp-glpk/ffi/lib/dune +++ b/src/lp-glpk/ffi/lib/dune @@ -24,7 +24,7 @@ (names lp_glpk_stubs) ; supress warnings due to following issue of ctypes: ; https://github.com/ocamllabs/ocaml-ctypes/issues/134 - (flags -Wno-discarded-qualifiers)) + (flags :standard -Wno-discarded-qualifiers)) (c_library_flags (:standard -lglpk)) (libraries lp-glpk.bindings lp-glpk.types ctypes.stubs ctypes)) diff --git a/src/lp-glpk/types/lib/dune b/src/lp-glpk/types/lib/dune index 6dec1e6..727320e 100644 --- a/src/lp-glpk/types/lib/dune +++ b/src/lp-glpk/types/lib/dune @@ -6,6 +6,6 @@ (library (name lp_glpk_types) (public_name lp-glpk.types) - (flags (:standard -w -9-27)) + (flags :standard -w -9-27) (synopsis "Ctypes bindings that describe the libglpk FFI constants") (libraries lp-glpk.bindings.types ctypes.stubs ctypes)) From 25ca5fcbf2479535efe8b87c4ae7ceced3fc3f1d Mon Sep 17 00:00:00 2001 From: Kosuke Tahara Date: Sun, 7 Nov 2021 00:38:11 +0900 Subject: [PATCH 4/7] lp-glpk: add constants generation before types - lp-glpk.consts exports #defined constants in glpk.h as OCaml module - lp-glpk.types uses that and build structs and enum-ish ints - We cannot use ctypes' enum function for glpk.h because there is no actual enum defs. They only use int args/fields that's assumed to take #defined values (unsafe!). --- src/lp-glpk/consts/bindings/dune | 4 + .../bindings/lp_glpk_bindings_consts.ml | 61 ++++ src/lp-glpk/consts/lib/dune | 11 + src/lp-glpk/consts/lib/m.ml | 1 + src/lp-glpk/consts/stubgen/dune | 14 + .../consts/stubgen/ffi_consts_stubgen.ml | 7 + src/lp-glpk/types/bindings/dune | 2 +- .../types/bindings/lp_glpk_bindings_types.ml | 291 +++++++++--------- src/lp-glpk/types/lib/dune | 2 +- 9 files changed, 241 insertions(+), 152 deletions(-) create mode 100644 src/lp-glpk/consts/bindings/dune create mode 100644 src/lp-glpk/consts/bindings/lp_glpk_bindings_consts.ml create mode 100644 src/lp-glpk/consts/lib/dune create mode 100644 src/lp-glpk/consts/lib/m.ml create mode 100644 src/lp-glpk/consts/stubgen/dune create mode 100644 src/lp-glpk/consts/stubgen/ffi_consts_stubgen.ml diff --git a/src/lp-glpk/consts/bindings/dune b/src/lp-glpk/consts/bindings/dune new file mode 100644 index 0000000..0f55436 --- /dev/null +++ b/src/lp-glpk/consts/bindings/dune @@ -0,0 +1,4 @@ +(library + (name lp_glpk_bindings_consts) + (public_name lp-glpk.bindings.consts) + (libraries ctypes.stubs ctypes)) diff --git a/src/lp-glpk/consts/bindings/lp_glpk_bindings_consts.ml b/src/lp-glpk/consts/bindings/lp_glpk_bindings_consts.ml new file mode 100644 index 0000000..1ed2bbd --- /dev/null +++ b/src/lp-glpk/consts/bindings/lp_glpk_bindings_consts.ml @@ -0,0 +1,61 @@ +(* fetch #define int constants from glpk.h *) + +module M (F : Ctypes.TYPE) = struct + let on = F.(constant "GLP_ON" int) + let off = F.(constant "GLP_OFF" int) + + let min = F.(constant "GLP_MIN" int) + let max = F.(constant "GLP_MAX" int) + + let cv = F.(constant "GLP_CV" int) + let iv = F.(constant "GLP_IV" int) + let bv = F.(constant "GLP_BV" int) + + let fr = F.(constant "GLP_FR" int) + let lo = F.(constant "GLP_LO" int) + let up = F.(constant "GLP_UP" int) + let db = F.(constant "GLP_DB" int) + let fx = F.(constant "GLP_FX" int) + + let undef = F.(constant "GLP_UNDEF" int) + let feas = F.(constant "GLP_FEAS" int) + let infeas = F.(constant "GLP_INFEAS" int) + let nofeas = F.(constant "GLP_NOFEAS" int) + let opt = F.(constant "GLP_OPT" int) + let unbnd = F.(constant "GLP_UNBND" int) + + let msg_off = F.(constant "GLP_MSG_OFF" int) + let msg_err = F.(constant "GLP_MSG_ERR" int) + let msg_on = F.(constant "GLP_MSG_ON" int) + let msg_all = F.(constant "GLP_MSG_ALL" int) + let msg_dbg = F.(constant "GLP_MSG_DBG" int) + + let primal = F.(constant "GLP_PRIMAL" int) + let dualp = F.(constant "GLP_DUALP" int) + let dual = F.(constant "GLP_DUAL" int) + + let pt_std = F.(constant "GLP_PT_STD" int) + let pt_pse = F.(constant "GLP_PT_PSE" int) + + let rt_std = F.(constant "GLP_RT_STD" int) + let rt_har = F.(constant "GLP_RT_HAR" int) + let rt_flip = F.(constant "GLP_RT_FLIP" int) + + let use_at = F.(constant "GLP_USE_AT" int) + let use_nt = F.(constant "GLP_USE_NT" int) + + let br_ffv = F.(constant "GLP_BR_FFV" int) + let br_lfv = F.(constant "GLP_BR_LFV" int) + let br_mfv = F.(constant "GLP_BR_MFV" int) + let br_dth = F.(constant "GLP_BR_DTH" int) + let br_pch = F.(constant "GLP_BR_PCH" int) + + let bt_dfs = F.(constant "GLP_BT_DFS" int) + let bt_bfs = F.(constant "GLP_BT_BFS" int) + let bt_blb = F.(constant "GLP_BT_BLB" int) + let bt_bph = F.(constant "GLP_BT_BPH" int) + + let pp_none = F.(constant "GLP_PP_NONE" int) + let pp_root = F.(constant "GLP_PP_ROOT" int) + let pp_all = F.(constant "GLP_PP_ALL" int) +end diff --git a/src/lp-glpk/consts/lib/dune b/src/lp-glpk/consts/lib/dune new file mode 100644 index 0000000..38173b1 --- /dev/null +++ b/src/lp-glpk/consts/lib/dune @@ -0,0 +1,11 @@ +(rule + (targets g.ml) + (deps ../stubgen/ffi_ml_consts_stubgen.exe) + (action (with-stdout-to %{targets} (run %{deps})))) + +(library + (name lp_glpk_consts) + (public_name lp-glpk.consts) + (flags :standard -w -9-27) + (synopsis "Ctypes bindings that describe the libglpk FFI constants") + (libraries lp-glpk.bindings.consts ctypes.stubs ctypes)) diff --git a/src/lp-glpk/consts/lib/m.ml b/src/lp-glpk/consts/lib/m.ml new file mode 100644 index 0000000..8b4ec28 --- /dev/null +++ b/src/lp-glpk/consts/lib/m.ml @@ -0,0 +1 @@ +include Lp_glpk_bindings_consts.M(G) diff --git a/src/lp-glpk/consts/stubgen/dune b/src/lp-glpk/consts/stubgen/dune new file mode 100644 index 0000000..65ca94f --- /dev/null +++ b/src/lp-glpk/consts/stubgen/dune @@ -0,0 +1,14 @@ +(executable + (name ffi_consts_stubgen) + (modules ffi_consts_stubgen) + (libraries lp-glpk.bindings.consts ctypes.stubs ctypes)) + +(rule + (targets ffi_ml_consts_stubgen.c) + (deps ./ffi_consts_stubgen.exe) + (action (with-stdout-to %{targets} (run %{deps})))) + +(rule + (targets ffi_ml_consts_stubgen.exe) + (deps (:c ./ffi_ml_consts_stubgen.c)) + (action (run %{cc} %{c} -I %{lib:ctypes:.} -I %{ocaml_where} -o %{targets}))) diff --git a/src/lp-glpk/consts/stubgen/ffi_consts_stubgen.ml b/src/lp-glpk/consts/stubgen/ffi_consts_stubgen.ml new file mode 100644 index 0000000..0abed8c --- /dev/null +++ b/src/lp-glpk/consts/stubgen/ffi_consts_stubgen.ml @@ -0,0 +1,7 @@ +let prefix = "lp_glpk_stub" + +let prologue = "#include " + +let () = + print_endline prologue ; + Cstubs.Types.write_c Format.std_formatter (module Lp_glpk_bindings_consts.M) diff --git a/src/lp-glpk/types/bindings/dune b/src/lp-glpk/types/bindings/dune index 0600747..dd531c7 100644 --- a/src/lp-glpk/types/bindings/dune +++ b/src/lp-glpk/types/bindings/dune @@ -1,4 +1,4 @@ (library (name lp_glpk_bindings_types) (public_name lp-glpk.bindings.types) - (libraries ctypes.stubs ctypes)) + (libraries lp-glpk.consts ctypes.stubs ctypes)) diff --git a/src/lp-glpk/types/bindings/lp_glpk_bindings_types.ml b/src/lp-glpk/types/bindings/lp_glpk_bindings_types.ml index 354b1b4..2b20254 100644 --- a/src/lp-glpk/types/bindings/lp_glpk_bindings_types.ml +++ b/src/lp-glpk/types/bindings/lp_glpk_bindings_types.ml @@ -1,4 +1,4 @@ -(* integer constants which are #defined in glpk.h version 4.65 and 5+ *) +module C = Lp_glpk_consts.M module M (F : Ctypes.TYPE) = struct open Ctypes @@ -7,15 +7,12 @@ module M (F : Ctypes.TYPE) = struct module Dir = struct type t = MIN | MAX - let of_int = function - | 1 -> - MIN - | 2 -> - MAX - | _ -> - failwith "Unexpected Direction flag" + let of_int i = + if i = C.min then MIN + else if i = C.max then MAX + else failwith "Unexpected Direction flag" - let to_int = function MIN -> 1 | MAX -> 2 + let to_int = function MIN -> C.min | MAX -> C.max let t = view ~read:of_int ~write:to_int int end @@ -23,17 +20,13 @@ module M (F : Ctypes.TYPE) = struct module Vt = struct type t = CV | IV | BV - let of_int = function - | 1 -> - CV - | 2 -> - IV - | 3 -> - BV - | _ -> - failwith "Unexpected Vtype flag" + let of_int i = + if i = C.cv then CV + else if i = C.iv then IV + else if i = C.bv then BV + else failwith "Unexpected Vtype flag" - let to_int = function CV -> 1 | IV -> 2 | BV -> 3 + let to_int = function CV -> C.cv | IV -> C.iv | BV -> C.bv let t = view ~read:of_int ~write:to_int int end @@ -41,21 +34,25 @@ module M (F : Ctypes.TYPE) = struct module Bnd = struct type t = FR | LO | UP | DB | FX - let of_int = function - | 1 -> - FR - | 2 -> - LO - | 3 -> - UP - | 4 -> - DB - | 5 -> - FX - | _ -> - failwith "Unexpected Bound flag" - - let to_int = function FR -> 1 | LO -> 2 | UP -> 3 | DB -> 4 | FX -> 5 + let of_int i = + if i = C.fr then FR + else if i = C.lo then LO + else if i = C.up then UP + else if i = C.db then DB + else if i = C.fx then FX + else failwith "Unexpected Bound flag" + + let to_int = function + | FR -> + C.fr + | LO -> + C.lo + | UP -> + C.up + | DB -> + C.db + | FX -> + C.fx let t = view ~read:of_int ~write:to_int int end @@ -63,35 +60,28 @@ module M (F : Ctypes.TYPE) = struct module Stat = struct type t = UNDEF | FEAS | INFEAS | NOFEAS | OPT | UNBND - let of_int = function - | 1 -> - UNDEF - | 2 -> - FEAS - | 3 -> - INFEAS - | 4 -> - NOFEAS - | 5 -> - OPT - | 6 -> - UNBND - | _ -> - failwith "Unexpected Status flag" + let of_int i = + if i = C.undef then UNDEF + else if i = C.feas then FEAS + else if i = C.infeas then INFEAS + else if i = C.nofeas then NOFEAS + else if i = C.opt then OPT + else if i = C.unbnd then UNBND + else failwith "Unexpected Status flag" let to_int = function | UNDEF -> - 1 + C.undef | FEAS -> - 2 + C.feas | INFEAS -> - 3 + C.infeas | NOFEAS -> - 4 + C.nofeas | OPT -> - 5 + C.opt | UNBND -> - 6 + C.unbnd let to_string = function | UNDEF -> @@ -110,11 +100,11 @@ module M (F : Ctypes.TYPE) = struct let t = view ~read:of_int ~write:to_int int end - (* GLP_ON = 1 and GLP_OFF = 0 *) + (* GLP_ON = true and GLP_OFF = false *) module BoolInt = struct - let of_int i = if i = 0 then false else true + let of_int i = if i = C.off then false else true - let to_int b = if b then 1 else 0 + let to_int b = if b then C.on else C.off let t = view ~read:of_int ~write:to_int int end @@ -122,21 +112,25 @@ module M (F : Ctypes.TYPE) = struct module Msg = struct type t = OFF | ERR | ON | ALL | DBG - let of_int = function - | 0 -> - OFF - | 1 -> - ERR - | 2 -> - ON - | 3 -> - ALL - | 4 -> - DBG - | _ -> - failwith "Unexpected Msg flag" - - let to_int = function OFF -> 0 | ERR -> 1 | ON -> 2 | ALL -> 3 | DBG -> 4 + let of_int i = + if i = C.msg_off then OFF + else if i = C.msg_err then ERR + else if i = C.msg_on then ON + else if i = C.msg_all then ALL + else if i = C.msg_dbg then DBG + else failwith "Unexpected Msg flag" + + let to_int = function + | OFF -> + C.msg_off + | ERR -> + C.msg_err + | ON -> + C.msg_on + | ALL -> + C.msg_all + | DBG -> + C.msg_dbg let t = view ~read:of_int ~write:to_int int end @@ -145,17 +139,19 @@ module M (F : Ctypes.TYPE) = struct module Meth = struct type t = PRIMAL | DUALP | DUAL - let of_int = function - | 1 -> - PRIMAL - | 2 -> - DUALP - | 3 -> - DUAL - | _ -> - failwith "Unexpected Method flag" + let of_int i = + if i = C.primal then PRIMAL + else if i = C.dualp then DUALP + else if i = C.dual then DUAL + else failwith "Unexpected Method flag" - let to_int = function PRIMAL -> 1 | DUALP -> 2 | DUAL -> 3 + let to_int = function + | PRIMAL -> + C.primal + | DUALP -> + C.dualp + | DUAL -> + C.dual let t = view ~read:of_int ~write:to_int int end @@ -163,15 +159,12 @@ module M (F : Ctypes.TYPE) = struct module Pt = struct type t = STD | PSE - let of_int = function - | 0x11 -> - STD - | 0x22 -> - PSE - | _ -> - failwith "Unexpected Pricing flag" + let of_int i = + if i = C.pt_std then STD + else if i = C.pt_pse then PSE + else failwith "Unexpected Pricing flag" - let to_int = function STD -> 0x11 | PSE -> 0x22 + let to_int = function STD -> C.pt_std | PSE -> C.pt_pse let t = view ~read:of_int ~write:to_int int end @@ -179,17 +172,19 @@ module M (F : Ctypes.TYPE) = struct module Rt = struct type t = STD | HAR | FLIP - let of_int = function - | 0x11 -> - STD - | 0x22 -> - HAR - | 0x33 -> - FLIP - | _ -> - failwith "Unexpected Ratio Test flag" + let of_int i = + if i = C.rt_std then STD + else if i = C.rt_har then HAR + else if i = C.rt_flip then FLIP + else failwith "Unexpected Ratio Test flag" - let to_int = function STD -> 0x11 | HAR -> 0x22 | FLIP -> 0x33 + let to_int = function + | STD -> + C.rt_std + | HAR -> + C.rt_har + | FLIP -> + C.rt_flip let t = view ~read:of_int ~write:to_int int end @@ -197,15 +192,12 @@ module M (F : Ctypes.TYPE) = struct module An = struct type t = AT | NT - let of_int = function - | 1 -> - AT - | 2 -> - NT - | _ -> - failwith "Unexpected A or N flag" + let of_int i = + if i = C.use_at then AT + else if i = C.use_nt then NT + else failwith "Unexpected A or N flag" - let to_int = function AT -> 1 | NT -> 2 + let to_int = function AT -> C.use_at | NT -> C.use_nt let t = view ~read:of_int ~write:to_int int end @@ -255,31 +247,25 @@ module M (F : Ctypes.TYPE) = struct module Br = struct type t = FFV | LFV | MFV | DTH | PCH - let of_int = function - | 1 -> - FFV - | 2 -> - LFV - | 3 -> - MFV - | 4 -> - DTH - | 5 -> - PCH - | _ -> - failwith "Unexpected Branching Technique flag" + let of_int i = + if i = C.br_ffv then FFV + else if i = C.br_lfv then LFV + else if i = C.br_mfv then MFV + else if i = C.br_dth then DTH + else if i = C.br_pch then PCH + else failwith "Unexpected Branching Technique flag" let to_int = function | FFV -> - 1 + C.br_ffv | LFV -> - 2 + C.br_lfv | MFV -> - 3 + C.br_mfv | DTH -> - 4 + C.br_dth | PCH -> - 5 + C.br_pch let t = view ~read:of_int ~write:to_int int end @@ -287,19 +273,22 @@ module M (F : Ctypes.TYPE) = struct module Bt = struct type t = DFS | BFS | BLB | BPH - let of_int = function - | 1 -> - DFS - | 2 -> - BFS - | 3 -> - BLB - | 4 -> - BPH - | _ -> - failwith "Unexpected Backtracking Technique flag" + let of_int i = + if i = C.bt_dfs then DFS + else if i = C.bt_bfs then BFS + else if i = C.bt_blb then BLB + else if i = C.bt_bph then BPH + else failwith "Unexpected Backtracking Technique flag" - let to_int = function DFS -> 1 | BFS -> 2 | BLB -> 3 | BPH -> 4 + let to_int = function + | DFS -> + C.bt_dfs + | BFS -> + C.bt_bfs + | BLB -> + C.bt_blb + | BPH -> + C.bt_bph let t = view ~read:of_int ~write:to_int int end @@ -307,17 +296,19 @@ module M (F : Ctypes.TYPE) = struct module Pp = struct type t = NONE | ROOT | ALL - let of_int = function - | 0 -> - NONE - | 1 -> - ROOT - | 2 -> - ALL - | _ -> - failwith "Unexpected Preprocessing flag" - - let to_int = function NONE -> 0 | ROOT -> 1 | ALL -> 2 + let of_int i = + if i = C.pp_none then NONE + else if i = C.pp_root then ROOT + else if i = C.pp_all then ALL + else failwith "Unexpected Preprocessing flag" + + let to_int = function + | NONE -> + C.pp_none + | ROOT -> + C.pp_root + | ALL -> + C.pp_all let t = view ~read:of_int ~write:to_int int end diff --git a/src/lp-glpk/types/lib/dune b/src/lp-glpk/types/lib/dune index 727320e..c7de620 100644 --- a/src/lp-glpk/types/lib/dune +++ b/src/lp-glpk/types/lib/dune @@ -7,5 +7,5 @@ (name lp_glpk_types) (public_name lp-glpk.types) (flags :standard -w -9-27) - (synopsis "Ctypes bindings that describe the libglpk FFI constants") + (synopsis "Ctypes bindings that describe the libglpk FFI structure types") (libraries lp-glpk.bindings.types ctypes.stubs ctypes)) From 9ecf2ce3a87efb5d64225abe1e6f6736ed12ee73 Mon Sep 17 00:00:00 2001 From: Kosuke Tahara Date: Sun, 7 Nov 2021 01:11:53 +0900 Subject: [PATCH 5/7] test/lp-glpk: rename test file --- test/lp-glpk/dune | 2 +- test/lp-glpk/{test_glp.ml => test_glpk_ffi.ml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename test/lp-glpk/{test_glp.ml => test_glpk_ffi.ml} (100%) diff --git a/test/lp-glpk/dune b/test/lp-glpk/dune index 068bcaa..d180e55 100644 --- a/test/lp-glpk/dune +++ b/test/lp-glpk/dune @@ -1,6 +1,6 @@ (tests (package lp-glpk) - (names test_glp test_glpk) + (names test_glpk_ffi test_glpk) (libraries alcotest lp lp-glpk) (deps (glob_files *.lp)) diff --git a/test/lp-glpk/test_glp.ml b/test/lp-glpk/test_glpk_ffi.ml similarity index 100% rename from test/lp-glpk/test_glp.ml rename to test/lp-glpk/test_glpk_ffi.ml From 41bfa5dc507b95c667f98276bc11bd3b5e23d766 Mon Sep 17 00:00:00 2001 From: Kosuke Tahara Date: Sun, 7 Nov 2021 03:00:49 +0900 Subject: [PATCH 6/7] update readme (description of solver intefaces) --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 733a736..e6586a5 100644 --- a/README.md +++ b/README.md @@ -51,20 +51,21 @@ let () = else print_endline "Oops, my problem is broken." ``` -## Documentation +### Notes on solver interfaces -High level APIs have comments for odoc (or ocamldoc). -Generated docs can be found [online](https://ktahar.github.io/ocaml-lp/) or in [docs](docs) directory. +- Since lp-glpk is tested only on GLPK version 4.65 and 5+, something may fail on older versions. +- For lp-gurobi, compile your application with `-cclib -lgurobiXY` flags, where XY is the version of Gurobi (e.g. 91). -## Notes on GLPK interface +## Documentation -- To use this, compile your application with `-cclib -lglpk` flags. -- Since this is tested only on GLPK version 4.65 and 5+, something may fail on older versions. +High-level APIs have comments for odoc (or ocamldoc). +Generated docs can be found [online](https://ktahar.github.io/ocaml-lp/) or in [docs](docs) directory. ## Development Status -Original author isn't developing this heavily because basic features are completed. -However, bug-reports, requests, or patches are always welcome via GitHub [issues](https://github.com/ktahar/ocaml-lp/issues) and [pull requests](https://github.com/ktahar/ocaml-lp/pulls). +Development is not quite active now because basic features are completed. +However, there are several TODOs. +Bug-reports, requests, or patches are always welcome via GitHub [issues](https://github.com/ktahar/ocaml-lp/issues) and [pull requests](https://github.com/ktahar/ocaml-lp/pulls). ### Conformity to LP file format @@ -99,4 +100,4 @@ Some references to LP file format. - Manual of [GLPK](https://www.gnu.org/software/glpk/) ## License -MIT +[MIT](LICENSE.md) From bfdef3b0e74b322f66aa31401b78ee07ed04c363 Mon Sep 17 00:00:00 2001 From: Kosuke Tahara Date: Wed, 10 Nov 2021 12:43:44 +0900 Subject: [PATCH 7/7] update docs for lp-glpk with stubgen --- Makefile | 4 ++-- docs/lp-glpk/Lp_glp/Bnd/index.html | 2 -- docs/lp-glpk/Lp_glp/Dir/index.html | 2 -- docs/lp-glpk/Lp_glp/Iocp/Br/index.html | 2 -- docs/lp-glpk/Lp_glp/Iocp/Bt/index.html | 2 -- docs/lp-glpk/Lp_glp/Iocp/Pp/index.html | 2 -- docs/lp-glpk/Lp_glp/Iocp/index.html | 2 -- docs/lp-glpk/Lp_glp/Msg/index.html | 2 -- docs/lp-glpk/Lp_glp/Smcp/An/index.html | 2 -- docs/lp-glpk/Lp_glp/Smcp/Meth/index.html | 2 -- docs/lp-glpk/Lp_glp/Smcp/Pt/index.html | 2 -- docs/lp-glpk/Lp_glp/Smcp/Rt/index.html | 2 -- docs/lp-glpk/Lp_glp/Smcp/index.html | 2 -- docs/lp-glpk/Lp_glp/Stat/index.html | 2 -- docs/lp-glpk/Lp_glp/Vt/index.html | 2 -- docs/lp-glpk/Lp_glp/index.html | 2 -- docs/lp-glpk/{Lp_glp => Lp_glpk_bindings}/.dune-keep | 0 docs/lp-glpk/Lp_glpk_bindings/M/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_consts/.dune-keep | 0 docs/lp-glpk/Lp_glpk_bindings_consts/M/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_consts/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/.dune-keep | 0 docs/lp-glpk/Lp_glpk_bindings_types/M/Bnd/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/BoolInt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Dir/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Br/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Bt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Pp/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Msg/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/An/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Meth/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Pt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Rt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Stat/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/Vt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/M/index.html | 2 ++ docs/lp-glpk/Lp_glpk_bindings_types/index.html | 2 ++ docs/lp-glpk/Lp_glpk_consts/.dune-keep | 0 docs/lp-glpk/Lp_glpk_consts/G/index.html | 4 ++++ docs/lp-glpk/Lp_glpk_consts/G/module-type-FOREIGN/index.html | 2 ++ docs/lp-glpk/Lp_glpk_consts/G/module-type-TYPE/index.html | 5 +++++ docs/lp-glpk/Lp_glpk_consts/M/index.html | 2 ++ docs/lp-glpk/Lp_glpk_consts/index.html | 2 ++ docs/lp-glpk/Lp_glpk_consts__G/.dune-keep | 0 docs/lp-glpk/Lp_glpk_consts__G/index.html | 2 ++ docs/lp-glpk/Lp_glpk_consts__M/.dune-keep | 0 docs/lp-glpk/Lp_glpk_consts__M/index.html | 2 ++ docs/lp-glpk/Lp_glpk_ffi/.dune-keep | 0 docs/lp-glpk/Lp_glpk_ffi/G/index.html | 2 ++ docs/lp-glpk/Lp_glpk_ffi/M/index.html | 2 ++ docs/lp-glpk/Lp_glpk_ffi/index.html | 2 ++ docs/lp-glpk/Lp_glpk_ffi__G/.dune-keep | 0 docs/lp-glpk/Lp_glpk_ffi__G/index.html | 2 ++ docs/lp-glpk/Lp_glpk_ffi__M/.dune-keep | 0 docs/lp-glpk/Lp_glpk_ffi__M/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/.dune-keep | 0 docs/lp-glpk/Lp_glpk_types/G/index.html | 4 ++++ docs/lp-glpk/Lp_glpk_types/G/module-type-FOREIGN/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/G/module-type-TYPE/index.html | 5 +++++ docs/lp-glpk/Lp_glpk_types/M/Bnd/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/BoolInt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Dir/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Iocp/Br/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Iocp/Bt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Iocp/Pp/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Iocp/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Msg/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Smcp/An/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Smcp/Meth/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Smcp/Pt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Smcp/Rt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Smcp/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Stat/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/Vt/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/M/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types__G/.dune-keep | 0 docs/lp-glpk/Lp_glpk_types__G/index.html | 2 ++ docs/lp-glpk/Lp_glpk_types__M/.dune-keep | 0 docs/lp-glpk/Lp_glpk_types__M/index.html | 2 ++ docs/lp-glpk/index.html | 2 +- src/lp-glpk/lib/dune | 1 - 85 files changed, 123 insertions(+), 34 deletions(-) delete mode 100644 docs/lp-glpk/Lp_glp/Bnd/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Dir/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Iocp/Br/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Iocp/Bt/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Iocp/Pp/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Iocp/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Msg/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Smcp/An/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Smcp/Meth/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Smcp/Pt/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Smcp/Rt/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Smcp/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Stat/index.html delete mode 100644 docs/lp-glpk/Lp_glp/Vt/index.html delete mode 100644 docs/lp-glpk/Lp_glp/index.html rename docs/lp-glpk/{Lp_glp => Lp_glpk_bindings}/.dune-keep (100%) create mode 100644 docs/lp-glpk/Lp_glpk_bindings/M/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_consts/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_bindings_consts/M/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_consts/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Bnd/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/BoolInt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Dir/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Br/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Bt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Pp/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Msg/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/An/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Meth/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Pt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Rt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Stat/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/Vt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/M/index.html create mode 100644 docs/lp-glpk/Lp_glpk_bindings_types/index.html create mode 100644 docs/lp-glpk/Lp_glpk_consts/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_consts/G/index.html create mode 100644 docs/lp-glpk/Lp_glpk_consts/G/module-type-FOREIGN/index.html create mode 100644 docs/lp-glpk/Lp_glpk_consts/G/module-type-TYPE/index.html create mode 100644 docs/lp-glpk/Lp_glpk_consts/M/index.html create mode 100644 docs/lp-glpk/Lp_glpk_consts/index.html create mode 100644 docs/lp-glpk/Lp_glpk_consts__G/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_consts__G/index.html create mode 100644 docs/lp-glpk/Lp_glpk_consts__M/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_consts__M/index.html create mode 100644 docs/lp-glpk/Lp_glpk_ffi/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_ffi/G/index.html create mode 100644 docs/lp-glpk/Lp_glpk_ffi/M/index.html create mode 100644 docs/lp-glpk/Lp_glpk_ffi/index.html create mode 100644 docs/lp-glpk/Lp_glpk_ffi__G/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_ffi__G/index.html create mode 100644 docs/lp-glpk/Lp_glpk_ffi__M/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_ffi__M/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_types/G/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/G/module-type-FOREIGN/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/G/module-type-TYPE/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Bnd/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/BoolInt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Dir/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Iocp/Br/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Iocp/Bt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Iocp/Pp/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Iocp/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Msg/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Smcp/An/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Smcp/Meth/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Smcp/Pt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Smcp/Rt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Smcp/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Stat/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/Vt/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/M/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types__G/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_types__G/index.html create mode 100644 docs/lp-glpk/Lp_glpk_types__M/.dune-keep create mode 100644 docs/lp-glpk/Lp_glpk_types__M/index.html diff --git a/Makefile b/Makefile index 5d681ee..2344858 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,9 @@ test: fmt: dune build @fmt --auto-promote -doc: +docs: dune build @doc - rm -r docs + rm -rf docs cp -r _build/default/_doc/_html docs touch docs/.nojekyll diff --git a/docs/lp-glpk/Lp_glp/Bnd/index.html b/docs/lp-glpk/Lp_glp/Bnd/index.html deleted file mode 100644 index 312cff9..0000000 --- a/docs/lp-glpk/Lp_glp/Bnd/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Bnd (lp-glpk.Lp_glp.Bnd)

Module Lp_glp.Bnd

type t =
| FR
| LO
| UP
| DB
| FX
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Dir/index.html b/docs/lp-glpk/Lp_glp/Dir/index.html deleted file mode 100644 index b36c786..0000000 --- a/docs/lp-glpk/Lp_glp/Dir/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Dir (lp-glpk.Lp_glp.Dir)

Module Lp_glp.Dir

type t =
| MIN
| MAX
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Iocp/Br/index.html b/docs/lp-glpk/Lp_glp/Iocp/Br/index.html deleted file mode 100644 index 4ba8b3e..0000000 --- a/docs/lp-glpk/Lp_glp/Iocp/Br/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Br (lp-glpk.Lp_glp.Iocp.Br)

Module Iocp.Br

type t =
| FFV
| LFV
| MFV
| DTH
| PCH
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Iocp/Bt/index.html b/docs/lp-glpk/Lp_glp/Iocp/Bt/index.html deleted file mode 100644 index 1066705..0000000 --- a/docs/lp-glpk/Lp_glp/Iocp/Bt/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Bt (lp-glpk.Lp_glp.Iocp.Bt)

Module Iocp.Bt

type t =
| DFS
| BFS
| BLB
| BPH
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Iocp/Pp/index.html b/docs/lp-glpk/Lp_glp/Iocp/Pp/index.html deleted file mode 100644 index 916fc11..0000000 --- a/docs/lp-glpk/Lp_glp/Iocp/Pp/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pp (lp-glpk.Lp_glp.Iocp.Pp)

Module Iocp.Pp

type t =
| NONE
| ROOT
| ALL
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Iocp/index.html b/docs/lp-glpk/Lp_glp/Iocp/index.html deleted file mode 100644 index e632bae..0000000 --- a/docs/lp-glpk/Lp_glp/Iocp/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Iocp (lp-glpk.Lp_glp.Iocp)

Module Lp_glp.Iocp

Integer optimizer control parameters.

module Br : sig ... end
module Bt : sig ... end
module Pp : sig ... end
type t
val t : t Ctypes.structure Ctypes.typ
val msg_lev : (Msg.tt Ctypes.structure) Ctypes.field
val br_tech : (Br.tt Ctypes.structure) Ctypes.field
val bt_tech : (Bt.tt Ctypes.structure) Ctypes.field
val tol_int : (float, t Ctypes.structure) Ctypes.field
val tol_obj : (float, t Ctypes.structure) Ctypes.field
val tm_lim : (int, t Ctypes.structure) Ctypes.field

time limit in ms

val out_frq : (int, t Ctypes.structure) Ctypes.field

display frequency in ms

val out_dly : (int, t Ctypes.structure) Ctypes.field

display delay in ms

val cb_func : (unit Ctypes_static.ptrt Ctypes.structure) Ctypes.field
val cb_info : (unit Ctypes_static.ptrt Ctypes.structure) Ctypes.field
val cb_size : (int, t Ctypes.structure) Ctypes.field
val pp_tech : (Pp.tt Ctypes.structure) Ctypes.field
val mip_gap : (float, t Ctypes.structure) Ctypes.field
val mir_cuts : (bool, t Ctypes.structure) Ctypes.field
val gmi_cuts : (bool, t Ctypes.structure) Ctypes.field
val cov_cuts : (bool, t Ctypes.structure) Ctypes.field
val clq_cuts : (bool, t Ctypes.structure) Ctypes.field
val presolve : (bool, t Ctypes.structure) Ctypes.field
val binarize : (bool, t Ctypes.structure) Ctypes.field
val fp_heur : (bool, t Ctypes.structure) Ctypes.field
val ps_heur : (bool, t Ctypes.structure) Ctypes.field
val ps_tm_lim : (int, t Ctypes.structure) Ctypes.field

proxy time limit in ms

val sr_heur : (bool, t Ctypes.structure) Ctypes.field
val use_sol : (bool, t Ctypes.structure) Ctypes.field
val save_sol : (string, t Ctypes.structure) Ctypes.field
val alien : (bool, t Ctypes.structure) Ctypes.field
val flip : (bool, t Ctypes.structure) Ctypes.field
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Msg/index.html b/docs/lp-glpk/Lp_glp/Msg/index.html deleted file mode 100644 index 7277b83..0000000 --- a/docs/lp-glpk/Lp_glp/Msg/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Msg (lp-glpk.Lp_glp.Msg)

Module Lp_glp.Msg

type t =
| OFF
| ERR
| ON
| ALL
| DBG
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Smcp/An/index.html b/docs/lp-glpk/Lp_glp/Smcp/An/index.html deleted file mode 100644 index 7726292..0000000 --- a/docs/lp-glpk/Lp_glp/Smcp/An/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -An (lp-glpk.Lp_glp.Smcp.An)

Module Smcp.An

type t =
| AT
| NT
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Smcp/Meth/index.html b/docs/lp-glpk/Lp_glp/Smcp/Meth/index.html deleted file mode 100644 index e7b56ae..0000000 --- a/docs/lp-glpk/Lp_glp/Smcp/Meth/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Meth (lp-glpk.Lp_glp.Smcp.Meth)

Module Smcp.Meth

type t =
| PRIMAL
| DUALP
| DUAL
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Smcp/Pt/index.html b/docs/lp-glpk/Lp_glp/Smcp/Pt/index.html deleted file mode 100644 index 6837edb..0000000 --- a/docs/lp-glpk/Lp_glp/Smcp/Pt/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pt (lp-glpk.Lp_glp.Smcp.Pt)

Module Smcp.Pt

type t =
| STD
| PSE
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Smcp/Rt/index.html b/docs/lp-glpk/Lp_glp/Smcp/Rt/index.html deleted file mode 100644 index 675553c..0000000 --- a/docs/lp-glpk/Lp_glp/Smcp/Rt/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Rt (lp-glpk.Lp_glp.Smcp.Rt)

Module Smcp.Rt

type t =
| STD
| HAR
| FLIP
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Smcp/index.html b/docs/lp-glpk/Lp_glp/Smcp/index.html deleted file mode 100644 index 04a628d..0000000 --- a/docs/lp-glpk/Lp_glp/Smcp/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Smcp (lp-glpk.Lp_glp.Smcp)

Module Lp_glp.Smcp

Simplex method control parameters.

module Meth : sig ... end
module Pt : sig ... end
module Rt : sig ... end
module An : sig ... end
type t
val t : t Ctypes.structure Ctypes.typ
val msg_lev : (Msg.tt Ctypes.structure) Ctypes.field
val meth : (Meth.tt Ctypes.structure) Ctypes.field
val pricing : (Pt.tt Ctypes.structure) Ctypes.field
val r_test : (Rt.tt Ctypes.structure) Ctypes.field
val tol_bnd : (float, t Ctypes.structure) Ctypes.field
val tol_dj : (float, t Ctypes.structure) Ctypes.field
val tol_piv : (float, t Ctypes.structure) Ctypes.field
val obj_ll : (float, t Ctypes.structure) Ctypes.field
val obj_ul : (float, t Ctypes.structure) Ctypes.field
val it_lim : (int, t Ctypes.structure) Ctypes.field
val tm_lim : (int, t Ctypes.structure) Ctypes.field

time limit in ms

val out_frq : (int, t Ctypes.structure) Ctypes.field

display frequency in ms

val out_dly : (int, t Ctypes.structure) Ctypes.field

display delay in ms

val presolve : (bool, t Ctypes.structure) Ctypes.field

enable/disable presolver

val excl : (bool, t Ctypes.structure) Ctypes.field
val shift : (bool, t Ctypes.structure) Ctypes.field
val aorn : (An.tt Ctypes.structure) Ctypes.field
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Stat/index.html b/docs/lp-glpk/Lp_glp/Stat/index.html deleted file mode 100644 index 2215843..0000000 --- a/docs/lp-glpk/Lp_glp/Stat/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Stat (lp-glpk.Lp_glp.Stat)

Module Lp_glp.Stat

type t =
| UNDEF
| FEAS
| INFEAS
| NOFEAS
| OPT
| UNBND
val of_int : int -> t
val to_int : t -> int
val to_string : t -> string
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/Vt/index.html b/docs/lp-glpk/Lp_glp/Vt/index.html deleted file mode 100644 index 2216fbf..0000000 --- a/docs/lp-glpk/Lp_glp/Vt/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Vt (lp-glpk.Lp_glp.Vt)

Module Lp_glp.Vt

type t =
| CV
| IV
| BV
val of_int : int -> t
val to_int : t -> int
val t : t Ctypes.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/index.html b/docs/lp-glpk/Lp_glp/index.html deleted file mode 100644 index 03dc586..0000000 --- a/docs/lp-glpk/Lp_glp/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Lp_glp (lp-glpk.Lp_glp)

Module Lp_glp

Raw ctypes binding to GLPK.

module Dir : sig ... end
module Vt : sig ... end
module Bnd : sig ... end
module Stat : sig ... end
module Msg : sig ... end
module Smcp : sig ... end

Simplex method control parameters.

module Iocp : sig ... end

Integer optimizer control parameters.

val set_term_out : bool -> unit
type prob
val prob : prob Ctypes.typ
val create_prob : unit -> prob
val delete_prob : prob -> unit
val set_prob_name : prob -> string -> unit
val get_prob_name : prob -> string
val set_obj_dir : prob -> Dir.t -> unit
val get_obj_dir : prob -> Dir.t
val add_rows : prob -> int -> int
val add_cols : prob -> int -> int
val set_row_name : prob -> int -> string -> unit
val get_row_name : prob -> int -> string
val set_col_name : prob -> int -> string -> unit
val get_col_name : prob -> int -> string
val set_row_bnds : prob -> int -> Bnd.t -> float -> float -> unit

set_row_bnds prob i bnd lb ub sets bounds of i-th row (constraint). If the row is not lower (upper) bounded, lb (ub) is just ignored. If the row is equality constraint (Bnd.FX), only lb is used and ub is ignored.

val set_col_bnds : prob -> int -> Bnd.t -> float -> float -> unit

set_col_bnds prob j bnd lb ub sets bounds of j-th col (variable). If the col is not lower (upper) bounded, lb (ub) is just ignored. If the col is equality constraint (Bnd.FX), only lb is used and ub is ignored.

val set_obj_coef : prob -> int -> float -> unit

set_obj_coef prob j sets the objective coefficient at j-th col (variable)

val set_mat_row : prob -> int -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit

set_mat_row prob i len indices vals sets the i-th row of constraint matrix.

val set_mat_col : prob -> int -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit

set_mat_col prob j len indices vals sets the j-th column of constraint matrix.

val load_matrix : prob -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit

load_matrix prob ne ia ja ar sets the constraint matrix. The matrix is represented as an sparce matrix. for k=1 .. ne, value ark is set at (iak, jak) element.

val set_col_kind : prob -> int -> Vt.t -> unit
val get_col_kind : prob -> int -> Vt.t
val get_num_rows : prob -> int
val get_num_cols : prob -> int
val get_num_nz : prob -> int
val get_num_int : prob -> int
val get_num_bin : prob -> int
val init_smcp : Smcp.t Ctypes.structure Ctypes_static.ptr -> unit
val init_iocp : Iocp.t Ctypes.structure Ctypes_static.ptr -> unit
val simplex : prob -> Smcp.t Ctypes.structure Ctypes_static.ptr -> int
val intopt : prob -> Iocp.t Ctypes.structure Ctypes_static.ptr -> int
val get_status : prob -> Stat.t
val mip_status : prob -> Stat.t
val get_obj_val : prob -> float
val mip_obj_val : prob -> float
val get_row_prim : prob -> int -> float
val get_row_dual : prob -> int -> float
val mip_row_val : prob -> int -> float
val get_col_prim : prob -> int -> float
val get_col_dual : prob -> int -> float
val mip_col_val : prob -> int -> float
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glp/.dune-keep b/docs/lp-glpk/Lp_glpk_bindings/.dune-keep similarity index 100% rename from docs/lp-glpk/Lp_glp/.dune-keep rename to docs/lp-glpk/Lp_glpk_bindings/.dune-keep diff --git a/docs/lp-glpk/Lp_glpk_bindings/M/index.html b/docs/lp-glpk/Lp_glpk_bindings/M/index.html new file mode 100644 index 0000000..e8b5bd7 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings/M/index.html @@ -0,0 +1,2 @@ + +M (lp-glpk.Lp_glpk_bindings.M)

Module Lp_glpk_bindings.M

Parameters

module F : Ctypes.FOREIGN

Signature

val set_term_out : (bool -> unit F.return) F.result
type prob = unit Ctypes.ptr
val prob : prob Ctypes.typ
val create_prob : (unit -> prob F.return) F.result
val delete_prob : (prob -> unit F.return) F.result
val set_prob_name : (prob -> string -> unit F.return) F.result
val get_prob_name : (prob -> string F.return) F.result
val set_obj_dir : (prob -> T.Dir.t -> unit F.return) F.result
val get_obj_dir : (prob -> T.Dir.t F.return) F.result
val add_rows : (prob -> int -> int F.return) F.result
val add_cols : (prob -> int -> int F.return) F.result
val set_row_name : (prob -> int -> string -> unit F.return) F.result
val get_row_name : (prob -> int -> string F.return) F.result
val set_col_name : (prob -> int -> string -> unit F.return) F.result
val get_col_name : (prob -> int -> string F.return) F.result
val set_row_bnds : (prob -> int -> T.Bnd.t -> float -> float -> unit F.return) F.result

set_row_bnds prob i bnd lb ub sets bounds of i-th row (constraint). If the row is not lower (upper) bounded, lb (ub) is just ignored. If the row is equality constraint (Bnd.FX), only lb is used and ub is ignored.

val set_col_bnds : (prob -> int -> T.Bnd.t -> float -> float -> unit F.return) F.result

set_col_bnds prob j bnd lb ub sets bounds of j-th col (variable). If the col is not lower (upper) bounded, lb (ub) is just ignored. If the col is equality constraint (Bnd.FX), only lb is used and ub is ignored.

val set_obj_coef : (prob -> int -> float -> unit F.return) F.result

set_obj_coef prob j sets the objective coefficient at j-th col (variable)

val set_mat_row : (prob -> int -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit F.return) F.result

set_mat_row prob i len indices vals sets the i-th row of constraint matrix.

val set_mat_col : (prob -> int -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit F.return) F.result

set_mat_col prob j len indices vals sets the j-th column of constraint matrix.

val load_matrix : (prob -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit F.return) F.result

load_matrix prob ne ia ja ar sets the constraint matrix. The matrix is represented as an sparce matrix. for k=1 .. ne, value ark is set at (iak, jak) element.

val set_col_kind : (prob -> int -> T.Vt.t -> unit F.return) F.result
val get_col_kind : (prob -> int -> T.Vt.t F.return) F.result
val get_num_rows : (prob -> int F.return) F.result
val get_num_cols : (prob -> int F.return) F.result
val get_num_nz : (prob -> int F.return) F.result
val get_num_int : (prob -> int F.return) F.result
val get_num_bin : (prob -> int F.return) F.result
val init_smcp : (T.Smcp.t Ctypes.structure Ctypes_static.ptr -> unit F.return) F.result
val init_iocp : (T.Iocp.t Ctypes.structure Ctypes_static.ptr -> unit F.return) F.result
val simplex : (prob -> T.Smcp.t Ctypes.structure Ctypes_static.ptr -> int F.return) F.result
val intopt : (prob -> T.Iocp.t Ctypes.structure Ctypes_static.ptr -> int F.return) F.result
val get_status : (prob -> T.Stat.t F.return) F.result
val mip_status : (prob -> T.Stat.t F.return) F.result
val get_obj_val : (prob -> float F.return) F.result
val mip_obj_val : (prob -> float F.return) F.result
val get_row_prim : (prob -> int -> float F.return) F.result
val get_row_dual : (prob -> int -> float F.return) F.result
val mip_row_val : (prob -> int -> float F.return) F.result
val get_col_prim : (prob -> int -> float F.return) F.result
val get_col_dual : (prob -> int -> float F.return) F.result
val mip_col_val : (prob -> int -> float F.return) F.result
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings/index.html b/docs/lp-glpk/Lp_glpk_bindings/index.html new file mode 100644 index 0000000..9064836 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_bindings (lp-glpk.Lp_glpk_bindings)

Module Lp_glpk_bindings

module T = Lp_glpk_types.M
module M (F : Ctypes.FOREIGN) : sig ... end
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_consts/.dune-keep b/docs/lp-glpk/Lp_glpk_bindings_consts/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_bindings_consts/M/index.html b/docs/lp-glpk/Lp_glpk_bindings_consts/M/index.html new file mode 100644 index 0000000..60c65fd --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_consts/M/index.html @@ -0,0 +1,2 @@ + +M (lp-glpk.Lp_glpk_bindings_consts.M)

Module Lp_glpk_bindings_consts.M

Parameters

module F : Ctypes.TYPE

Signature

val on : int F.const
val off : int F.const
val min : int F.const
val max : int F.const
val cv : int F.const
val iv : int F.const
val bv : int F.const
val fr : int F.const
val lo : int F.const
val up : int F.const
val db : int F.const
val fx : int F.const
val undef : int F.const
val feas : int F.const
val infeas : int F.const
val nofeas : int F.const
val opt : int F.const
val unbnd : int F.const
val msg_off : int F.const
val msg_err : int F.const
val msg_on : int F.const
val msg_all : int F.const
val msg_dbg : int F.const
val primal : int F.const
val dualp : int F.const
val dual : int F.const
val pt_std : int F.const
val pt_pse : int F.const
val rt_std : int F.const
val rt_har : int F.const
val rt_flip : int F.const
val use_at : int F.const
val use_nt : int F.const
val br_ffv : int F.const
val br_lfv : int F.const
val br_mfv : int F.const
val br_dth : int F.const
val br_pch : int F.const
val bt_dfs : int F.const
val bt_bfs : int F.const
val bt_blb : int F.const
val bt_bph : int F.const
val pp_none : int F.const
val pp_root : int F.const
val pp_all : int F.const
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_consts/index.html b/docs/lp-glpk/Lp_glpk_bindings_consts/index.html new file mode 100644 index 0000000..ab6aba6 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_consts/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_bindings_consts (lp-glpk.Lp_glpk_bindings_consts)

Module Lp_glpk_bindings_consts

module M (F : Ctypes.TYPE) : sig ... end
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/.dune-keep b/docs/lp-glpk/Lp_glpk_bindings_types/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Bnd/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Bnd/index.html new file mode 100644 index 0000000..e3f82bf --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Bnd/index.html @@ -0,0 +1,2 @@ + +Bnd (lp-glpk.Lp_glpk_bindings_types.M.Bnd)

Module M.Bnd

type t =
| FR
| LO
| UP
| DB
| FX
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/BoolInt/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/BoolInt/index.html new file mode 100644 index 0000000..649fc27 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/BoolInt/index.html @@ -0,0 +1,2 @@ + +BoolInt (lp-glpk.Lp_glpk_bindings_types.M.BoolInt)

Module M.BoolInt

val of_int : int Lp_glpk_consts.G.const -> bool
val to_int : bool -> int Lp_glpk_consts.G.const
val t : bool F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Dir/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Dir/index.html new file mode 100644 index 0000000..fbb08e2 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Dir/index.html @@ -0,0 +1,2 @@ + +Dir (lp-glpk.Lp_glpk_bindings_types.M.Dir)

Module M.Dir

type t =
| MIN
| MAX
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Br/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Br/index.html new file mode 100644 index 0000000..b84ac74 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Br/index.html @@ -0,0 +1,2 @@ + +Br (lp-glpk.Lp_glpk_bindings_types.M.Iocp.Br)

Module Iocp.Br

type t =
| FFV
| LFV
| MFV
| DTH
| PCH
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Bt/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Bt/index.html new file mode 100644 index 0000000..d92260e --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Bt/index.html @@ -0,0 +1,2 @@ + +Bt (lp-glpk.Lp_glpk_bindings_types.M.Iocp.Bt)

Module Iocp.Bt

type t =
| DFS
| BFS
| BLB
| BPH
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Pp/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Pp/index.html new file mode 100644 index 0000000..6810e85 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/Pp/index.html @@ -0,0 +1,2 @@ + +Pp (lp-glpk.Lp_glpk_bindings_types.M.Iocp.Pp)

Module Iocp.Pp

type t =
| NONE
| ROOT
| ALL
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/index.html new file mode 100644 index 0000000..873a726 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Iocp/index.html @@ -0,0 +1,2 @@ + +Iocp (lp-glpk.Lp_glpk_bindings_types.M.Iocp)

Module M.Iocp

module Br : sig ... end
module Bt : sig ... end
module Pp : sig ... end
type t
val t : t Ctypes.structure F.typ
val msg_lev : (Msg.tt Ctypes.structure) F.field
val br_tech : (Br.tt Ctypes.structure) F.field
val bt_tech : (Bt.tt Ctypes.structure) F.field
val tol_int : (float, t Ctypes.structure) F.field
val tol_obj : (float, t Ctypes.structure) F.field
val tm_lim : (int, t Ctypes.structure) F.field
val out_frq : (int, t Ctypes.structure) F.field
val out_dly : (int, t Ctypes.structure) F.field
val cb_func : (unit Ctypes_static.ptrt Ctypes.structure) F.field
val cb_info : (unit Ctypes_static.ptrt Ctypes.structure) F.field
val cb_size : (int, t Ctypes.structure) F.field
val pp_tech : (Pp.tt Ctypes.structure) F.field
val mip_gap : (float, t Ctypes.structure) F.field
val mir_cuts : (bool, t Ctypes.structure) F.field
val gmi_cuts : (bool, t Ctypes.structure) F.field
val cov_cuts : (bool, t Ctypes.structure) F.field
val clq_cuts : (bool, t Ctypes.structure) F.field
val presolve : (bool, t Ctypes.structure) F.field
val binarize : (bool, t Ctypes.structure) F.field
val fp_heur : (bool, t Ctypes.structure) F.field
val ps_heur : (bool, t Ctypes.structure) F.field
val ps_tm_lim : (int, t Ctypes.structure) F.field
val sr_heur : (bool, t Ctypes.structure) F.field
val use_sol : (bool, t Ctypes.structure) F.field
val save_sol : (string, t Ctypes.structure) F.field
val alien : (bool, t Ctypes.structure) F.field
val flip : (bool, t Ctypes.structure) F.field
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Msg/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Msg/index.html new file mode 100644 index 0000000..a5d1bc3 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Msg/index.html @@ -0,0 +1,2 @@ + +Msg (lp-glpk.Lp_glpk_bindings_types.M.Msg)

Module M.Msg

type t =
| OFF
| ERR
| ON
| ALL
| DBG
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/An/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/An/index.html new file mode 100644 index 0000000..fa93bf2 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/An/index.html @@ -0,0 +1,2 @@ + +An (lp-glpk.Lp_glpk_bindings_types.M.Smcp.An)

Module Smcp.An

type t =
| AT
| NT
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Meth/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Meth/index.html new file mode 100644 index 0000000..b9c969e --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Meth/index.html @@ -0,0 +1,2 @@ + +Meth (lp-glpk.Lp_glpk_bindings_types.M.Smcp.Meth)

Module Smcp.Meth

type t =
| PRIMAL
| DUALP
| DUAL
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Pt/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Pt/index.html new file mode 100644 index 0000000..c74088c --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Pt/index.html @@ -0,0 +1,2 @@ + +Pt (lp-glpk.Lp_glpk_bindings_types.M.Smcp.Pt)

Module Smcp.Pt

type t =
| STD
| PSE
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Rt/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Rt/index.html new file mode 100644 index 0000000..eb62faa --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/Rt/index.html @@ -0,0 +1,2 @@ + +Rt (lp-glpk.Lp_glpk_bindings_types.M.Smcp.Rt)

Module Smcp.Rt

type t =
| STD
| HAR
| FLIP
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/index.html new file mode 100644 index 0000000..ce58645 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Smcp/index.html @@ -0,0 +1,2 @@ + +Smcp (lp-glpk.Lp_glpk_bindings_types.M.Smcp)

Module M.Smcp

module Meth : sig ... end
module Pt : sig ... end
module Rt : sig ... end
module An : sig ... end
type t
val t : t Ctypes.structure F.typ
val msg_lev : (Msg.tt Ctypes.structure) F.field
val meth : (Meth.tt Ctypes.structure) F.field
val pricing : (Pt.tt Ctypes.structure) F.field
val r_test : (Rt.tt Ctypes.structure) F.field
val tol_bnd : (float, t Ctypes.structure) F.field
val tol_dj : (float, t Ctypes.structure) F.field
val tol_piv : (float, t Ctypes.structure) F.field
val obj_ll : (float, t Ctypes.structure) F.field
val obj_ul : (float, t Ctypes.structure) F.field
val it_lim : (int, t Ctypes.structure) F.field
val tm_lim : (int, t Ctypes.structure) F.field
val out_frq : (int, t Ctypes.structure) F.field
val out_dly : (int, t Ctypes.structure) F.field
val presolve : (bool, t Ctypes.structure) F.field
val excl : (bool, t Ctypes.structure) F.field
val shift : (bool, t Ctypes.structure) F.field
val aorn : (An.tt Ctypes.structure) F.field
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Stat/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Stat/index.html new file mode 100644 index 0000000..1c5b90c --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Stat/index.html @@ -0,0 +1,2 @@ + +Stat (lp-glpk.Lp_glpk_bindings_types.M.Stat)

Module M.Stat

type t =
| UNDEF
| FEAS
| INFEAS
| NOFEAS
| OPT
| UNBND
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val to_string : t -> string
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/Vt/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/Vt/index.html new file mode 100644 index 0000000..78bcaff --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/Vt/index.html @@ -0,0 +1,2 @@ + +Vt (lp-glpk.Lp_glpk_bindings_types.M.Vt)

Module M.Vt

type t =
| CV
| IV
| BV
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t F.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/M/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/M/index.html new file mode 100644 index 0000000..8f22a14 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/M/index.html @@ -0,0 +1,2 @@ + +M (lp-glpk.Lp_glpk_bindings_types.M)

Module Lp_glpk_bindings_types.M

Parameters

module F : Ctypes.TYPE

Signature

module Dir : sig ... end
module Vt : sig ... end
module Bnd : sig ... end
module Stat : sig ... end
module BoolInt : sig ... end
module Msg : sig ... end
module Smcp : sig ... end
module Iocp : sig ... end
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_bindings_types/index.html b/docs/lp-glpk/Lp_glpk_bindings_types/index.html new file mode 100644 index 0000000..154fcda --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_bindings_types/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_bindings_types (lp-glpk.Lp_glpk_bindings_types)

Module Lp_glpk_bindings_types

module C = Lp_glpk_consts.M
module M (F : Ctypes.TYPE) : sig ... end
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_consts/.dune-keep b/docs/lp-glpk/Lp_glpk_consts/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_consts/G/index.html b/docs/lp-glpk/Lp_glpk_consts/G/index.html new file mode 100644 index 0000000..8d28f88 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_consts/G/index.html @@ -0,0 +1,4 @@ + +G (lp-glpk.Lp_glpk_consts.G)

Module Lp_glpk_consts.G

include module type of struct include Ctypes end
type (!'a, !'b) pointer = ('a'b) Ctypes_static.pointer
type !'a ptr = ('a[ `C ]) pointer
type !'a ocaml = 'a Ctypes_static.ocaml
type !'a carray = 'a Ctypes_static.carray
type !'a bigarray_class = 'a Ctypes_static.bigarray_class
val genarray : < ba_repr : 'b; bigarray : ('a'b'l) Bigarray_compat.Genarray.t; carray : 'a carray; dims : int array; element : 'a; layout : 'l; > bigarray_class
val array1 : < ba_repr : 'b; bigarray : ('a'b'l) Bigarray_compat.Array1.t; carray : 'a carray; dims : int; element : 'a; layout : 'l; > bigarray_class
val array2 : < ba_repr : 'b; bigarray : ('a'b'l) Bigarray_compat.Array2.t; carray : 'a carray carray; dims : int * int; element : 'a; layout : 'l; > bigarray_class
val array3 : < ba_repr : 'b; bigarray : ('a'b'l) Bigarray_compat.Array3.t; carray : 'a carray carray carray; dims : int * int * int; element : 'a; layout : 'l; > bigarray_class
type (!'a, !'kind) structured = ('a'kind) Ctypes_static.structured
type !'a structure = ('a[ `Struct ]) structured
type !'a union = ('a[ `Union ]) structured
type (!'a, !'t) field = ('a't) Ctypes_static.field
type !'a abstract = 'a Ctypes_static.abstract
type !'a typ = 'a Ctypes_static.typ
val void : unit typ
val char : char typ
val schar : int typ
val short : int typ
val int : int typ
val long : Signed.long typ
val llong : Signed.llong typ
val nativeint : nativeint typ
val int8_t : int typ
val int16_t : int typ
val int32_t : int32 typ
val int64_t : int64 typ
module Intptr = Ctypes.Intptr
val intptr_t : Intptr.t typ
module Ptrdiff = Ctypes.Ptrdiff
val ptrdiff_t : Ptrdiff.t typ
val camlint : int typ
val uchar : Unsigned.uchar typ
val bool : bool typ
val uint8_t : Unsigned.uint8 typ
val uint16_t : Unsigned.uint16 typ
val uint32_t : Unsigned.uint32 typ
val uint64_t : Unsigned.uint64 typ
val size_t : Unsigned.size_t typ
val ushort : Unsigned.ushort typ
val sint : Signed.sint typ
val uint : Unsigned.uint typ
val ulong : Unsigned.ulong typ
val ullong : Unsigned.ullong typ
module Uintptr = Ctypes.Uintptr
val uintptr_t : Uintptr.t typ
val float : float typ
val double : float typ
val ldouble : LDouble.t typ
val complex32 : Stdlib.Complex.t typ
val complex64 : Stdlib.Complex.t typ
val complexld : ComplexL.t typ
val ptr : 'a typ -> 'a Ctypes_static.ptr typ
val ptr_opt : 'a typ -> 'a Ctypes_static.ptr option typ
val string : string typ
val string_opt : string option typ
val ocaml_string : string Ctypes_static.ocaml typ
val ocaml_bytes : bytes Ctypes_static.ocaml typ
val array : int -> 'a typ -> 'a Ctypes_static.carray typ
val bigarray : < ba_repr : 'b; bigarray : 'bigarray; carray : 'c; dims : 'dims; element : 'a; layout : Bigarray_compat.c_layout; > Ctypes_static.bigarray_class -> 'dims -> ('a'b) Bigarray_compat.kind -> 'bigarray typ
val fortran_bigarray : < ba_repr : 'b; bigarray : 'bigarray; carray : 'c; dims : 'dims; element : 'a; layout : Bigarray_compat.fortran_layout; > Ctypes_static.bigarray_class -> 'dims -> ('a'b) Bigarray_compat.kind -> 'bigarray typ
val typ_of_bigarray_kind : ('a'b) Bigarray_compat.kind -> 'a typ
val structure : string -> 's Ctypes_static.structure typ
val union : string -> 's Ctypes_static.union typ
val view : ?format_typ:((Stdlib.Format.formatter -> unit) -> Stdlib.Format.formatter -> unit) -> +?format:(Stdlib.Format.formatter -> 'b -> unit) -> read:('a -> 'b) -> write:('b -> 'a) -> +'a typ -> 'b typ
val typedef : 'a typ -> string -> 'a typ
val abstract : name:string -> size:int -> alignment:int -> 'a Ctypes_static.abstract typ
val lift_typ : 'a Ctypes_static.typ -> 'a typ
type !'a fn = 'a Ctypes_static.fn
val (@->) : 'a typ -> 'b fn -> ('a -> 'b) fn
val returning : 'a typ -> 'a fn
type !'a static_funptr = 'a Ctypes_static.static_funptr
val static_funptr : 'a fn -> 'a Ctypes_static.static_funptr typ
val sizeof : 'a typ -> int
val alignment : 'a typ -> int
val format_typ : ?name:string -> Stdlib.Format.formatter -> 'a typ -> unit
val format_fn : ?name:string -> Stdlib.Format.formatter -> 'a fn -> unit
val string_of_typ : ?name:string -> 'a typ -> string
val string_of_fn : ?name:string -> 'a fn -> string
val format : 'a typ -> Stdlib.Format.formatter -> 'a -> unit
val string_of : 'a typ -> 'a -> string
val null : unit ptr
val (!@) : 'a ptr -> 'a
val (<-@) : 'a ptr -> 'a -> unit
val (+@) : ('a'b) pointer -> int -> ('a'b) pointer
val (-@) : ('a'b) pointer -> int -> ('a'b) pointer
val ptr_diff : ('a'b) pointer -> ('a'b) pointer -> int
val from_voidp : 'a typ -> unit ptr -> 'a ptr
val to_voidp : 'a ptr -> unit ptr
val allocate : ?finalise:('a ptr -> unit) -> 'a typ -> 'a -> 'a ptr
val allocate_n : ?finalise:('a ptr -> unit) -> 'a typ -> count:int -> 'a ptr
val ptr_compare : 'a ptr -> 'a ptr -> int
val is_null : 'a ptr -> bool
val reference_type : 'a ptr -> 'a typ
val ptr_of_raw_address : nativeint -> unit ptr
val funptr_of_raw_address : nativeint -> (unit -> unit) Ctypes_static.static_funptr
val raw_address_of_ptr : unit ptr -> nativeint
val string_from_ptr : char ptr -> length:int -> string
val ocaml_string_start : string -> string ocaml
val ocaml_bytes_start : bytes -> bytes ocaml
module CArray = Ctypes.CArray
val bigarray_start : < ba_repr : 'c; bigarray : 'b; carray : 'd; dims : 'e; element : 'a; layout : 'l; > bigarray_class -> 'b -> 'a ptr
val bigarray_of_ptr : < ba_repr : 'f; bigarray : 'b; carray : 'c; dims : 'i; element : 'a; layout : Bigarray_compat.c_layout; > bigarray_class -> 'i -> ('a'f) Bigarray_compat.kind -> 'a ptr -> 'b
val fortran_bigarray_of_ptr : < ba_repr : 'f; bigarray : 'b; carray : 'c; dims : 'i; element : 'a; layout : Bigarray_compat.fortran_layout; > bigarray_class -> 'i -> ('a'f) Bigarray_compat.kind -> 'a ptr -> 'b
val array_of_bigarray : < ba_repr : 'a; bigarray : 'b; carray : 'c; dims : 'd; element : 'e; layout : Bigarray_compat.c_layout; > bigarray_class -> 'b -> 'c
val bigarray_of_array : < ba_repr : 'f; bigarray : 'b; carray : 'c carray; dims : 'i; element : 'a; layout : Bigarray_compat.c_layout; > bigarray_class -> ('a'f) Bigarray_compat.kind -> 'c carray -> 'b
val make : ?finalise:(('a'b) structured -> unit) -> ('a'b) structured typ -> ('a'b) structured
val setf : ('b'c) structured -> ('a('b'c) structured) field -> 'a -> unit
val getf : ('b'c) structured -> ('a('b'c) structured) field -> 'a
val (@.) : ('b'c) structured -> ('a('b'c) structured) field -> 'a ptr
val (|->) : ('b'c) structured ptr -> ('a('b'c) structured) field -> 'a ptr
val offsetof : ('a'b structure) field -> int
val field_type : ('a'b) field -> 'a typ
val field_name : ('a'b) field -> string
val addr : ('a'b) structured -> ('a'b) structured ptr
val coerce : 'a typ -> 'b typ -> 'a -> 'b
val coerce_fn : 'a fn -> 'b fn -> 'a -> 'b
module type FOREIGN = sig ... end
module type TYPE = sig ... end
module Root = Ctypes.Root
exception Unsupported of string
exception ModifyingSealedType of string
exception IncompleteType
type uncoercible_info = Ctypes.uncoercible_info
exception Uncoercible of uncoercible_info
val lift : 'a -> 'a
val field : t a. 't Ctypes_static.typ -> string -> 'a Ctypes_static.typ -> ('a't) Ctypes_static.field
val seal : a. 'a Ctypes_static.typ -> unit
type 'a const = 'a
val constant : string -> 't Ctypes_static.typ -> 't
val enum : string -> ?typedef:'b -> ?unexpected:'c -> ('a * int64) list -> 'd
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_consts/G/module-type-FOREIGN/index.html b/docs/lp-glpk/Lp_glpk_consts/G/module-type-FOREIGN/index.html new file mode 100644 index 0000000..107245d --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_consts/G/module-type-FOREIGN/index.html @@ -0,0 +1,2 @@ + +FOREIGN (lp-glpk.Lp_glpk_consts.G.FOREIGN)

Module type G.FOREIGN

type 'a fn
type 'a return
val (@->) : 'a typ -> 'b fn -> ('a -> 'b) fn
val returning : 'a typ -> 'a return fn
type 'a result
val foreign : string -> ('a -> 'b) fn -> ('a -> 'b) result
val foreign_value : string -> 'a typ -> 'a ptr result
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_consts/G/module-type-TYPE/index.html b/docs/lp-glpk/Lp_glpk_consts/G/module-type-TYPE/index.html new file mode 100644 index 0000000..d961918 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_consts/G/module-type-TYPE/index.html @@ -0,0 +1,5 @@ + +TYPE (lp-glpk.Lp_glpk_consts.G.TYPE)

Module type G.TYPE

type 'a typ
val void : unit typ
val char : char typ
val schar : int typ
val short : int typ
val int : int typ
val long : Signed.long typ
val llong : Signed.llong typ
val nativeint : nativeint typ
val int8_t : int typ
val int16_t : int typ
val int32_t : int32 typ
val int64_t : int64 typ
module Intptr : Signed.S
val intptr_t : Intptr.t typ
module Ptrdiff : Signed.S
val ptrdiff_t : Ptrdiff.t typ
val camlint : int typ
val uchar : Unsigned.uchar typ
val bool : bool typ
val uint8_t : Unsigned.uint8 typ
val uint16_t : Unsigned.uint16 typ
val uint32_t : Unsigned.uint32 typ
val uint64_t : Unsigned.uint64 typ
val size_t : Unsigned.size_t typ
val ushort : Unsigned.ushort typ
val sint : Signed.sint typ
val uint : Unsigned.uint typ
val ulong : Unsigned.ulong typ
val ullong : Unsigned.ullong typ
module Uintptr : Unsigned.S
val uintptr_t : Uintptr.t typ
val float : float typ
val double : float typ
val ldouble : LDouble.t typ
val complex32 : Stdlib.Complex.t typ
val complex64 : Stdlib.Complex.t typ
val complexld : ComplexL.t typ
val ptr : 'a typ -> 'a Ctypes_static.ptr typ
val ptr_opt : 'a typ -> 'a Ctypes_static.ptr option typ
val string : string typ
val string_opt : string option typ
val ocaml_string : string Ctypes_static.ocaml typ
val ocaml_bytes : bytes Ctypes_static.ocaml typ
val array : int -> 'a typ -> 'a Ctypes_static.carray typ
val bigarray : < ba_repr : 'b; bigarray : 'bigarray; carray : 'c; dims : 'dims; element : 'a; layout : Bigarray_compat.c_layout; > Ctypes_static.bigarray_class -> 'dims -> ('a'b) Bigarray_compat.kind -> 'bigarray typ
val fortran_bigarray : < ba_repr : 'b; bigarray : 'bigarray; carray : 'c; dims : 'dims; element : 'a; layout : Bigarray_compat.fortran_layout; > Ctypes_static.bigarray_class -> 'dims -> ('a'b) Bigarray_compat.kind -> 'bigarray typ
val typ_of_bigarray_kind : ('a'b) Bigarray_compat.kind -> 'a typ
type ('a, 't) field
val structure : string -> 's Ctypes_static.structure typ
val union : string -> 's Ctypes_static.union typ
val field : ('s[< `Struct | `Union ] as 'b) Ctypes_static.structured typ -> string -> 'a typ -> ('a('s'b) Ctypes_static.structured) field
val seal : ('a[< `Struct | `Union ]) Ctypes_static.structured typ -> unit
val view : ?format_typ:((Stdlib.Format.formatter -> unit) -> Stdlib.Format.formatter -> unit) -> +?format:(Stdlib.Format.formatter -> 'b -> unit) -> read:('a -> 'b) -> write:('b -> 'a) -> +'a typ -> 'b typ
val typedef : 'a typ -> string -> 'a typ
val abstract : name:string -> size:int -> alignment:int -> 'a Ctypes_static.abstract typ
val lift_typ : 'a Ctypes_static.typ -> 'a typ
type !'a fn = 'a Ctypes_static.fn
val (@->) : 'a typ -> 'b fn -> ('a -> 'b) fn
val returning : 'a typ -> 'a fn
type !'a static_funptr = 'a Ctypes_static.static_funptr
val static_funptr : 'a fn -> 'a Ctypes_static.static_funptr typ
type 'a const
val constant : string -> 'a typ -> 'a const
val enum : string -> ?typedef:bool -> ?unexpected:(int64 -> 'a) -> +('a * int64 const) list -> 'a typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_consts/M/index.html b/docs/lp-glpk/Lp_glpk_consts/M/index.html new file mode 100644 index 0000000..0de586f --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_consts/M/index.html @@ -0,0 +1,2 @@ + +M (lp-glpk.Lp_glpk_consts.M)

Module Lp_glpk_consts.M

val on : int G.const
val off : int G.const
val min : int G.const
val max : int G.const
val cv : int G.const
val iv : int G.const
val bv : int G.const
val fr : int G.const
val lo : int G.const
val up : int G.const
val db : int G.const
val fx : int G.const
val undef : int G.const
val feas : int G.const
val infeas : int G.const
val nofeas : int G.const
val opt : int G.const
val unbnd : int G.const
val msg_off : int G.const
val msg_err : int G.const
val msg_on : int G.const
val msg_all : int G.const
val msg_dbg : int G.const
val primal : int G.const
val dualp : int G.const
val dual : int G.const
val pt_std : int G.const
val pt_pse : int G.const
val rt_std : int G.const
val rt_har : int G.const
val rt_flip : int G.const
val use_at : int G.const
val use_nt : int G.const
val br_ffv : int G.const
val br_lfv : int G.const
val br_mfv : int G.const
val br_dth : int G.const
val br_pch : int G.const
val bt_dfs : int G.const
val bt_bfs : int G.const
val bt_blb : int G.const
val bt_bph : int G.const
val pp_none : int G.const
val pp_root : int G.const
val pp_all : int G.const
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_consts/index.html b/docs/lp-glpk/Lp_glpk_consts/index.html new file mode 100644 index 0000000..6204ed0 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_consts/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_consts (lp-glpk.Lp_glpk_consts)

Module Lp_glpk_consts

module G : sig ... end
module M : sig ... end
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_consts__G/.dune-keep b/docs/lp-glpk/Lp_glpk_consts__G/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_consts__G/index.html b/docs/lp-glpk/Lp_glpk_consts__G/index.html new file mode 100644 index 0000000..5941d2b --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_consts__G/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_consts__G (lp-glpk.Lp_glpk_consts__G)

Module Lp_glpk_consts__G

\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_consts__M/.dune-keep b/docs/lp-glpk/Lp_glpk_consts__M/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_consts__M/index.html b/docs/lp-glpk/Lp_glpk_consts__M/index.html new file mode 100644 index 0000000..8507b25 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_consts__M/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_consts__M (lp-glpk.Lp_glpk_consts__M)

Module Lp_glpk_consts__M

\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_ffi/.dune-keep b/docs/lp-glpk/Lp_glpk_ffi/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_ffi/G/index.html b/docs/lp-glpk/Lp_glpk_ffi/G/index.html new file mode 100644 index 0000000..39f8b31 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_ffi/G/index.html @@ -0,0 +1,2 @@ + +G (lp-glpk.Lp_glpk_ffi.G)

Module Lp_glpk_ffi.G

module CI = Cstubs_internals
val lp_glpk_stub_1_glp_term_out : int -> unit
val lp_glpk_stub_2_glp_create_prob : unit -> CI.voidp
val lp_glpk_stub_3_glp_delete_prob : (__) CI.fatptr -> unit
val lp_glpk_stub_4_glp_set_prob_name : (__) CI.fatptr -> (__) CI.fatptr -> unit
val lp_glpk_stub_5_glp_get_prob_name : (__) CI.fatptr -> CI.voidp
val lp_glpk_stub_6_glp_set_obj_dir : (__) CI.fatptr -> int -> unit
val lp_glpk_stub_7_glp_get_obj_dir : (__) CI.fatptr -> int
val lp_glpk_stub_8_glp_add_rows : (__) CI.fatptr -> int -> int
val lp_glpk_stub_9_glp_add_cols : (__) CI.fatptr -> int -> int
val lp_glpk_stub_10_glp_set_row_name : (__) CI.fatptr -> int -> (__) CI.fatptr -> unit
val lp_glpk_stub_11_glp_get_row_name : (__) CI.fatptr -> int -> CI.voidp
val lp_glpk_stub_12_glp_set_col_name : (__) CI.fatptr -> int -> (__) CI.fatptr -> unit
val lp_glpk_stub_13_glp_get_col_name : (__) CI.fatptr -> int -> CI.voidp
val lp_glpk_stub_14_glp_set_row_bnds : (__) CI.fatptr -> int -> int -> float -> float -> unit
val lp_glpk_stub_15_glp_set_col_bnds : (__) CI.fatptr -> int -> int -> float -> float -> unit
val lp_glpk_stub_16_glp_set_obj_coef : (__) CI.fatptr -> int -> float -> unit
val lp_glpk_stub_17_glp_set_mat_row : (__) CI.fatptr -> int -> int -> (__) CI.fatptr -> (__) CI.fatptr -> unit
val lp_glpk_stub_18_glp_set_mat_col : (__) CI.fatptr -> int -> int -> (__) CI.fatptr -> (__) CI.fatptr -> unit
val lp_glpk_stub_19_glp_load_matrix : (__) CI.fatptr -> int -> (__) CI.fatptr -> (__) CI.fatptr -> (__) CI.fatptr -> unit
val lp_glpk_stub_20_glp_set_col_kind : (__) CI.fatptr -> int -> int -> unit
val lp_glpk_stub_21_glp_get_col_kind : (__) CI.fatptr -> int -> int
val lp_glpk_stub_22_glp_get_num_rows : (__) CI.fatptr -> int
val lp_glpk_stub_23_glp_get_num_cols : (__) CI.fatptr -> int
val lp_glpk_stub_24_glp_get_num_nz : (__) CI.fatptr -> int
val lp_glpk_stub_25_glp_get_num_int : (__) CI.fatptr -> int
val lp_glpk_stub_26_glp_get_num_bin : (__) CI.fatptr -> int
val lp_glpk_stub_27_glp_init_smcp : (__) CI.fatptr -> unit
val lp_glpk_stub_28_glp_init_iocp : (__) CI.fatptr -> unit
val lp_glpk_stub_29_glp_simplex : (__) CI.fatptr -> (__) CI.fatptr -> int
val lp_glpk_stub_30_glp_intopt : (__) CI.fatptr -> (__) CI.fatptr -> int
val lp_glpk_stub_31_glp_get_status : (__) CI.fatptr -> int
val lp_glpk_stub_32_glp_mip_status : (__) CI.fatptr -> int
val lp_glpk_stub_33_glp_get_obj_val : (__) CI.fatptr -> float
val lp_glpk_stub_34_glp_mip_obj_val : (__) CI.fatptr -> float
val lp_glpk_stub_35_glp_get_row_prim : (__) CI.fatptr -> int -> float
val lp_glpk_stub_36_glp_get_row_dual : (__) CI.fatptr -> int -> float
val lp_glpk_stub_37_glp_mip_row_val : (__) CI.fatptr -> int -> float
val lp_glpk_stub_38_glp_get_col_prim : (__) CI.fatptr -> int -> float
val lp_glpk_stub_39_glp_get_col_dual : (__) CI.fatptr -> int -> float
val lp_glpk_stub_40_glp_mip_col_val : (__) CI.fatptr -> int -> float
type 'a result = 'a
type 'a return = 'a
type 'a fn =
| Returns : 'a CI.typ -> 'a return fn
| Function : 'a CI.typ * 'b fn -> ('a -> 'b) fn
val map_result : ('a -> 'b) -> 'a -> 'b
val returning : 'a CI.typ -> 'a return fn
val (@->) : 'a CI.typ -> 'b fn -> ('a -> 'b) fn
val foreign : a b. string -> ('a -> 'b) fn -> 'a -> 'b
val foreign_value : a. string -> 'a Ctypes.typ -> 'a Ctypes.ptr
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_ffi/M/index.html b/docs/lp-glpk/Lp_glpk_ffi/M/index.html new file mode 100644 index 0000000..0377b33 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_ffi/M/index.html @@ -0,0 +1,2 @@ + +M (lp-glpk.Lp_glpk_ffi.M)

Module Lp_glpk_ffi.M

val set_term_out : (bool -> unit G.return) G.result
type prob = unit Ctypes.ptr
val prob : prob Ctypes.typ
val create_prob : (unit -> prob G.return) G.result
val delete_prob : (prob -> unit G.return) G.result
val set_prob_name : (prob -> string -> unit G.return) G.result
val get_prob_name : (prob -> string G.return) G.result
val set_obj_dir : (prob -> Lp_glpk_bindings.T.Dir.t -> unit G.return) G.result
val add_rows : (prob -> int -> int G.return) G.result
val add_cols : (prob -> int -> int G.return) G.result
val set_row_name : (prob -> int -> string -> unit G.return) G.result
val get_row_name : (prob -> int -> string G.return) G.result
val set_col_name : (prob -> int -> string -> unit G.return) G.result
val get_col_name : (prob -> int -> string G.return) G.result
val set_row_bnds : (prob -> int -> Lp_glpk_bindings.T.Bnd.t -> float -> float -> unit G.return) G.result
val set_col_bnds : (prob -> int -> Lp_glpk_bindings.T.Bnd.t -> float -> float -> unit G.return) G.result
val set_obj_coef : (prob -> int -> float -> unit G.return) G.result
val set_mat_row : (prob -> int -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit G.return) G.result
val set_mat_col : (prob -> int -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit G.return) G.result
val load_matrix : (prob -> int -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit Ctypes_static.ptr -> unit G.return) G.result
val set_col_kind : (prob -> int -> Lp_glpk_bindings.T.Vt.t -> unit G.return) G.result
val get_col_kind : (prob -> int -> Lp_glpk_bindings.T.Vt.t G.return) G.result
val get_num_rows : (prob -> int G.return) G.result
val get_num_cols : (prob -> int G.return) G.result
val get_num_nz : (prob -> int G.return) G.result
val get_num_int : (prob -> int G.return) G.result
val get_num_bin : (prob -> int G.return) G.result
val init_smcp : (Lp_glpk_bindings.T.Smcp.t Ctypes.structure Ctypes_static.ptr -> unit G.return) G.result
val init_iocp : (Lp_glpk_bindings.T.Iocp.t Ctypes.structure Ctypes_static.ptr -> unit G.return) G.result
val simplex : (prob -> Lp_glpk_bindings.T.Smcp.t Ctypes.structure Ctypes_static.ptr -> int G.return) G.result
val intopt : (prob -> Lp_glpk_bindings.T.Iocp.t Ctypes.structure Ctypes_static.ptr -> int G.return) G.result
val get_obj_val : (prob -> float G.return) G.result
val mip_obj_val : (prob -> float G.return) G.result
val get_row_prim : (prob -> int -> float G.return) G.result
val get_row_dual : (prob -> int -> float G.return) G.result
val mip_row_val : (prob -> int -> float G.return) G.result
val get_col_prim : (prob -> int -> float G.return) G.result
val get_col_dual : (prob -> int -> float G.return) G.result
val mip_col_val : (prob -> int -> float G.return) G.result
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_ffi/index.html b/docs/lp-glpk/Lp_glpk_ffi/index.html new file mode 100644 index 0000000..aceab2c --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_ffi/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_ffi (lp-glpk.Lp_glpk_ffi)

Module Lp_glpk_ffi

module G : sig ... end
module M : sig ... end
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_ffi__G/.dune-keep b/docs/lp-glpk/Lp_glpk_ffi__G/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_ffi__G/index.html b/docs/lp-glpk/Lp_glpk_ffi__G/index.html new file mode 100644 index 0000000..c76e037 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_ffi__G/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_ffi__G (lp-glpk.Lp_glpk_ffi__G)

Module Lp_glpk_ffi__G

\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_ffi__M/.dune-keep b/docs/lp-glpk/Lp_glpk_ffi__M/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_ffi__M/index.html b/docs/lp-glpk/Lp_glpk_ffi__M/index.html new file mode 100644 index 0000000..4508ae7 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_ffi__M/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_ffi__M (lp-glpk.Lp_glpk_ffi__M)

Module Lp_glpk_ffi__M

\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/.dune-keep b/docs/lp-glpk/Lp_glpk_types/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_types/G/index.html b/docs/lp-glpk/Lp_glpk_types/G/index.html new file mode 100644 index 0000000..5a346dc --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/G/index.html @@ -0,0 +1,4 @@ + +G (lp-glpk.Lp_glpk_types.G)

Module Lp_glpk_types.G

include module type of struct include Ctypes end
type (!'a, !'b) pointer = ('a'b) Ctypes_static.pointer
type !'a ptr = ('a[ `C ]) pointer
type !'a ocaml = 'a Ctypes_static.ocaml
type !'a carray = 'a Ctypes_static.carray
type !'a bigarray_class = 'a Ctypes_static.bigarray_class
val genarray : < ba_repr : 'b; bigarray : ('a'b'l) Bigarray_compat.Genarray.t; carray : 'a carray; dims : int array; element : 'a; layout : 'l; > bigarray_class
val array1 : < ba_repr : 'b; bigarray : ('a'b'l) Bigarray_compat.Array1.t; carray : 'a carray; dims : int; element : 'a; layout : 'l; > bigarray_class
val array2 : < ba_repr : 'b; bigarray : ('a'b'l) Bigarray_compat.Array2.t; carray : 'a carray carray; dims : int * int; element : 'a; layout : 'l; > bigarray_class
val array3 : < ba_repr : 'b; bigarray : ('a'b'l) Bigarray_compat.Array3.t; carray : 'a carray carray carray; dims : int * int * int; element : 'a; layout : 'l; > bigarray_class
type (!'a, !'kind) structured = ('a'kind) Ctypes_static.structured
type !'a structure = ('a[ `Struct ]) structured
type !'a union = ('a[ `Union ]) structured
type (!'a, !'t) field = ('a't) Ctypes_static.field
type !'a abstract = 'a Ctypes_static.abstract
type !'a typ = 'a Ctypes_static.typ
val void : unit typ
val char : char typ
val schar : int typ
val short : int typ
val int : int typ
val long : Signed.long typ
val llong : Signed.llong typ
val nativeint : nativeint typ
val int8_t : int typ
val int16_t : int typ
val int32_t : int32 typ
val int64_t : int64 typ
module Intptr = Ctypes.Intptr
val intptr_t : Intptr.t typ
module Ptrdiff = Ctypes.Ptrdiff
val ptrdiff_t : Ptrdiff.t typ
val camlint : int typ
val uchar : Unsigned.uchar typ
val bool : bool typ
val uint8_t : Unsigned.uint8 typ
val uint16_t : Unsigned.uint16 typ
val uint32_t : Unsigned.uint32 typ
val uint64_t : Unsigned.uint64 typ
val size_t : Unsigned.size_t typ
val ushort : Unsigned.ushort typ
val sint : Signed.sint typ
val uint : Unsigned.uint typ
val ulong : Unsigned.ulong typ
val ullong : Unsigned.ullong typ
module Uintptr = Ctypes.Uintptr
val uintptr_t : Uintptr.t typ
val float : float typ
val double : float typ
val ldouble : LDouble.t typ
val complex32 : Stdlib.Complex.t typ
val complex64 : Stdlib.Complex.t typ
val complexld : ComplexL.t typ
val ptr : 'a typ -> 'a Ctypes_static.ptr typ
val ptr_opt : 'a typ -> 'a Ctypes_static.ptr option typ
val string : string typ
val string_opt : string option typ
val ocaml_string : string Ctypes_static.ocaml typ
val ocaml_bytes : bytes Ctypes_static.ocaml typ
val array : int -> 'a typ -> 'a Ctypes_static.carray typ
val bigarray : < ba_repr : 'b; bigarray : 'bigarray; carray : 'c; dims : 'dims; element : 'a; layout : Bigarray_compat.c_layout; > Ctypes_static.bigarray_class -> 'dims -> ('a'b) Bigarray_compat.kind -> 'bigarray typ
val fortran_bigarray : < ba_repr : 'b; bigarray : 'bigarray; carray : 'c; dims : 'dims; element : 'a; layout : Bigarray_compat.fortran_layout; > Ctypes_static.bigarray_class -> 'dims -> ('a'b) Bigarray_compat.kind -> 'bigarray typ
val typ_of_bigarray_kind : ('a'b) Bigarray_compat.kind -> 'a typ
val structure : string -> 's Ctypes_static.structure typ
val union : string -> 's Ctypes_static.union typ
val view : ?format_typ:((Stdlib.Format.formatter -> unit) -> Stdlib.Format.formatter -> unit) -> +?format:(Stdlib.Format.formatter -> 'b -> unit) -> read:('a -> 'b) -> write:('b -> 'a) -> +'a typ -> 'b typ
val typedef : 'a typ -> string -> 'a typ
val abstract : name:string -> size:int -> alignment:int -> 'a Ctypes_static.abstract typ
val lift_typ : 'a Ctypes_static.typ -> 'a typ
type !'a fn = 'a Ctypes_static.fn
val (@->) : 'a typ -> 'b fn -> ('a -> 'b) fn
val returning : 'a typ -> 'a fn
type !'a static_funptr = 'a Ctypes_static.static_funptr
val static_funptr : 'a fn -> 'a Ctypes_static.static_funptr typ
val sizeof : 'a typ -> int
val alignment : 'a typ -> int
val format_typ : ?name:string -> Stdlib.Format.formatter -> 'a typ -> unit
val format_fn : ?name:string -> Stdlib.Format.formatter -> 'a fn -> unit
val string_of_typ : ?name:string -> 'a typ -> string
val string_of_fn : ?name:string -> 'a fn -> string
val format : 'a typ -> Stdlib.Format.formatter -> 'a -> unit
val string_of : 'a typ -> 'a -> string
val null : unit ptr
val (!@) : 'a ptr -> 'a
val (<-@) : 'a ptr -> 'a -> unit
val (+@) : ('a'b) pointer -> int -> ('a'b) pointer
val (-@) : ('a'b) pointer -> int -> ('a'b) pointer
val ptr_diff : ('a'b) pointer -> ('a'b) pointer -> int
val from_voidp : 'a typ -> unit ptr -> 'a ptr
val to_voidp : 'a ptr -> unit ptr
val allocate : ?finalise:('a ptr -> unit) -> 'a typ -> 'a -> 'a ptr
val allocate_n : ?finalise:('a ptr -> unit) -> 'a typ -> count:int -> 'a ptr
val ptr_compare : 'a ptr -> 'a ptr -> int
val is_null : 'a ptr -> bool
val reference_type : 'a ptr -> 'a typ
val ptr_of_raw_address : nativeint -> unit ptr
val funptr_of_raw_address : nativeint -> (unit -> unit) Ctypes_static.static_funptr
val raw_address_of_ptr : unit ptr -> nativeint
val string_from_ptr : char ptr -> length:int -> string
val ocaml_string_start : string -> string ocaml
val ocaml_bytes_start : bytes -> bytes ocaml
module CArray = Ctypes.CArray
val bigarray_start : < ba_repr : 'c; bigarray : 'b; carray : 'd; dims : 'e; element : 'a; layout : 'l; > bigarray_class -> 'b -> 'a ptr
val bigarray_of_ptr : < ba_repr : 'f; bigarray : 'b; carray : 'c; dims : 'i; element : 'a; layout : Bigarray_compat.c_layout; > bigarray_class -> 'i -> ('a'f) Bigarray_compat.kind -> 'a ptr -> 'b
val fortran_bigarray_of_ptr : < ba_repr : 'f; bigarray : 'b; carray : 'c; dims : 'i; element : 'a; layout : Bigarray_compat.fortran_layout; > bigarray_class -> 'i -> ('a'f) Bigarray_compat.kind -> 'a ptr -> 'b
val array_of_bigarray : < ba_repr : 'a; bigarray : 'b; carray : 'c; dims : 'd; element : 'e; layout : Bigarray_compat.c_layout; > bigarray_class -> 'b -> 'c
val bigarray_of_array : < ba_repr : 'f; bigarray : 'b; carray : 'c carray; dims : 'i; element : 'a; layout : Bigarray_compat.c_layout; > bigarray_class -> ('a'f) Bigarray_compat.kind -> 'c carray -> 'b
val make : ?finalise:(('a'b) structured -> unit) -> ('a'b) structured typ -> ('a'b) structured
val setf : ('b'c) structured -> ('a('b'c) structured) field -> 'a -> unit
val getf : ('b'c) structured -> ('a('b'c) structured) field -> 'a
val (@.) : ('b'c) structured -> ('a('b'c) structured) field -> 'a ptr
val (|->) : ('b'c) structured ptr -> ('a('b'c) structured) field -> 'a ptr
val offsetof : ('a'b structure) field -> int
val field_type : ('a'b) field -> 'a typ
val field_name : ('a'b) field -> string
val addr : ('a'b) structured -> ('a'b) structured ptr
val coerce : 'a typ -> 'b typ -> 'a -> 'b
val coerce_fn : 'a fn -> 'b fn -> 'a -> 'b
module type FOREIGN = sig ... end
module type TYPE = sig ... end
module Root = Ctypes.Root
exception Unsupported of string
exception ModifyingSealedType of string
exception IncompleteType
type uncoercible_info = Ctypes.uncoercible_info
exception Uncoercible of uncoercible_info
val lift : 'a -> 'a
val field : t a. 't Ctypes_static.typ -> string -> 'a Ctypes_static.typ -> ('a't) Ctypes_static.field
val seal : a. 'a Ctypes_static.typ -> unit
type 'a const = 'a
val constant : string -> 't Ctypes_static.typ -> 't
val enum : string -> ?typedef:'b -> ?unexpected:'c -> ('a * int64) list -> 'd
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/G/module-type-FOREIGN/index.html b/docs/lp-glpk/Lp_glpk_types/G/module-type-FOREIGN/index.html new file mode 100644 index 0000000..4649999 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/G/module-type-FOREIGN/index.html @@ -0,0 +1,2 @@ + +FOREIGN (lp-glpk.Lp_glpk_types.G.FOREIGN)

Module type G.FOREIGN

type 'a fn
type 'a return
val (@->) : 'a typ -> 'b fn -> ('a -> 'b) fn
val returning : 'a typ -> 'a return fn
type 'a result
val foreign : string -> ('a -> 'b) fn -> ('a -> 'b) result
val foreign_value : string -> 'a typ -> 'a ptr result
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/G/module-type-TYPE/index.html b/docs/lp-glpk/Lp_glpk_types/G/module-type-TYPE/index.html new file mode 100644 index 0000000..40ded71 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/G/module-type-TYPE/index.html @@ -0,0 +1,5 @@ + +TYPE (lp-glpk.Lp_glpk_types.G.TYPE)

Module type G.TYPE

type 'a typ
val void : unit typ
val char : char typ
val schar : int typ
val short : int typ
val int : int typ
val long : Signed.long typ
val llong : Signed.llong typ
val nativeint : nativeint typ
val int8_t : int typ
val int16_t : int typ
val int32_t : int32 typ
val int64_t : int64 typ
module Intptr : Signed.S
val intptr_t : Intptr.t typ
module Ptrdiff : Signed.S
val ptrdiff_t : Ptrdiff.t typ
val camlint : int typ
val uchar : Unsigned.uchar typ
val bool : bool typ
val uint8_t : Unsigned.uint8 typ
val uint16_t : Unsigned.uint16 typ
val uint32_t : Unsigned.uint32 typ
val uint64_t : Unsigned.uint64 typ
val size_t : Unsigned.size_t typ
val ushort : Unsigned.ushort typ
val sint : Signed.sint typ
val uint : Unsigned.uint typ
val ulong : Unsigned.ulong typ
val ullong : Unsigned.ullong typ
module Uintptr : Unsigned.S
val uintptr_t : Uintptr.t typ
val float : float typ
val double : float typ
val ldouble : LDouble.t typ
val complex32 : Stdlib.Complex.t typ
val complex64 : Stdlib.Complex.t typ
val complexld : ComplexL.t typ
val ptr : 'a typ -> 'a Ctypes_static.ptr typ
val ptr_opt : 'a typ -> 'a Ctypes_static.ptr option typ
val string : string typ
val string_opt : string option typ
val ocaml_string : string Ctypes_static.ocaml typ
val ocaml_bytes : bytes Ctypes_static.ocaml typ
val array : int -> 'a typ -> 'a Ctypes_static.carray typ
val bigarray : < ba_repr : 'b; bigarray : 'bigarray; carray : 'c; dims : 'dims; element : 'a; layout : Bigarray_compat.c_layout; > Ctypes_static.bigarray_class -> 'dims -> ('a'b) Bigarray_compat.kind -> 'bigarray typ
val fortran_bigarray : < ba_repr : 'b; bigarray : 'bigarray; carray : 'c; dims : 'dims; element : 'a; layout : Bigarray_compat.fortran_layout; > Ctypes_static.bigarray_class -> 'dims -> ('a'b) Bigarray_compat.kind -> 'bigarray typ
val typ_of_bigarray_kind : ('a'b) Bigarray_compat.kind -> 'a typ
type ('a, 't) field
val structure : string -> 's Ctypes_static.structure typ
val union : string -> 's Ctypes_static.union typ
val field : ('s[< `Struct | `Union ] as 'b) Ctypes_static.structured typ -> string -> 'a typ -> ('a('s'b) Ctypes_static.structured) field
val seal : ('a[< `Struct | `Union ]) Ctypes_static.structured typ -> unit
val view : ?format_typ:((Stdlib.Format.formatter -> unit) -> Stdlib.Format.formatter -> unit) -> +?format:(Stdlib.Format.formatter -> 'b -> unit) -> read:('a -> 'b) -> write:('b -> 'a) -> +'a typ -> 'b typ
val typedef : 'a typ -> string -> 'a typ
val abstract : name:string -> size:int -> alignment:int -> 'a Ctypes_static.abstract typ
val lift_typ : 'a Ctypes_static.typ -> 'a typ
type !'a fn = 'a Ctypes_static.fn
val (@->) : 'a typ -> 'b fn -> ('a -> 'b) fn
val returning : 'a typ -> 'a fn
type !'a static_funptr = 'a Ctypes_static.static_funptr
val static_funptr : 'a fn -> 'a Ctypes_static.static_funptr typ
type 'a const
val constant : string -> 'a typ -> 'a const
val enum : string -> ?typedef:bool -> ?unexpected:(int64 -> 'a) -> +('a * int64 const) list -> 'a typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Bnd/index.html b/docs/lp-glpk/Lp_glpk_types/M/Bnd/index.html new file mode 100644 index 0000000..f4931b2 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Bnd/index.html @@ -0,0 +1,2 @@ + +Bnd (lp-glpk.Lp_glpk_types.M.Bnd)

Module M.Bnd

type t = Lp_glpk_bindings_types.M(G).Bnd.t =
| FR
| LO
| UP
| DB
| FX
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/BoolInt/index.html b/docs/lp-glpk/Lp_glpk_types/M/BoolInt/index.html new file mode 100644 index 0000000..9df61d4 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/BoolInt/index.html @@ -0,0 +1,2 @@ + +BoolInt (lp-glpk.Lp_glpk_types.M.BoolInt)

Module M.BoolInt

val of_int : int Lp_glpk_consts.G.const -> bool
val to_int : bool -> int Lp_glpk_consts.G.const
val t : bool G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Dir/index.html b/docs/lp-glpk/Lp_glpk_types/M/Dir/index.html new file mode 100644 index 0000000..a2a2b35 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Dir/index.html @@ -0,0 +1,2 @@ + +Dir (lp-glpk.Lp_glpk_types.M.Dir)

Module M.Dir

type t = Lp_glpk_bindings_types.M(G).Dir.t =
| MIN
| MAX
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Iocp/Br/index.html b/docs/lp-glpk/Lp_glpk_types/M/Iocp/Br/index.html new file mode 100644 index 0000000..3e4b40c --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Iocp/Br/index.html @@ -0,0 +1,2 @@ + +Br (lp-glpk.Lp_glpk_types.M.Iocp.Br)

Module Iocp.Br

type t = Lp_glpk_bindings_types.M(G).Iocp.Br.t =
| FFV
| LFV
| MFV
| DTH
| PCH
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Iocp/Bt/index.html b/docs/lp-glpk/Lp_glpk_types/M/Iocp/Bt/index.html new file mode 100644 index 0000000..ed1dab3 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Iocp/Bt/index.html @@ -0,0 +1,2 @@ + +Bt (lp-glpk.Lp_glpk_types.M.Iocp.Bt)

Module Iocp.Bt

type t = Lp_glpk_bindings_types.M(G).Iocp.Bt.t =
| DFS
| BFS
| BLB
| BPH
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Iocp/Pp/index.html b/docs/lp-glpk/Lp_glpk_types/M/Iocp/Pp/index.html new file mode 100644 index 0000000..d9c523a --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Iocp/Pp/index.html @@ -0,0 +1,2 @@ + +Pp (lp-glpk.Lp_glpk_types.M.Iocp.Pp)

Module Iocp.Pp

type t = Lp_glpk_bindings_types.M(G).Iocp.Pp.t =
| NONE
| ROOT
| ALL
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Iocp/index.html b/docs/lp-glpk/Lp_glpk_types/M/Iocp/index.html new file mode 100644 index 0000000..553f9b2 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Iocp/index.html @@ -0,0 +1,2 @@ + +Iocp (lp-glpk.Lp_glpk_types.M.Iocp)

Module M.Iocp

module Br : sig ... end
module Bt : sig ... end
module Pp : sig ... end
val t : t Ctypes.structure G.typ
val msg_lev : (Msg.tt Ctypes.structure) G.field
val br_tech : (Br.tt Ctypes.structure) G.field
val bt_tech : (Bt.tt Ctypes.structure) G.field
val tol_int : (float, t Ctypes.structure) G.field
val tol_obj : (float, t Ctypes.structure) G.field
val tm_lim : (int, t Ctypes.structure) G.field
val out_frq : (int, t Ctypes.structure) G.field
val out_dly : (int, t Ctypes.structure) G.field
val cb_func : (unit Ctypes_static.ptrt Ctypes.structure) G.field
val cb_info : (unit Ctypes_static.ptrt Ctypes.structure) G.field
val cb_size : (int, t Ctypes.structure) G.field
val pp_tech : (Pp.tt Ctypes.structure) G.field
val mip_gap : (float, t Ctypes.structure) G.field
val mir_cuts : (bool, t Ctypes.structure) G.field
val gmi_cuts : (bool, t Ctypes.structure) G.field
val cov_cuts : (bool, t Ctypes.structure) G.field
val clq_cuts : (bool, t Ctypes.structure) G.field
val presolve : (bool, t Ctypes.structure) G.field
val binarize : (bool, t Ctypes.structure) G.field
val fp_heur : (bool, t Ctypes.structure) G.field
val ps_heur : (bool, t Ctypes.structure) G.field
val ps_tm_lim : (int, t Ctypes.structure) G.field
val sr_heur : (bool, t Ctypes.structure) G.field
val use_sol : (bool, t Ctypes.structure) G.field
val save_sol : (string, t Ctypes.structure) G.field
val alien : (bool, t Ctypes.structure) G.field
val flip : (bool, t Ctypes.structure) G.field
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Msg/index.html b/docs/lp-glpk/Lp_glpk_types/M/Msg/index.html new file mode 100644 index 0000000..5d726c6 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Msg/index.html @@ -0,0 +1,2 @@ + +Msg (lp-glpk.Lp_glpk_types.M.Msg)

Module M.Msg

type t = Lp_glpk_bindings_types.M(G).Msg.t =
| OFF
| ERR
| ON
| ALL
| DBG
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Smcp/An/index.html b/docs/lp-glpk/Lp_glpk_types/M/Smcp/An/index.html new file mode 100644 index 0000000..a099fd0 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Smcp/An/index.html @@ -0,0 +1,2 @@ + +An (lp-glpk.Lp_glpk_types.M.Smcp.An)

Module Smcp.An

val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Smcp/Meth/index.html b/docs/lp-glpk/Lp_glpk_types/M/Smcp/Meth/index.html new file mode 100644 index 0000000..783271b --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Smcp/Meth/index.html @@ -0,0 +1,2 @@ + +Meth (lp-glpk.Lp_glpk_types.M.Smcp.Meth)

Module Smcp.Meth

type t = Lp_glpk_bindings_types.M(G).Smcp.Meth.t =
| PRIMAL
| DUALP
| DUAL
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Smcp/Pt/index.html b/docs/lp-glpk/Lp_glpk_types/M/Smcp/Pt/index.html new file mode 100644 index 0000000..07b342c --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Smcp/Pt/index.html @@ -0,0 +1,2 @@ + +Pt (lp-glpk.Lp_glpk_types.M.Smcp.Pt)

Module Smcp.Pt

val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Smcp/Rt/index.html b/docs/lp-glpk/Lp_glpk_types/M/Smcp/Rt/index.html new file mode 100644 index 0000000..deb4f31 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Smcp/Rt/index.html @@ -0,0 +1,2 @@ + +Rt (lp-glpk.Lp_glpk_types.M.Smcp.Rt)

Module Smcp.Rt

type t = Lp_glpk_bindings_types.M(G).Smcp.Rt.t =
| STD
| HAR
| FLIP
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Smcp/index.html b/docs/lp-glpk/Lp_glpk_types/M/Smcp/index.html new file mode 100644 index 0000000..8bd6ddd --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Smcp/index.html @@ -0,0 +1,2 @@ + +Smcp (lp-glpk.Lp_glpk_types.M.Smcp)

Module M.Smcp

module Meth : sig ... end
module Pt : sig ... end
module Rt : sig ... end
module An : sig ... end
val t : t Ctypes.structure G.typ
val msg_lev : (Msg.tt Ctypes.structure) G.field
val meth : (Meth.tt Ctypes.structure) G.field
val pricing : (Pt.tt Ctypes.structure) G.field
val r_test : (Rt.tt Ctypes.structure) G.field
val tol_bnd : (float, t Ctypes.structure) G.field
val tol_dj : (float, t Ctypes.structure) G.field
val tol_piv : (float, t Ctypes.structure) G.field
val obj_ll : (float, t Ctypes.structure) G.field
val obj_ul : (float, t Ctypes.structure) G.field
val it_lim : (int, t Ctypes.structure) G.field
val tm_lim : (int, t Ctypes.structure) G.field
val out_frq : (int, t Ctypes.structure) G.field
val out_dly : (int, t Ctypes.structure) G.field
val presolve : (bool, t Ctypes.structure) G.field
val excl : (bool, t Ctypes.structure) G.field
val shift : (bool, t Ctypes.structure) G.field
val aorn : (An.tt Ctypes.structure) G.field
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Stat/index.html b/docs/lp-glpk/Lp_glpk_types/M/Stat/index.html new file mode 100644 index 0000000..6cf1fd7 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Stat/index.html @@ -0,0 +1,2 @@ + +Stat (lp-glpk.Lp_glpk_types.M.Stat)

Module M.Stat

type t = Lp_glpk_bindings_types.M(G).Stat.t =
| UNDEF
| FEAS
| INFEAS
| NOFEAS
| OPT
| UNBND
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val to_string : t -> string
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/Vt/index.html b/docs/lp-glpk/Lp_glpk_types/M/Vt/index.html new file mode 100644 index 0000000..6556b8d --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/Vt/index.html @@ -0,0 +1,2 @@ + +Vt (lp-glpk.Lp_glpk_types.M.Vt)

Module M.Vt

type t = Lp_glpk_bindings_types.M(G).Vt.t =
| CV
| IV
| BV
val of_int : int Lp_glpk_consts.G.const -> t
val to_int : t -> int Lp_glpk_consts.G.const
val t : t G.typ
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/M/index.html b/docs/lp-glpk/Lp_glpk_types/M/index.html new file mode 100644 index 0000000..86d009c --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/M/index.html @@ -0,0 +1,2 @@ + +M (lp-glpk.Lp_glpk_types.M)

Module Lp_glpk_types.M

module Dir : sig ... end
module Vt : sig ... end
module Bnd : sig ... end
module Stat : sig ... end
module BoolInt : sig ... end
module Msg : sig ... end
module Smcp : sig ... end
module Iocp : sig ... end
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types/index.html b/docs/lp-glpk/Lp_glpk_types/index.html new file mode 100644 index 0000000..9061f80 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_types (lp-glpk.Lp_glpk_types)

Module Lp_glpk_types

module G : sig ... end
module M : sig ... end
\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types__G/.dune-keep b/docs/lp-glpk/Lp_glpk_types__G/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_types__G/index.html b/docs/lp-glpk/Lp_glpk_types__G/index.html new file mode 100644 index 0000000..1947abb --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types__G/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_types__G (lp-glpk.Lp_glpk_types__G)

Module Lp_glpk_types__G

\ No newline at end of file diff --git a/docs/lp-glpk/Lp_glpk_types__M/.dune-keep b/docs/lp-glpk/Lp_glpk_types__M/.dune-keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/lp-glpk/Lp_glpk_types__M/index.html b/docs/lp-glpk/Lp_glpk_types__M/index.html new file mode 100644 index 0000000..56ef8f3 --- /dev/null +++ b/docs/lp-glpk/Lp_glpk_types__M/index.html @@ -0,0 +1,2 @@ + +Lp_glpk_types__M (lp-glpk.Lp_glpk_types__M)

Module Lp_glpk_types__M

\ No newline at end of file diff --git a/docs/lp-glpk/index.html b/docs/lp-glpk/index.html index 20dd573..11b6781 100644 --- a/docs/lp-glpk/index.html +++ b/docs/lp-glpk/index.html @@ -1,2 +1,2 @@ -index (lp-glpk.index)

lp-glpk index

Library lp-glpk

This library exposes the following toplevel modules:

  • Lp_glp Raw ctypes binding to GLPK.
  • Lp_glpk High-level interface to GLPK.
\ No newline at end of file +index (lp-glpk.index)

lp-glpk index

Library lp-glpk

The entry point of this library is the module: Lp_glpk.

Library lp-glpk.bindings

The entry point of this library is the module: Lp_glpk_bindings.

Library lp-glpk.bindings.consts

The entry point of this library is the module: Lp_glpk_bindings_consts.

Library lp-glpk.bindings.types

The entry point of this library is the module: Lp_glpk_bindings_types.

Library lp-glpk.consts

The entry point of this library is the module: Lp_glpk_consts.

Library lp-glpk.ffi

The entry point of this library is the module: Lp_glpk_ffi.

Library lp-glpk.types

The entry point of this library is the module: Lp_glpk_types.

\ No newline at end of file diff --git a/src/lp-glpk/lib/dune b/src/lp-glpk/lib/dune index ad4f9c2..819841e 100644 --- a/src/lp-glpk/lib/dune +++ b/src/lp-glpk/lib/dune @@ -1,5 +1,4 @@ (library (name lp_glpk) (public_name lp-glpk) - (wrapped false) (libraries lp lp-glpk.ffi lp-glpk.types ctypes))