From 993f903ee7689537c9021959bda93da079de5943 Mon Sep 17 00:00:00 2001 From: Halbaroth Date: Wed, 11 Dec 2024 12:46:17 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20OCamlPro?= =?UTF-8?q?/ocplib-simplex@0d52396b495b0c9cd6f2b91041a4cf83704c3353=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssertBounds/Make/argument-1-Core/Ex/index.html | 2 +- .../AssertBounds/Make/argument-1-Core/MX/index.html | 2 +- .../AssertBounds/Make/argument-1-Core/P/index.html | 2 +- .../AssertBounds/Make/argument-1-Core/R/index.html | 2 +- .../AssertBounds/Make/argument-1-Core/R2/index.html | 2 +- .../AssertBounds/Make/argument-1-Core/SX/index.html | 2 +- .../AssertBounds/Make/argument-1-Core/V/index.html | 2 +- .../AssertBounds/Make/argument-1-Core/Var/index.html | 2 +- .../OcplibSimplex/AssertBounds/Make/argument-1-Core/index.html | 2 +- ocplib-simplex/OcplibSimplex/AssertBounds/Make/index.html | 2 +- ocplib-simplex/OcplibSimplex/AssertBounds/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/Core/Ex/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/Core/MX/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/Core/P/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/Core/R/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/Core/R2/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/Core/SX/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/Core/V/index.html | 2 +- .../AssertBounds/module-type-S/Core/Var/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/Core/index.html | 2 +- .../OcplibSimplex/AssertBounds/module-type-S/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Assert/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Core/MX/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Core/P/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Core/R/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Core/R2/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Core/SX/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Core/V/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Core/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Result/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/Solve/index.html | 2 +- .../OcplibSimplex/Basic/Make/argument-1-Var/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/argument-2-R/index.html | 2 +- .../OcplibSimplex/Basic/Make/argument-3-Ex/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/Make/index.html | 2 +- ocplib-simplex/OcplibSimplex/Basic/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/MX/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/P/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/R/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/R2/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/SX/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/V/index.html | 2 +- .../OcplibSimplex/Core/Make/argument-1-Var/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/argument-2-R/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/argument-3-Ex/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/Make/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/MakeExpert/R2/index.html | 2 +- .../OcplibSimplex/Core/MakeExpert/argument-1-Var/index.html | 2 +- .../OcplibSimplex/Core/MakeExpert/argument-2-R/index.html | 2 +- .../OcplibSimplex/Core/MakeExpert/argument-3-V/index.html | 2 +- .../OcplibSimplex/Core/MakeExpert/argument-4-Ex/index.html | 2 +- .../OcplibSimplex/Core/MakeExpert/argument-5-R2/index.html | 2 +- .../OcplibSimplex/Core/MakeExpert/argument-6-P/index.html | 2 +- .../OcplibSimplex/Core/MakeExpert/argument-7-MX/index.html | 2 +- .../OcplibSimplex/Core/MakeExpert/argument-8-SX/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/MakeExpert/index.html | 2 +- ocplib-simplex/OcplibSimplex/Core/index.html | 2 +- ocplib-simplex/OcplibSimplex/CoreSig/index.html | 2 +- .../OcplibSimplex/CoreSig/module-type-S/Ex/index.html | 2 +- .../OcplibSimplex/CoreSig/module-type-S/MX/index.html | 2 +- ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/P/index.html | 2 +- ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R/index.html | 2 +- .../OcplibSimplex/CoreSig/module-type-S/R2/index.html | 2 +- .../OcplibSimplex/CoreSig/module-type-S/SX/index.html | 2 +- ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/V/index.html | 2 +- .../OcplibSimplex/CoreSig/module-type-S/Var/index.html | 2 +- ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/index.html | 2 +- ocplib-simplex/OcplibSimplex/ExtSigs/index.html | 2 +- .../OcplibSimplex/ExtSigs/module-type-Coefs/index.html | 2 +- .../OcplibSimplex/ExtSigs/module-type-Explanations/index.html | 2 +- .../OcplibSimplex/ExtSigs/module-type-MapSig/index.html | 2 +- .../OcplibSimplex/ExtSigs/module-type-Rationals/index.html | 2 +- .../OcplibSimplex/ExtSigs/module-type-SetSig/index.html | 2 +- .../OcplibSimplex/ExtSigs/module-type-Value/index.html | 2 +- .../OcplibSimplex/ExtSigs/module-type-Variables/index.html | 2 +- .../OcplibSimplex/Polys/Make/argument-1-Var/index.html | 2 +- ocplib-simplex/OcplibSimplex/Polys/Make/argument-2-R/index.html | 2 +- ocplib-simplex/OcplibSimplex/Polys/Make/index.html | 2 +- ocplib-simplex/OcplibSimplex/Polys/index.html | 2 +- ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/R/index.html | 2 +- .../OcplibSimplex/Polys/module-type-SIG/Var/index.html | 2 +- ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/index.html | 2 +- ocplib-simplex/OcplibSimplex/Rat2/Make/argument-1-R/index.html | 2 +- ocplib-simplex/OcplibSimplex/Rat2/Make/argument-2-V/index.html | 2 +- ocplib-simplex/OcplibSimplex/Rat2/Make/index.html | 2 +- ocplib-simplex/OcplibSimplex/Rat2/index.html | 2 +- ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/R/index.html | 2 +- ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/V/index.html | 2 +- ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/Ex/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/MX/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/P/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/R/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/R2/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/SX/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/V/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/Var/index.html | 2 +- .../OcplibSimplex/Result/Make/argument-1-Core/index.html | 2 +- ocplib-simplex/OcplibSimplex/Result/Make/index.html | 2 +- ocplib-simplex/OcplibSimplex/Result/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/Ex/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/MX/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/P/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/R/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/R2/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/SX/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/V/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/Var/index.html | 2 +- .../OcplibSimplex/Result/module-type-S/Core/index.html | 2 +- ocplib-simplex/OcplibSimplex/Result/module-type-S/index.html | 2 +- .../SolveBounds/Make/argument-1-Core/Ex/index.html | 2 +- .../SolveBounds/Make/argument-1-Core/MX/index.html | 2 +- .../OcplibSimplex/SolveBounds/Make/argument-1-Core/P/index.html | 2 +- .../OcplibSimplex/SolveBounds/Make/argument-1-Core/R/index.html | 2 +- .../SolveBounds/Make/argument-1-Core/R2/index.html | 2 +- .../SolveBounds/Make/argument-1-Core/SX/index.html | 2 +- .../OcplibSimplex/SolveBounds/Make/argument-1-Core/V/index.html | 2 +- .../SolveBounds/Make/argument-1-Core/Var/index.html | 2 +- .../OcplibSimplex/SolveBounds/Make/argument-1-Core/index.html | 2 +- ocplib-simplex/OcplibSimplex/SolveBounds/Make/index.html | 2 +- ocplib-simplex/OcplibSimplex/SolveBounds/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/Ex/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/MX/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/P/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/R/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/R2/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/SX/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/V/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/Var/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/Core/index.html | 2 +- .../OcplibSimplex/SolveBounds/module-type-S/index.html | 2 +- ocplib-simplex/OcplibSimplex/Version/index.html | 2 +- ocplib-simplex/OcplibSimplex/index.html | 2 +- ocplib-simplex/index.html | 2 +- odoc.support/odoc.css | 2 +- 135 files changed, 135 insertions(+), 135 deletions(-) diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/Ex/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/Ex/index.html index b13fdbe..2ae2ccd 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/MX/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/MX/index.html index 14e34ec..3f0dec9 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/P/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/P/index.html index f3763e0..33cb494 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/P/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/R/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/R/index.html index 84f40f0..a6afb65 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/R/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/R2/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/R2/index.html index 8b70492..12ecb11 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/SX/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/SX/index.html index 2c0a842..0bf89bf 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/V/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/V/index.html index 4f51ca6..321f78b 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/V/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/Var/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/Var/index.html index 2399d55..456a14f 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/Var/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/index.html index f1e2b67..a2fe643 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/argument-1-Core/index.html @@ -1,2 +1,2 @@ -Core (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core)

