Lp_glpk_jsInterface to GLPK via glpk.js.
class type var = object ... endJS type for variable
class type row_bound = object ... endJS type for row (constraint) bound
class type col_bound = object ... endJS type for column (variable) bound
class type objective = object ... endJS type for objective
class type options = object ... endJS type for solver options
class type cnstr = object ... endJS type for constraints
class type prob = object ... endJS type for problem
class type res = object ... endJS type for result content
class type result = object ... endJS type for optimization result
class type glpk = object ... endmain glpk.js interface object
val require_glpk : string -> glpk Js_of_ocaml.Js.trequire and instantiate glpk.js interface given by a string identifier. let glpk = require_glpk "glpk.js" is roughly equivalent to following JS.
var GLPK = require("glpk.js");
var glpk = GLPK();For glpk.js 5.x (async constructor), this function raises Failure and require_glpk_async must be used.
val require_glpk_async :
?on_error:(Js_of_ocaml.Js.Unsafe.any -> unit) ->
string ->
(glpk Js_of_ocaml.Js.t -> unit) ->
unitrequire and instantiate glpk.js asynchronously using callbacks. This supports both legacy synchronous modules (glpk.js 4.x) and async modules (glpk.js 5.x). If the constructor is synchronous, on_ready is called immediately.
val solve :
?term_output:bool ->
glpk Js_of_ocaml.Js.t ->
Lp.Problem.t ->
(float * float Lp.PMap.t, string) Stdlib.resultSolve the problem using GLPK via glpk.js. GLPK can solve only linear problems (LP or MILP). glpk.js interface object (glpk Js.t) must be given, that can be built with require_glpk_async or require_glpk. If glpk.solve is asynchronous (e.g. glpk.js 5.x browser entry), this function returns Error and solve_async should be used.
val solve_async :
?on_error:(Js_of_ocaml.Js.Unsafe.any -> unit) ->
?term_output:bool ->
glpk Js_of_ocaml.Js.t ->
Lp.Problem.t ->
((float * float Lp.PMap.t, string) Stdlib.result -> unit) ->
unitSolve the problem with callback-based async support. Works with both synchronous and Promise-based glpk.solve.