package lp

  1. Overview
  2. Docs

Module Lp.CnstrSource

Module for the constraint.

Sourcetype t

Type for an equality or inequality constraint.

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

Get string expression (LP file format) of the constraint.

Sourceval take_vars : t -> Var.t list

Make list of the variables in a constraint.

Sourceval degree : t -> int

Get degree of a constraint.

Sourceval constant : t -> bool

Check if the constraint is constant (no variable), and then invalid.

Sourceval eq : ?eps:float -> ?name:string -> Poly.t -> Poly.t -> t

Build an equality constraint. Optional name can be given. Polynomials are simplified (Poly.simplify) on build. eps specifies the threshold of near-zero, defaulting to 10. *. epsilon_float.

Sourceval lt : ?eps:float -> ?name:string -> Poly.t -> Poly.t -> t

Build an inequality constraint. Optional name can be given. Polynomials are simplified (Poly.simplify) on build. eps specifies the threshold of near-zero, defaulting to 10. *. epsilon_float.

Sourceval gt : ?eps:float -> ?name:string -> Poly.t -> Poly.t -> t

Build an inequality constraint. Optional name can be given. Polynomials are simplified (Poly.simplify) on build. eps specifies the threshold of near-zero, defaulting to 10. *. epsilon_float.

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

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

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

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

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

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

Sourceval lhs : t -> Poly.t

Take left hand side (polynomial) of a constraint.

Sourceval rhs : t -> float

Take right hand side (float) of a constraint.

Sourceval sides : t -> Poly.t * float

Take pair of lhs and rhs of a constraint.

Sourceval name : t -> string

Take name of constraint. An empty string ("") is returned if it is unnamed.

Sourceval is_eq : t -> bool

True (false) if the constraint is of equality (inequality).

Sourceval with_bound : string -> float -> float -> t -> t

with_bound name lb ub transforms the bounds of the variable name with lb and ub.

Sourceval to_integer : string -> t -> t

to_integer name transforms the variable name into general integer variable.

Sourceval to_binary : string -> t -> t

to_binary name transforms the variable name into binary variable.

OCaml

Innovation. Community. Security.