Parameter Make.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+Core (ocplib-simplex.OcplibSimplex.AssertBounds.Make.Core)

Parameter Make.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/index.html index 3816c89..d3da432 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/Make/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/Make/index.html @@ -1,5 +1,5 @@ -Make (ocplib-simplex.OcplibSimplex.AssertBounds.Make)

Module AssertBounds.Make

Parameters

module Core : CoreSig.S

Signature

module Core = Core
val var : +Make (ocplib-simplex.OcplibSimplex.AssertBounds.Make)

Module AssertBounds.Make

Parameters

module Core : CoreSig.S

Signature

module Core = Core
val var : Core.t -> ?min:Core.bound -> ?max:Core.bound -> diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/index.html index de25882..c543a46 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/index.html @@ -1,2 +1,2 @@ -AssertBounds (ocplib-simplex.OcplibSimplex.AssertBounds)

Module OcplibSimplex.AssertBounds

module type S = sig ... end
module Make (Core : CoreSig.S) : S with module Core = Core
+AssertBounds (ocplib-simplex.OcplibSimplex.AssertBounds)

Module OcplibSimplex.AssertBounds

module type S = sig ... end
module Make (Core : CoreSig.S) : S with module Core = Core
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/Ex/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/Ex/index.html index f88dca8..00cb3d7 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/MX/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/MX/index.html index 3dd808b..69cd606 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/P/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/P/index.html index 6c0f2b5..6291608 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/P/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/R/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/R/index.html index 7623b25..dd1164e 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/R/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/R2/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/R2/index.html index 973250d..65ccd2e 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/SX/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/SX/index.html index 3014c8b..c3be373 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/V/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/V/index.html index c06a88f..718cf30 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/V/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/Var/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/Var/index.html index 00ad34e..0d7f835 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/Var/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/index.html index d962d8b..f433f6b 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/Core/index.html @@ -1,2 +1,2 @@ -Core (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core)

Module S.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+Core (ocplib-simplex.OcplibSimplex.AssertBounds.S.Core)

Module S.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/index.html b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/index.html index 8e82592..4d63f14 100644 --- a/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/index.html +++ b/ocplib-simplex/OcplibSimplex/AssertBounds/module-type-S/index.html @@ -1,5 +1,5 @@ -S (ocplib-simplex.OcplibSimplex.AssertBounds.S)

Module type AssertBounds.S

module Core : CoreSig.S
val var : +S (ocplib-simplex.OcplibSimplex.AssertBounds.S)

Module type AssertBounds.S

module Core : CoreSig.S
val var : Core.t -> ?min:Core.bound -> ?max:Core.bound -> diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Assert/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Assert/index.html index 5348f89..4932e65 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Assert/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Assert/index.html @@ -1,5 +1,5 @@ -Assert (ocplib-simplex.OcplibSimplex.Basic.Make.Assert)

Module Make.Assert

val var : +Assert (ocplib-simplex.OcplibSimplex.Basic.Make.Assert)

Module Make.Assert

val var : Core.t -> ?min:Core.bound -> ?max:Core.bound -> diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/MX/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/MX/index.html index f902984..d7ea890 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.Basic.Make.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.Basic.Make.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/P/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/P/index.html index 5b565db..06da686 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/P/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.Basic.Make.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.Basic.Make.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/R/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/R/index.html index a156920..23b8f97 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/R/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Basic.Make.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t = R.t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.Basic.Make.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t = R.t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/R2/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/R2/index.html index 091cece..c861d49 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.Basic.Make.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.Basic.Make.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/SX/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/SX/index.html index 09c8d74..b2ebff6 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.Basic.Make.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.Basic.Make.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/V/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/V/index.html index 3dffad8..9ac2520 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/V/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.Basic.Make.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t = R.t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.Basic.Make.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t = R.t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/index.html index 39d650a..a084e20 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Core/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Core/index.html @@ -1,2 +1,2 @@ -Core (ocplib-simplex.OcplibSimplex.Basic.Make.Core)

Module Make.Core

The core module defines the different data types used by the project and some functions to handle them.

Modules

module Var = Var

The type of variables maipulated by the simplex algorithm.

module Ex = Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs with type t = R.t

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t with type t = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+Core (ocplib-simplex.OcplibSimplex.Basic.Make.Core)

Module Make.Core

The core module defines the different data types used by the project and some functions to handle them.

Modules

module Var = Var

The type of variables maipulated by the simplex algorithm.

module Ex = Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs with type t = R.t

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t with type t = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Result/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Result/index.html index 354f90a..0369a3a 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Result/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Result/index.html @@ -1,2 +1,2 @@ -Result (ocplib-simplex.OcplibSimplex.Basic.Make.Result)

Module Make.Result

val get : (Core.P.t * bool) option -> Core.t -> Core.result

get (objective, is_max_bounded) env retrieves the result from a simplex env.

This needs to be called after the system env has been solved by SolveBounds.

  • parameter objective

    the optimization objective if any

  • parameter is_max_bounded

    whether the result is bounded

  • parameter env

    the simplex environment (system of linear inequalities) containing the solution

  • returns

    solution that satisfies the constraints if any

+Result (ocplib-simplex.OcplibSimplex.Basic.Make.Result)

Module Make.Result

val get : (Core.P.t * bool) option -> Core.t -> Core.result

get (objective, is_max_bounded) env retrieves the result from a simplex env.

This needs to be called after the system env has been solved by SolveBounds.

  • parameter objective

    the optimization objective if any

  • parameter is_max_bounded

    whether the result is bounded

  • parameter env

    the simplex environment (system of linear inequalities) containing the solution

  • returns

    solution that satisfies the constraints if any

diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/Solve/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/Solve/index.html index d4bc62e..08cccad 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/Solve/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/Solve/index.html @@ -1,2 +1,2 @@ -Solve (ocplib-simplex.OcplibSimplex.Basic.Make.Solve)

Module Make.Solve

val solve : Core.t -> Core.t

solve env solves the linear inequalities in the simplex env.

Use Result to retrieve the solution if any.

val maximize : Core.t -> Core.P.t -> Core.t * (Core.P.t * bool) option

maximize env objective finds the maximum value of objective that satisfies the system of linear inequalities in env.

Use Result to retrieve the solution if any.

  • returns

    env,(objective,is_max_bounded)

+Solve (ocplib-simplex.OcplibSimplex.Basic.Make.Solve)

Module Make.Solve

val solve : Core.t -> Core.t

solve env solves the linear inequalities in the simplex env.

Use Result to retrieve the solution if any.

val maximize : Core.t -> Core.P.t -> Core.t * (Core.P.t * bool) option

maximize env objective finds the maximum value of objective that satisfies the system of linear inequalities in env.

Use Result to retrieve the solution if any.

  • returns

    env,(objective,is_max_bounded)

diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/argument-1-Var/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/argument-1-Var/index.html index 88ad58e..0bff7f4 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/argument-1-Var/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/argument-1-Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.Basic.Make.Var)

Parameter Make.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.Basic.Make.Var)

Parameter Make.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/argument-2-R/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/argument-2-R/index.html index 56a0b5e..e945102 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/argument-2-R/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/argument-2-R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Basic.Make.R)

Parameter Make.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
+R (ocplib-simplex.OcplibSimplex.Basic.Make.R)

Parameter Make.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/argument-3-Ex/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/argument-3-Ex/index.html index a55df6a..3440689 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/argument-3-Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/argument-3-Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.Basic.Make.Ex)

Parameter Make.Ex

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.Basic.Make.Ex)

