package lp

  1. Overview
  2. Docs

Module LpSource

top module of package Lp

Sourcemodule Var : sig ... end
Sourcemodule Term : sig ... end
Sourcemodule Poly : sig ... end

Module for polynomial expression type

Sourcemodule Cnstr : sig ... end
Sourcemodule Obj : sig ... end
Sourcemodule Problem : sig ... end
Sourcemodule Pclass = Problem.Pclass
Sourceval c : float -> Poly.t

Make monomial of a constant value

Sourceval var : ?integer:bool -> ?lb:float -> ?ub:float -> string -> Poly.t

Make monomial of a variable

Sourceval binary : string -> Poly.t

Make monomial of a binary variable

Sourceval range : ?integer:bool -> ?lb:float -> ?ub:float -> ?start:int -> int -> string -> Poly.t array

Make an array of monomials of a variable

Sourceval range2 : ?integer:bool -> ?lb:float -> ?ub:float -> ?start0:int -> ?start1:int -> int -> int -> string -> Poly.t array array

Make 2D array of monomials of a variable

Sourceval range3 : ?integer:bool -> ?lb:float -> ?ub:float -> ?start0:int -> ?start1:int -> ?start2:int -> int -> int -> int -> string -> Poly.t array array array

Make 3D array of monomials of a variable

Sourceval rangeb : ?start:int -> int -> string -> Poly.t array

Make an array of monomials of a binary variable

Sourceval range2b : ?start0:int -> ?start1:int -> int -> int -> string -> Poly.t array array

Make 2D array of monomials of a binary variable

Sourceval range3b : ?start0:int -> ?start1:int -> ?start2:int -> int -> int -> int -> string -> Poly.t array array array

Make 3D array of monomials of a binary variable

Sourceval rangev : ?integer:bool -> ?lb:float array -> ?ub:float array -> ?start:int -> int -> string -> Poly.t array

Make an array of monomials of a variable with different bounds

Sourceval range2v : ?integer:bool -> ?lb:float array array -> ?ub:float array array -> ?start0:int -> ?start1:int -> int -> int -> string -> Poly.t array array

Make 2D array of monomials of a variable with different bounds

Sourceval range3v : ?integer:bool -> ?lb:float array array array -> ?ub:float array array array -> ?start0:int -> ?start1:int -> ?start2:int -> int -> int -> int -> string -> Poly.t array array array

Make 3D array of monomials of a variable with different bounds

Sourceval concat : Poly.t array -> Poly.t

Concatenate an array of polynomials into single polynomial

Sourceval of_float_array : float array -> Poly.t

Convert a float array into a polynomial

Sourceval zero : Poly.t

Constant zero

Sourceval one : Poly.t

Constant one

Sourceval (~--) : Poly.t -> Poly.t

Negate the whole polynomial

Sourceval (++) : Poly.t -> Poly.t -> Poly.t

Add (concatenate) two polynomials

Sourceval (--) : Poly.t -> Poly.t -> Poly.t

Subtract two polynomials (concatenate left with negated right )

Sourceval expand : Poly.t -> Poly.t -> Poly.t

Multiply two polynomials. specifically, performs polynomial expansion.

Sourceval (*~) : Poly.t -> Poly.t -> Poly.t

Multiply two polynomials. specifically, performs polynomial expansion.

Sourceval dot : Poly.t -> Poly.t -> Poly.t

Regard two polynomials as vectors and take dot product.

Sourceval (*@) : Poly.t -> Poly.t -> Poly.t

Regard two polynomials as vectors and take dot product.

Sourceval div : Poly.t -> Poly.t -> Poly.t

Divide polynomial by a univariate polynomial. Be careful as this function raises exception in following cases.

    Sourceval (/~) : Poly.t -> Poly.t -> Poly.t

    Equivalent to div

    Sourceval eq : ?name:string -> Poly.t -> Poly.t -> Lp__.Constraint.t

    Build an equality constraint. Optinal name can be given. Polynomials are simplified on build.

    Sourceval (=~) : Poly.t -> Poly.t -> Lp__.Constraint.t

    Build an unnamed equality constraint. Polynomials are simplified on build.

    Sourceval lt : ?name:string -> Poly.t -> Poly.t -> Lp__.Constraint.t

    Build an inequality constraint. Optinal name can be given. Polynomials are simplified on build.

    Sourceval (<~) : Poly.t -> Poly.t -> Lp__.Constraint.t

    Build an unnamed inequality constraint. Polynomials are simplified on build.

    Sourceval gt : ?name:string -> Poly.t -> Poly.t -> Lp__.Constraint.t

    Build an inequality constraint. Optinal name can be given. Polynomials are simplified on build.

    Sourceval (>~) : Poly.t -> Poly.t -> Lp__.Constraint.t

    Build an unnamed inequality constraint. Polynomials are simplified on build.

    Sourceval maximize : Poly.t -> Lp__.Objective.t

    Build an objective to maximize a polynomial. The polynomial is simplified on build.

    Sourceval minimize : Poly.t -> Lp__.Objective.t

    Build an objective to minimize a polynomial. The polynomial is simplified on build.

    Sourceval validate : Problem.t -> bool

    Validate the problem

    Sourceval classify : Problem.t -> Pclass.t

    Classify the problem into Pclass

    Sourceval vname_list : Problem.t -> string list

    Make (unique and sorted) list of the variables in a problem.

    Sourceval to_string : ?short:bool -> Problem.t -> string

    Express the problem in LP file format string

    Sourceval of_string : string -> Problem.t

    Parse an LP file format string to build the problem

    Sourceval write : ?short:bool -> string -> Problem.t -> unit

    write fname problem writes out problem to an LP file fname

    Sourceval read : string -> Problem.t

    Parse an LP file to build the problem