package lp

  1. Overview
  2. Docs

Module for the optimization problem (model).

module Pclass : sig ... end

Module for the optimization problem class.

module Vars : sig ... end
type t

Type for an optimization problem (model).

val make : ?name:string -> Objective.t -> Cnstr.t list -> t

Make problem from an Objective.t and a constraint (Cnstr.t) list. String name can be given optionally.

val name : t -> string option

Get name of the problem.

val objective : t -> Objective.t

Take Objective.t of the problem.

val cnstrs : t -> Cnstr.t list

Take constraint (Cnstr.t) list of the problem.

val obj_cnstrs : t -> Objective.t * Cnstr.t list

Get problem content as a pair of Objective.t and constraint (Cnstr.t) list.

val take_vars : t -> Var.t list

Make list of the variables in the problem.

val uniq_vars : t -> Var.t list

Make list of variables with unique names in the problem.

val uniq_vars_struct : t -> Var.t list

Make list of variables with unique structure (name and attributes) in the problem.

val collision : t -> bool

Check whether a collision (a variable with same name but different attributes) exists in the problem.

val vname_list : t -> string list

Make list of (unique) variable names in the problem.

val classify : t -> Pclass.t

Classify the problem into Pclass.t.

val validate : t -> bool

Validate the problem. true (false) means the problem is valid (invalid).

val to_string : ?short:bool -> t -> string

Express the problem in LP file format string.

OCaml

Innovation. Community. Security.