Parameter Make.Ex

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/Basic/Make/index.html b/ocplib-simplex/OcplibSimplex/Basic/Make/index.html index bb2a05c..510496f 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/Make/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/Make/index.html @@ -1,5 +1,5 @@ -Make (ocplib-simplex.OcplibSimplex.Basic.Make)

Module Basic.Make

Parameters

Signature

module Core : +Make (ocplib-simplex.OcplibSimplex.Basic.Make)

Module Basic.Make

Parameters

Signature

module Core : CoreSig.S with module Var = Var and type R.t = R.t diff --git a/ocplib-simplex/OcplibSimplex/Basic/index.html b/ocplib-simplex/OcplibSimplex/Basic/index.html index 2c00573..ec76507 100644 --- a/ocplib-simplex/OcplibSimplex/Basic/index.html +++ b/ocplib-simplex/OcplibSimplex/Basic/index.html @@ -1,5 +1,5 @@ -Basic (ocplib-simplex.OcplibSimplex.Basic)

Module OcplibSimplex.Basic

The main entry point of the library. It provides a functor building each key module of OcplibSimplex.

module Make +Basic (ocplib-simplex.OcplibSimplex.Basic)

Module OcplibSimplex.Basic

The main entry point of the library. It provides a functor building each key module of OcplibSimplex.

module Make (Var : ExtSigs.Variables) (R : ExtSigs.Rationals) (Ex : ExtSigs.Explanations) : diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/MX/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/MX/index.html index 70871e6..a9f11d9 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.Core.Make.MX)

Module Make.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.Core.Make.MX)

Module Make.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/P/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/P/index.html index 312087d..7e64454 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/P/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.Core.Make.P)

Module Make.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.Core.Make.P)

Module Make.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/R/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/R/index.html index 13d1e43..cf2be69 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/R/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Core.Make.R)

Module Make.R

The interface for rationals provided by users for the coefficient.

type t = R.t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.Core.Make.R)

Module Make.R

The interface for rationals provided by users for the coefficient.

type t = R.t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/R2/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/R2/index.html index f3ee95e..0d69e7a 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.Core.Make.R2)

Module Make.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.Core.Make.R2)

Module Make.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/SX/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/SX/index.html index 0f18cf5..e016136 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.Core.Make.SX)

Module Make.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.Core.Make.SX)

Module Make.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/V/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/V/index.html index 6c16433..1a98a35 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/V/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.Core.Make.V)

Module Make.V

The interface for values of variable and bounds provided by users.

type t = R.t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.Core.Make.V)

Module Make.V

The interface for values of variable and bounds provided by users.

type t = R.t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/argument-1-Var/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/argument-1-Var/index.html index b898dcb..ddfce29 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/argument-1-Var/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/argument-1-Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.Core.Make.Var)

Parameter Make.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.Core.Make.Var)

Parameter Make.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/argument-2-R/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/argument-2-R/index.html index 2d6caae..aee36b0 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/argument-2-R/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/argument-2-R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Core.Make.R)

Parameter Make.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
+R (ocplib-simplex.OcplibSimplex.Core.Make.R)

Parameter Make.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/argument-3-Ex/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/argument-3-Ex/index.html index c562d16..e4bcbe6 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/argument-3-Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/argument-3-Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.Core.Make.Ex)

Parameter Make.Ex

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.Core.Make.Ex)

Parameter Make.Ex

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/Core/Make/index.html b/ocplib-simplex/OcplibSimplex/Core/Make/index.html index 45d9fdb..f86695d 100644 --- a/ocplib-simplex/OcplibSimplex/Core/Make/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/Make/index.html @@ -1,2 +1,2 @@ -Make (ocplib-simplex.OcplibSimplex.Core.Make)

Module Core.Make

Parameters

Signature

Modules

module Var = Var

The type of variables maipulated by the simplex algorithm.

module Ex = Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs with type t = R.t

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t with type t = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+Make (ocplib-simplex.OcplibSimplex.Core.Make)

Module Core.Make

Parameters

Signature

Modules

module Var = Var

The type of variables maipulated by the simplex algorithm.

module Ex = Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs with type t = R.t

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t with type t = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/R2/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/R2/index.html index 95c0793..58a37b4 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.Core.MakeExpert.R2)

Module MakeExpert.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.Core.MakeExpert.R2)

Module MakeExpert.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-1-Var/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-1-Var/index.html index 5aec93d..be8429d 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-1-Var/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-1-Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.Core.MakeExpert.Var)

Parameter MakeExpert.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.Core.MakeExpert.Var)

Parameter MakeExpert.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-2-R/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-2-R/index.html index 7ef42a4..f7f2df1 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-2-R/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-2-R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Core.MakeExpert.R)

Parameter MakeExpert.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.Core.MakeExpert.R)

Parameter MakeExpert.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-3-V/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-3-V/index.html index b26741e..84357b3 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-3-V/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-3-V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.Core.MakeExpert.V)

Parameter MakeExpert.V

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.Core.MakeExpert.V)

Parameter MakeExpert.V

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-4-Ex/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-4-Ex/index.html index 15be6bd..e9b7667 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-4-Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-4-Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.Core.MakeExpert.Ex)

Parameter MakeExpert.Ex

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.Core.MakeExpert.Ex)

Parameter MakeExpert.Ex

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-5-R2/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-5-R2/index.html index 03df28f..adec8f4 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-5-R2/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-5-R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.Core.MakeExpert.R2)

Parameter MakeExpert.R2

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.Core.MakeExpert.R2)

Parameter MakeExpert.R2

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-6-P/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-6-P/index.html index 5b5792b..9df2632 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-6-P/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-6-P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.Core.MakeExpert.P)

Parameter MakeExpert.P

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.Core.MakeExpert.P)

Parameter MakeExpert.P

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-7-MX/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-7-MX/index.html index 3f9f2e3..077f72d 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-7-MX/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-7-MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.Core.MakeExpert.MX)

Parameter MakeExpert.MX

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.Core.MakeExpert.MX)

Parameter MakeExpert.MX

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-8-SX/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-8-SX/index.html index 90b5ad3..aaf29b5 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-8-SX/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/argument-8-SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.Core.MakeExpert.SX)

Parameter MakeExpert.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.Core.MakeExpert.SX)

Parameter MakeExpert.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/index.html b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/index.html index 616740a..9030b2f 100644 --- a/ocplib-simplex/OcplibSimplex/Core/MakeExpert/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/MakeExpert/index.html @@ -1,2 +1,2 @@ -MakeExpert (ocplib-simplex.OcplibSimplex.Core.MakeExpert)

Module Core.MakeExpert

Same than Make but allows to choose the implementation of polynomials, maps and sets

Parameters

module R : ExtSigs.Coefs
module V : ExtSigs.Value with type r = R.t
module R2 : Rat2.SIG with module R = R and module V = V
module P : Polys.SIG with module Var = Var and module R = R
module MX : ExtSigs.MapSig with type key = Var.t
module SX : ExtSigs.SetSig with type elt = Var.t

Signature

Modules

module Var = Var

The type of variables maipulated by the simplex algorithm.

module Ex = Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R = R

The interface for rationals provided by users for the coefficient.

module V = V

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P = P

Linear relations of variables.

module MX = MX

Collections of variables.

module SX = SX

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+MakeExpert (ocplib-simplex.OcplibSimplex.Core.MakeExpert)

Module Core.MakeExpert

Same than Make but allows to choose the implementation of polynomials, maps and sets

Parameters

module R : ExtSigs.Coefs
module V : ExtSigs.Value with type r = R.t
module R2 : Rat2.SIG with module R = R and module V = V
module P : Polys.SIG with module Var = Var and module R = R
module MX : ExtSigs.MapSig with type key = Var.t
module SX : ExtSigs.SetSig with type elt = Var.t

Signature

Modules

module Var = Var

The type of variables maipulated by the simplex algorithm.

module Ex = Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R = R

The interface for rationals provided by users for the coefficient.

module V = V

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P = P

Linear relations of variables.

module MX = MX

Collections of variables.

module SX = SX

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/Core/index.html b/ocplib-simplex/OcplibSimplex/Core/index.html index 6db58be..f1697dd 100644 --- a/ocplib-simplex/OcplibSimplex/Core/index.html +++ b/ocplib-simplex/OcplibSimplex/Core/index.html @@ -1,5 +1,5 @@ -Core (ocplib-simplex.OcplibSimplex.Core)

Module OcplibSimplex.Core

val src : Logs.src
module Make +Core (ocplib-simplex.OcplibSimplex.Core)

Module OcplibSimplex.Core

val src : Logs.src
module Make (Var : ExtSigs.Variables) (R : ExtSigs.Rationals) (Ex : ExtSigs.Explanations) : diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/index.html index 6702a6a..a9776e3 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/index.html @@ -1,2 +1,2 @@ -CoreSig (ocplib-simplex.OcplibSimplex.CoreSig)

Module OcplibSimplex.CoreSig

module type S = sig ... end

Interface of the main types and auxiliary of the simplex.

+CoreSig (ocplib-simplex.OcplibSimplex.CoreSig)

Module OcplibSimplex.CoreSig

module type S = sig ... end

Interface of the main types and auxiliary of the simplex.

diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/Ex/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/Ex/index.html index 0e0f446..18f32ee 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.CoreSig.S.Ex)

Module S.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.CoreSig.S.Ex)

Module S.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/MX/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/MX/index.html index f9699ac..8a0b6c7 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.CoreSig.S.MX)

Module S.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.CoreSig.S.MX)

Module S.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/P/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/P/index.html index 1fba9ad..7cdbb99 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/P/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.CoreSig.S.P)

Module S.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.CoreSig.S.P)

Module S.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R/index.html index 8f86e1a..55537b8 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.CoreSig.S.R)

Module S.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.CoreSig.S.R)

Module S.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R2/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R2/index.html index 6ac2862..6ffbc1d 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.CoreSig.S.R2)

Module S.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.CoreSig.S.R2)

Module S.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/SX/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/SX/index.html index a27aee3..5f91b4e 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.CoreSig.S.SX)

Module S.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.CoreSig.S.SX)

Module S.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/V/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/V/index.html index 0170637..f5c32d7 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/V/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.CoreSig.S.V)

Module S.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.CoreSig.S.V)

Module S.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/Var/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/Var/index.html index 015b261..f5aeb0c 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/Var/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.CoreSig.S.Var)

Module S.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.CoreSig.S.Var)

Module S.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/index.html b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/index.html index 17e0a99..ec11614 100644 --- a/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/index.html +++ b/ocplib-simplex/OcplibSimplex/CoreSig/module-type-S/index.html @@ -1,2 +1,2 @@ -S (ocplib-simplex.OcplibSimplex.CoreSig.S)

Module type CoreSig.S

Interface of the main types and auxiliary of the simplex.

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+S (ocplib-simplex.OcplibSimplex.CoreSig.S)

Module type CoreSig.S

Interface of the main types and auxiliary of the simplex.

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/ExtSigs/index.html b/ocplib-simplex/OcplibSimplex/ExtSigs/index.html index 2152bf7..963257a 100644 --- a/ocplib-simplex/OcplibSimplex/ExtSigs/index.html +++ b/ocplib-simplex/OcplibSimplex/ExtSigs/index.html @@ -1,2 +1,2 @@ -ExtSigs (ocplib-simplex.OcplibSimplex.ExtSigs)

Module OcplibSimplex.ExtSigs

module type Variables = sig ... end

Interface required for variables

module type Rationals = sig ... end

Interface required for rationnals

module type Coefs = sig ... end

Interface required for coefs

module type Value = sig ... end

Interface required for bounds and solutions

module type Explanations = sig ... end

Interface of explanations

module type MapSig = sig ... end
module type SetSig = sig ... end
+ExtSigs (ocplib-simplex.OcplibSimplex.ExtSigs)

Module OcplibSimplex.ExtSigs

module type Variables = sig ... end

Interface required for variables

module type Rationals = sig ... end

Interface required for rationnals

module type Coefs = sig ... end

Interface required for coefs

module type Value = sig ... end

Interface required for bounds and solutions

module type Explanations = sig ... end

Interface of explanations

module type MapSig = sig ... end
module type SetSig = sig ... end
diff --git a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Coefs/index.html b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Coefs/index.html index fc523be..3172867 100644 --- a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Coefs/index.html +++ b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Coefs/index.html @@ -1,2 +1,2 @@ -Coefs (ocplib-simplex.OcplibSimplex.ExtSigs.Coefs)

Module type ExtSigs.Coefs

Interface required for coefs

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+Coefs (ocplib-simplex.OcplibSimplex.ExtSigs.Coefs)

Module type ExtSigs.Coefs

Interface required for coefs

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Explanations/index.html b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Explanations/index.html index dc4abd1..5c64c93 100644 --- a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Explanations/index.html +++ b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Explanations/index.html @@ -1,2 +1,2 @@ -Explanations (ocplib-simplex.OcplibSimplex.ExtSigs.Explanations)

Module type ExtSigs.Explanations

Interface of explanations

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Explanations (ocplib-simplex.OcplibSimplex.ExtSigs.Explanations)

Module type ExtSigs.Explanations

Interface of explanations

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-MapSig/index.html b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-MapSig/index.html index d31f97b..09b1bf6 100644 --- a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-MapSig/index.html +++ b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-MapSig/index.html @@ -1,2 +1,2 @@ -MapSig (ocplib-simplex.OcplibSimplex.ExtSigs.MapSig)

Module type ExtSigs.MapSig

type 'a t
type key
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MapSig (ocplib-simplex.OcplibSimplex.ExtSigs.MapSig)

Module type ExtSigs.MapSig

type 'a t
type key
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Rationals/index.html b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Rationals/index.html index b88dc3d..f904ced 100644 --- a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Rationals/index.html +++ b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Rationals/index.html @@ -1,2 +1,2 @@ -Rationals (ocplib-simplex.OcplibSimplex.ExtSigs.Rationals)

Module type ExtSigs.Rationals

Interface required for rationnals

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
+Rationals (ocplib-simplex.OcplibSimplex.ExtSigs.Rationals)

Module type ExtSigs.Rationals

Interface required for rationnals

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-SetSig/index.html b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-SetSig/index.html index 94b8f13..14bb805 100644 --- a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-SetSig/index.html +++ b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-SetSig/index.html @@ -1,2 +1,2 @@ -SetSig (ocplib-simplex.OcplibSimplex.ExtSigs.SetSig)

Module type ExtSigs.SetSig

type t
type elt
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SetSig (ocplib-simplex.OcplibSimplex.ExtSigs.SetSig)

Module type ExtSigs.SetSig

type t
type elt
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Value/index.html b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Value/index.html index 348ee90..6c4b7be 100644 --- a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Value/index.html +++ b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Value/index.html @@ -1,2 +1,2 @@ -Value (ocplib-simplex.OcplibSimplex.ExtSigs.Value)

Module type ExtSigs.Value

Interface required for bounds and solutions

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+Value (ocplib-simplex.OcplibSimplex.ExtSigs.Value)

Module type ExtSigs.Value

Interface required for bounds and solutions

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Variables/index.html b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Variables/index.html index 8a02d87..1bb65a0 100644 --- a/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Variables/index.html +++ b/ocplib-simplex/OcplibSimplex/ExtSigs/module-type-Variables/index.html @@ -1,2 +1,2 @@ -Variables (ocplib-simplex.OcplibSimplex.ExtSigs.Variables)

Module type ExtSigs.Variables

Interface required for variables

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Variables (ocplib-simplex.OcplibSimplex.ExtSigs.Variables)

Module type ExtSigs.Variables

Interface required for variables

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/Polys/Make/argument-1-Var/index.html b/ocplib-simplex/OcplibSimplex/Polys/Make/argument-1-Var/index.html index a966ee9..2621cbf 100644 --- a/ocplib-simplex/OcplibSimplex/Polys/Make/argument-1-Var/index.html +++ b/ocplib-simplex/OcplibSimplex/Polys/Make/argument-1-Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.Polys.Make.Var)

Parameter Make.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.Polys.Make.Var)

Parameter Make.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/Polys/Make/argument-2-R/index.html b/ocplib-simplex/OcplibSimplex/Polys/Make/argument-2-R/index.html index 5c0b87a..03e0c28 100644 --- a/ocplib-simplex/OcplibSimplex/Polys/Make/argument-2-R/index.html +++ b/ocplib-simplex/OcplibSimplex/Polys/Make/argument-2-R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Polys.Make.R)

Parameter Make.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
+R (ocplib-simplex.OcplibSimplex.Polys.Make.R)

Parameter Make.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Polys/Make/index.html b/ocplib-simplex/OcplibSimplex/Polys/Make/index.html index 0ac2f0a..8c6e90a 100644 --- a/ocplib-simplex/OcplibSimplex/Polys/Make/index.html +++ b/ocplib-simplex/OcplibSimplex/Polys/Make/index.html @@ -1,2 +1,2 @@ -Make (ocplib-simplex.OcplibSimplex.Polys.Make)

Module Polys.Make

Parameters

Signature

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+Make (ocplib-simplex.OcplibSimplex.Polys.Make)

Module Polys.Make

Parameters

Signature

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Polys/index.html b/ocplib-simplex/OcplibSimplex/Polys/index.html index bee7088..0e13cec 100644 --- a/ocplib-simplex/OcplibSimplex/Polys/index.html +++ b/ocplib-simplex/OcplibSimplex/Polys/index.html @@ -1,5 +1,5 @@ -Polys (ocplib-simplex.OcplibSimplex.Polys)

Module OcplibSimplex.Polys

module type SIG = sig ... end
module Make +Polys (ocplib-simplex.OcplibSimplex.Polys)

Module OcplibSimplex.Polys

module type SIG = sig ... end
module Make (Var : ExtSigs.Variables) (R : ExtSigs.Rationals) : SIG with module Var = Var and module R = R
diff --git a/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/R/index.html b/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/R/index.html index 3e325d2..69c9034 100644 --- a/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/R/index.html +++ b/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Polys.SIG.R)

Module SIG.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.Polys.SIG.R)

Module SIG.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/Var/index.html b/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/Var/index.html index 1eae0f8..e2b397c 100644 --- a/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/Var/index.html +++ b/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.Polys.SIG.Var)

Module SIG.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.Polys.SIG.Var)

Module SIG.Var

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/index.html b/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/index.html index 390cd3b..bd5b6c4 100644 --- a/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/index.html +++ b/ocplib-simplex/OcplibSimplex/Polys/module-type-SIG/index.html @@ -1,2 +1,2 @@ -SIG (ocplib-simplex.OcplibSimplex.Polys.SIG)

Module type Polys.SIG

module R : ExtSigs.Coefs
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+SIG (ocplib-simplex.OcplibSimplex.Polys.SIG)

Module type Polys.SIG

module R : ExtSigs.Coefs
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Rat2/Make/argument-1-R/index.html b/ocplib-simplex/OcplibSimplex/Rat2/Make/argument-1-R/index.html index 627069c..3ed4874 100644 --- a/ocplib-simplex/OcplibSimplex/Rat2/Make/argument-1-R/index.html +++ b/ocplib-simplex/OcplibSimplex/Rat2/Make/argument-1-R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Rat2.Make.R)

Parameter Make.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
+R (ocplib-simplex.OcplibSimplex.Rat2.Make.R)

Parameter Make.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Rat2/Make/argument-2-V/index.html b/ocplib-simplex/OcplibSimplex/Rat2/Make/argument-2-V/index.html index 1139550..d908e90 100644 --- a/ocplib-simplex/OcplibSimplex/Rat2/Make/argument-2-V/index.html +++ b/ocplib-simplex/OcplibSimplex/Rat2/Make/argument-2-V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.Rat2.Make.V)

Parameter Make.V

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.Rat2.Make.V)

Parameter Make.V

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/Rat2/Make/index.html b/ocplib-simplex/OcplibSimplex/Rat2/Make/index.html index 7e92837..b4a1c93 100644 --- a/ocplib-simplex/OcplibSimplex/Rat2/Make/index.html +++ b/ocplib-simplex/OcplibSimplex/Rat2/Make/index.html @@ -1,2 +1,2 @@ -Make (ocplib-simplex.OcplibSimplex.Rat2.Make)

Module Rat2.Make

Parameters

module V : ExtSigs.Value with type r = R.t

Signature

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+Make (ocplib-simplex.OcplibSimplex.Rat2.Make)

Module Rat2.Make

Parameters

module V : ExtSigs.Value with type r = R.t

Signature

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/Rat2/index.html b/ocplib-simplex/OcplibSimplex/Rat2/index.html index 9b8cad8..d2cd0a8 100644 --- a/ocplib-simplex/OcplibSimplex/Rat2/index.html +++ b/ocplib-simplex/OcplibSimplex/Rat2/index.html @@ -1,5 +1,5 @@ -Rat2 (ocplib-simplex.OcplibSimplex.Rat2)

Module OcplibSimplex.Rat2

A representation of rationals bound, which is a pair of rationals:

  • the raw value of the bound
  • an epsilon used as an offset for representing strict bounds.

For example, for the inequality x < 3, the upper bound of x will be represented by 3 - Ɛ, where Ɛ is a positive integer that will be calculated later.

module type SIG = sig ... end
module Make +Rat2 (ocplib-simplex.OcplibSimplex.Rat2)

Module OcplibSimplex.Rat2

A representation of rationals bound, which is a pair of rationals:

  • the raw value of the bound
  • an epsilon used as an offset for representing strict bounds.

For example, for the inequality x < 3, the upper bound of x will be represented by 3 - Ɛ, where Ɛ is a positive integer that will be calculated later.

module type SIG = sig ... end
module Make (R : ExtSigs.Rationals) (V : ExtSigs.Value with type r = R.t) : SIG with module R = R and module V = V
diff --git a/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/R/index.html b/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/R/index.html index 308c12e..08be707 100644 --- a/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/R/index.html +++ b/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Rat2.SIG.R)

Module SIG.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.Rat2.SIG.R)

Module SIG.R

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/V/index.html b/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/V/index.html index dcc408c..d62af5b 100644 --- a/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/V/index.html +++ b/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.Rat2.SIG.V)

Module SIG.V

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.Rat2.SIG.V)

Module SIG.V

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/index.html b/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/index.html index eade586..bfb4562 100644 --- a/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/index.html +++ b/ocplib-simplex/OcplibSimplex/Rat2/module-type-SIG/index.html @@ -1,2 +1,2 @@ -SIG (ocplib-simplex.OcplibSimplex.Rat2.SIG)

Module type Rat2.SIG

module R : ExtSigs.Coefs
module V : ExtSigs.Value with type r = R.t

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+SIG (ocplib-simplex.OcplibSimplex.Rat2.SIG)

Module type Rat2.SIG

module R : ExtSigs.Coefs
module V : ExtSigs.Value with type r = R.t

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/Ex/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/Ex/index.html index 9bd8c94..7edda69 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.Result.Make.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.Result.Make.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/MX/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/MX/index.html index cb34c60..a3f576c 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.Result.Make.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.Result.Make.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/P/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/P/index.html index 097ebcd..5180d7b 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/P/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.Result.Make.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.Result.Make.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/R/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/R/index.html index 9bbcbd1..145e509 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/R/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Result.Make.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.Result.Make.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/R2/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/R2/index.html index 9721fa9..aef6216 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.Result.Make.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.Result.Make.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/SX/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/SX/index.html index ad8f1aa..c9f279c 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.Result.Make.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.Result.Make.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/V/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/V/index.html index b94efce..51dce96 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/V/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.Result.Make.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.Result.Make.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/Var/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/Var/index.html index 335a63e..1f33dcb 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/Var/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.Result.Make.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.Result.Make.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/index.html index e85e010..27fd1eb 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/argument-1-Core/index.html @@ -1,2 +1,2 @@ -Core (ocplib-simplex.OcplibSimplex.Result.Make.Core)

Parameter Make.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+Core (ocplib-simplex.OcplibSimplex.Result.Make.Core)

Parameter Make.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/Result/Make/index.html b/ocplib-simplex/OcplibSimplex/Result/Make/index.html index f9b4c9f..219d0ab 100644 --- a/ocplib-simplex/OcplibSimplex/Result/Make/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/Make/index.html @@ -1,2 +1,2 @@ -Make (ocplib-simplex.OcplibSimplex.Result.Make)

Module Result.Make

Parameters

module Core : CoreSig.S

Signature

module Core = Core
val get : (Core.P.t * bool) option -> Core.t -> Core.result

get (objective, is_max_bounded) env retrieves the result from a simplex env.

This needs to be called after the system env has been solved by SolveBounds.

  • parameter objective

    the optimization objective if any

  • parameter is_max_bounded

    whether the result is bounded

  • parameter env

    the simplex environment (system of linear inequalities) containing the solution

  • returns

    solution that satisfies the constraints if any

+Make (ocplib-simplex.OcplibSimplex.Result.Make)

Module Result.Make

Parameters

module Core : CoreSig.S

Signature

module Core = Core
val get : (Core.P.t * bool) option -> Core.t -> Core.result

get (objective, is_max_bounded) env retrieves the result from a simplex env.

This needs to be called after the system env has been solved by SolveBounds.

  • parameter objective

    the optimization objective if any

  • parameter is_max_bounded

    whether the result is bounded

  • parameter env

    the simplex environment (system of linear inequalities) containing the solution

  • returns

    solution that satisfies the constraints if any

diff --git a/ocplib-simplex/OcplibSimplex/Result/index.html b/ocplib-simplex/OcplibSimplex/Result/index.html index 180f0fc..880804f 100644 --- a/ocplib-simplex/OcplibSimplex/Result/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/index.html @@ -1,2 +1,2 @@ -Result (ocplib-simplex.OcplibSimplex.Result)

Module OcplibSimplex.Result

module type S = sig ... end
module Make (Core : CoreSig.S) : S with module Core = Core
+Result (ocplib-simplex.OcplibSimplex.Result)

Module OcplibSimplex.Result

module type S = sig ... end
module Make (Core : CoreSig.S) : S with module Core = Core
diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/Ex/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/Ex/index.html index 992814e..9bed1e0 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.Result.S.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.Result.S.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/MX/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/MX/index.html index 8b89be9..9368b45 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.Result.S.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.Result.S.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/P/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/P/index.html index 51d0c3b..4b365c1 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/P/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.Result.S.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.Result.S.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/R/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/R/index.html index a5869f6..5816d0b 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/R/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.Result.S.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.Result.S.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/R2/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/R2/index.html index 898a814..44790cb 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.Result.S.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.Result.S.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/SX/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/SX/index.html index fa40005..e302d5f 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.Result.S.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.Result.S.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/V/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/V/index.html index 9764242..c07e26b 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/V/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.Result.S.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.Result.S.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/Var/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/Var/index.html index b4bedf9..a09de7f 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/Var/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.Result.S.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.Result.S.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/index.html index 4f938cb..154ac82 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/Core/index.html @@ -1,2 +1,2 @@ -Core (ocplib-simplex.OcplibSimplex.Result.S.Core)

Module S.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+Core (ocplib-simplex.OcplibSimplex.Result.S.Core)

Module S.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/Result/module-type-S/index.html b/ocplib-simplex/OcplibSimplex/Result/module-type-S/index.html index a84fbe1..fd0b30e 100644 --- a/ocplib-simplex/OcplibSimplex/Result/module-type-S/index.html +++ b/ocplib-simplex/OcplibSimplex/Result/module-type-S/index.html @@ -1,2 +1,2 @@ -S (ocplib-simplex.OcplibSimplex.Result.S)

Module type Result.S

module Core : CoreSig.S
val get : (Core.P.t * bool) option -> Core.t -> Core.result

get (objective, is_max_bounded) env retrieves the result from a simplex env.

This needs to be called after the system env has been solved by SolveBounds.

  • parameter objective

    the optimization objective if any

  • parameter is_max_bounded

    whether the result is bounded

  • parameter env

    the simplex environment (system of linear inequalities) containing the solution

  • returns

    solution that satisfies the constraints if any

+S (ocplib-simplex.OcplibSimplex.Result.S)

Module type Result.S

module Core : CoreSig.S
val get : (Core.P.t * bool) option -> Core.t -> Core.result

get (objective, is_max_bounded) env retrieves the result from a simplex env.

This needs to be called after the system env has been solved by SolveBounds.

  • parameter objective

    the optimization objective if any

  • parameter is_max_bounded

    whether the result is bounded

  • parameter env

    the simplex environment (system of linear inequalities) containing the solution

  • returns

    solution that satisfies the constraints if any

diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/Ex/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/Ex/index.html index f4ffaf6..8a6e5a9 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/MX/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/MX/index.html index 9ea562a..7f16d1e 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/P/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/P/index.html index bd87597..3f2e3f2 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/P/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/R/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/R/index.html index 4dd9465..64d357f 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/R/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/R2/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/R2/index.html index e7115d4..3a9106e 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/SX/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/SX/index.html index 831d9fc..f00d1da 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/V/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/V/index.html index 094e906..a3baf19 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/V/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/Var/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/Var/index.html index 658a9ba..ffac58d 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/Var/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/index.html index d1d01d2..a71b9f3 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/argument-1-Core/index.html @@ -1,2 +1,2 @@ -Core (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core)

Parameter Make.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+Core (ocplib-simplex.OcplibSimplex.SolveBounds.Make.Core)

Parameter Make.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/index.html index 5354630..43059be 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/Make/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/Make/index.html @@ -1,2 +1,2 @@ -Make (ocplib-simplex.OcplibSimplex.SolveBounds.Make)

Module SolveBounds.Make

Parameters

module Core : CoreSig.S

Signature

module Core = Core
val solve : Core.t -> Core.t

solve env solves the linear inequalities in the simplex env.

Use Result to retrieve the solution if any.

val maximize : Core.t -> Core.P.t -> Core.t * (Core.P.t * bool) option

maximize env objective finds the maximum value of objective that satisfies the system of linear inequalities in env.

Use Result to retrieve the solution if any.

  • returns

    env,(objective,is_max_bounded)

+Make (ocplib-simplex.OcplibSimplex.SolveBounds.Make)

Module SolveBounds.Make

Parameters

module Core : CoreSig.S

Signature

module Core = Core
val solve : Core.t -> Core.t

solve env solves the linear inequalities in the simplex env.

Use Result to retrieve the solution if any.

val maximize : Core.t -> Core.P.t -> Core.t * (Core.P.t * bool) option

maximize env objective finds the maximum value of objective that satisfies the system of linear inequalities in env.

Use Result to retrieve the solution if any.

  • returns

    env,(objective,is_max_bounded)

diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/index.html index 76af52b..86e6d16 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/index.html @@ -1,2 +1,2 @@ -SolveBounds (ocplib-simplex.OcplibSimplex.SolveBounds)

Module OcplibSimplex.SolveBounds

val src : Logs.src
module type S = sig ... end
module Make (Core : CoreSig.S) : S with module Core = Core
+SolveBounds (ocplib-simplex.OcplibSimplex.SolveBounds)

Module OcplibSimplex.SolveBounds

val src : Logs.src
module type S = sig ... end
module Make (Core : CoreSig.S) : S with module Core = Core
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/Ex/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/Ex/index.html index d50bbc2..ce3dbd7 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/Ex/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/Ex/index.html @@ -1,2 +1,2 @@ -Ex (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
+Ex (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.Ex)

Module Core.Ex

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

type t
val empty : t
val union : t -> t -> t
val print : Stdlib.Format.formatter -> t -> unit
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/MX/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/MX/index.html index d147f32..ae92085 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/MX/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/MX/index.html @@ -1,2 +1,2 @@ -MX (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
+MX (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.MX)

Module Core.MX

Collections of variables.

type 'a t
type key = Var.t
val empty : 'a t
val find : key -> 'a t -> 'a
val add : key -> 'a -> 'a t -> 'a t
val remove : key -> 'a t -> 'a t
val mem : key -> 'a t -> bool
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (key -> 'a -> unit) -> 'a t -> unit
val cardinal : 'a t -> int
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/P/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/P/index.html index 3494fa2..39e3c8a 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/P/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/P/index.html @@ -1,2 +1,2 @@ -P (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
+P (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.P)

Module Core.P

Linear relations of variables.

module Var = Var
module R = R
type t
type var_status =
  1. | New
  2. | Exists
  3. | Removed
val empty : t
val is_polynomial : t -> bool
val is_empty : t -> bool
val replace : Var.t -> R.t -> t -> t * var_status
val accumulate : Var.t -> R.t -> t -> t * var_status
val append : t -> R.t -> t -> t * (Var.t * var_status) list
val subst : Var.t -> t -> t -> t * (Var.t * var_status) list
val from_list : (Var.t * R.t) list -> t
val print : Stdlib.Format.formatter -> t -> unit
val fold : (Var.t -> R.t -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (Var.t -> R.t -> unit) -> t -> unit
val partition : (Var.t -> R.t -> bool) -> t -> t * t
val compare : t -> t -> int
val mem : Var.t -> t -> bool
val equal : t -> t -> bool
val bindings : t -> (Var.t * R.t) list
val find : Var.t -> t -> R.t
val remove : Var.t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/R/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/R/index.html index 14dd762..5dae5f5 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/R/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/R/index.html @@ -1,2 +1,2 @@ -R (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
+R (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.R)

Module Core.R

The interface for rationals provided by users for the coefficient.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val is_one : t -> bool
val is_m_one : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val div : t -> t -> t
val mult : t -> t -> t
val abs : t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/R2/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/R2/index.html index 13a18e7..27169b4 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/R2/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/R2/index.html @@ -1,2 +1,2 @@ -R2 (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

+R2 (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.R2)

Module Core.R2

Pairs of rationals R representing bounds with an offset x + kƐ.

module R = R
module V = V

Type

type t = private {
  1. v : V.t;
    (*

    The raw value of the bound.

    *)
  2. offset : R.t;
    (*

    The number of epsilons to add to the bound.

    *)
}

Constructors

val zero : t

The zero bound with no offset.

val of_r : V.t -> t

From a rational r, returns the Rat2 representation with no offset.

val upper : V.t -> t

From a rational r, returns r - Ɛ.

val lower : V.t -> t

From a rational r, returns r + Ɛ.

Algebraic operations

val minus : t -> t

From a bound r + kƐ, returns -r -kƐ.

val add : t -> t -> t

Adds two bounds.

val sub : t -> t -> t

Substracts two bounds.

val mult_by_const : R.t -> t -> t

Multiplies a bound by a rational constant (both v and offset are multiplied).

val div_by_const : R.t -> t -> t

Divides a bound by a constant. Fails if the constant is zero.

Comparison functions

val compare : t -> t -> int

Compares two bounds; returns 0 iff the two bounds are strictly equal.

val equal : t -> t -> bool

Returns true iff the bounds are strictly equal.

val is_zero : t -> bool

Returns true iff the bound in argument is zero.

val is_pure_rational : t -> bool

Returns true iff the offset is 0.

val is_int : t -> bool

Returns true iff the offset is 0 and the field v is an integer.

Misc

val floor : t -> t

Returns the greatest (pure) integer smaller or equal to the argument.

val ceiling : t -> t

Returns the smallest (pure) integer greater or equal to the argument.

val print : Stdlib.Format.formatter -> t -> unit

Prints a bound.

diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/SX/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/SX/index.html index 0fafeed..f2e0da4 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/SX/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/SX/index.html @@ -1,2 +1,2 @@ -SX (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
+SX (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.SX)

Module Core.SX

type t
type elt = Var.t
val empty : t
val is_empty : t -> bool
val choose : t -> elt
val elements : t -> elt list
val add : elt -> t -> t
val mem : elt -> t -> bool
val remove : elt -> t -> t
val fold : (elt -> 'b -> 'b) -> t -> 'b -> 'b
val iter : (elt -> unit) -> t -> unit
val union : t -> t -> t
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/V/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/V/index.html index fd08894..3efe5f6 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/V/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/V/index.html @@ -1,2 +1,2 @@ -V (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
+V (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.V)

Module Core.V

The interface for values of variable and bounds provided by users.

type t

type of rationnal numbers

val zero : t
val one : t
val m_one : t
val sign : t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val is_zero : t -> bool
val add : t -> t -> t
val sub : t -> t -> t
val is_int : t -> bool
val print : Stdlib.Format.formatter -> t -> unit
val to_string : t -> string
val min : t -> t -> t
val minus : t -> t
val floor : t -> t
val ceiling : t -> t
type r = R.t
val mult_by_coef : t -> r -> t
val div_by_coef : t -> r -> t
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/Var/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/Var/index.html index 679abc5..1a91e58 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/Var/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/Var/index.html @@ -1,2 +1,2 @@ -Var (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

+Var (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core.Var)

Module Core.Var

The type of variables maipulated by the simplex algorithm.

type t

type of variables used in the simplex

val compare : t -> t -> int

compare function on vars

val is_int : t -> bool

is_int v returns true if the variable has integer type, and false otherwise

val print : Stdlib.Format.formatter -> t -> unit

print fmt v prints the given var

diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/index.html index 2182a6a..c038756 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/Core/index.html @@ -1,2 +1,2 @@ -Core (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core)

Module S.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
+Core (ocplib-simplex.OcplibSimplex.SolveBounds.S.Core)

Module S.Core

Modules

The type of variables maipulated by the simplex algorithm.

An interface for explanations; in practice, they are labels attached to bounds used for backtracking information on how bounds were discovered. The simplex algorithm does not create explanations: it will only attach empty explanations to bounds, build the union of explanations and print them. It is the user's job to provide the initial explanations when initializing the simplex core.

module R : ExtSigs.Coefs

The interface for rationals provided by users for the coefficient.

module V : ExtSigs.Value with type r = R.t

The interface for values of variable and bounds provided by users.

module R2 : Rat2.SIG with module R = R and module V = V

Pairs of rationals R representing bounds with an offset x + kƐ.

module P : Polys.SIG with module Var = Var and module R = R

Linear relations of variables.

module MX : ExtSigs.MapSig with type key = Var.t

Collections of variables.

module SX : ExtSigs.SetSig with type elt = Var.t

Types

type bound = {
  1. bvalue : R2.t;
  2. explanation : Ex.t;
}

A bound is a value of the form x + kƐ and an explanation.

type value_status =
  1. | ValueOK
    (*

    The value is inbetween bounds.

    *)
  2. | LowerKO
    (*

    The value is smaller than the lower bound.

    *)
  3. | UpperKO
    (*

    The value is greater than the upper bound.

    *)
type var_info = {
  1. mini : bound option;
  2. maxi : bound option;
  3. value : R2.t;
  4. vstatus : value_status;
  5. empty_dom : bool;
}
type solution = {
  1. main_vars : (Var.t * V.t) list;
  2. slake_vars : (Var.t * V.t) list;
  3. int_sol : bool;
  4. epsilon : V.t;
}
type maximum = {
  1. max_v : bound;
  2. is_le : bool;
}
type result =
  1. | Unknown
  2. | Unsat of Ex.t Stdlib.Lazy.t
  3. | Sat of solution Stdlib.Lazy.t
  4. | Unbounded of solution Stdlib.Lazy.t
  5. | Max of maximum Stdlib.Lazy.t * solution Stdlib.Lazy.t
type simplex_status =
  1. | UNK
  2. | UNSAT of Var.t
  3. | SAT
type t = {
  1. basic : (var_info * P.t) MX.t;
  2. non_basic : (var_info * SX.t) MX.t;
  3. slake : P.t MX.t;
  4. fixme : SX.t;
  5. is_int : bool;
  6. status : simplex_status;
  7. check_invs : bool;
  8. nb_pivots : int Stdlib.ref;
}
val empty : is_int:bool -> check_invs:bool -> t

Returns a simplex environment with three parameters:

  • is_int: will the simplex work on an integer optimization problem or a rational problem?
  • check_invs: processes checks after the calculation (deprecated).
val on_integers : t -> bool

Returns true if the simplex environment is on integers.

val equals_optimum : R2.t -> bound option -> bool

Equality check between bounds.

val consistent_bounds : var_info -> bool

Checks if the lower bound of a variable is smaller than its upper bound.

val violates_min_bound : R2.t -> bound option -> bool

violates_min_bound b mb returns true if b is smaller than mb.

val violates_max_bound : R2.t -> bound option -> bool

violates_max_bound b mb returns true if b is greater than mb.

val set_min_bound : var_info -> bound option -> var_info * bool

set_min_bound vinfo b returns a couple (vinfo', changed) where:

  • vinfo' is the new variable info where the new min bound b has been set.
  • changed is true if the new bound has changed the variable info
val set_max_bound : var_info -> bound option -> var_info * bool

Same as set_min_bound, but for max bounds.

val ajust_value_of_non_basic : var_info -> var_info * bool

ajust_value_of_non_basic vinfo updates the info's value with the upper bound (resp. the lower bound), if vinfo's status is UpperKO (resp. LowerKO). Otherwise, do nothing. The boolean returned is true if the new variable var_info has changed.

val ajust_status_of_basic : var_info -> var_info

ajust_status_of_basic vinfo checks a variable info's bound matches its status. If its value violates its lower bound, its status is set to LowerKO. In the other case, it is set to UpperKO. If the value is between the two bounds, it is set to ValueOK.

val evaluate_poly : t -> P.t -> R2.t

Evaluates a polynomial of non basic variables.

val poly_of_slake : t -> Var.t -> P.t option

poly_of_slake env slake returns the polynomial associated to the variable slake in env.

val expl_of_min_bound : var_info -> Ex.t

Returns the explanation associated to a variable lower bound.

val expl_of_max_bound : var_info -> Ex.t

Same as `expl_of_min_bound`, but for upper bounds.

Debug functions

Only use for internal debugging

val check_invariants : t -> (t -> result) -> unit

Checks several invariants in the project

val print : result -> Stdlib.Format.formatter -> t -> unit

Pretty prints the environment.

val debug : string -> t -> (t -> result) -> unit
  • deprecated
diff --git a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/index.html b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/index.html index 20cedf7..b1254b5 100644 --- a/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/index.html +++ b/ocplib-simplex/OcplibSimplex/SolveBounds/module-type-S/index.html @@ -1,2 +1,2 @@ -S (ocplib-simplex.OcplibSimplex.SolveBounds.S)

Module type SolveBounds.S

module Core : CoreSig.S
val solve : Core.t -> Core.t

solve env solves the linear inequalities in the simplex env.

Use Result to retrieve the solution if any.

val maximize : Core.t -> Core.P.t -> Core.t * (Core.P.t * bool) option

maximize env objective finds the maximum value of objective that satisfies the system of linear inequalities in env.

Use Result to retrieve the solution if any.

  • returns

    env,(objective,is_max_bounded)

+S (ocplib-simplex.OcplibSimplex.SolveBounds.S)

Module type SolveBounds.S

module Core : CoreSig.S
val solve : Core.t -> Core.t

solve env solves the linear inequalities in the simplex env.

Use Result to retrieve the solution if any.

val maximize : Core.t -> Core.P.t -> Core.t * (Core.P.t * bool) option

maximize env objective finds the maximum value of objective that satisfies the system of linear inequalities in env.

Use Result to retrieve the solution if any.

  • returns

    env,(objective,is_max_bounded)

diff --git a/ocplib-simplex/OcplibSimplex/Version/index.html b/ocplib-simplex/OcplibSimplex/Version/index.html index 4b23ed8..a7e7f34 100644 --- a/ocplib-simplex/OcplibSimplex/Version/index.html +++ b/ocplib-simplex/OcplibSimplex/Version/index.html @@ -1,2 +1,2 @@ -Version (ocplib-simplex.OcplibSimplex.Version)

Module OcplibSimplex.Version

val version : string
+Version (ocplib-simplex.OcplibSimplex.Version)

Module OcplibSimplex.Version

val version : string
diff --git a/ocplib-simplex/OcplibSimplex/index.html b/ocplib-simplex/OcplibSimplex/index.html index ad184b4..7376cf0 100644 --- a/ocplib-simplex/OcplibSimplex/index.html +++ b/ocplib-simplex/OcplibSimplex/index.html @@ -1,2 +1,2 @@ -OcplibSimplex (ocplib-simplex.OcplibSimplex)

Module OcplibSimplex

module AssertBounds : sig ... end
module Basic : sig ... end

The main entry point of the library. It provides a functor building each key module of OcplibSimplex.

module Core : sig ... end
module CoreSig : sig ... end
module ExtSigs : sig ... end
module Polys : sig ... end
module Rat2 : sig ... end

A representation of rationals bound, which is a pair of rationals:

module Result : sig ... end
module SolveBounds : sig ... end
module Version : sig ... end
+OcplibSimplex (ocplib-simplex.OcplibSimplex)

Module OcplibSimplex

module AssertBounds : sig ... end
module Basic : sig ... end

The main entry point of the library. It provides a functor building each key module of OcplibSimplex.

module Core : sig ... end
module CoreSig : sig ... end
module ExtSigs : sig ... end
module Polys : sig ... end
module Rat2 : sig ... end

A representation of rationals bound, which is a pair of rationals:

module Result : sig ... end
module SolveBounds : sig ... end
module Version : sig ... end
diff --git a/ocplib-simplex/index.html b/ocplib-simplex/index.html index 13f83bb..0145a2a 100644 --- a/ocplib-simplex/index.html +++ b/ocplib-simplex/index.html @@ -1,2 +1,2 @@ -index (ocplib-simplex.index)

ocplib-simplex index

Library ocplib-simplex

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

+index (ocplib-simplex.index)

ocplib-simplex index

Library ocplib-simplex

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

diff --git a/odoc.support/odoc.css b/odoc.support/odoc.css index 71148de..f0f22a1 100644 --- a/odoc.support/odoc.css +++ b/odoc.support/odoc.css @@ -1,7 +1,7 @@ @charset "UTF-8"; /* Copyright (c) 2016 The odoc contributors. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - odoc 2.4.2 */ + odoc 2.4.4 */ /* Fonts */ /* noticia-text-regular - latin */