Lp.PolyModule for polynomial expression.
type decomposed = {const : float;lcs : float list;lvs : Var.t list;qcs : float list;qv0s : Var.t list;qv1s : Var.t list;}Type for the decomposed expression of the polynomial.
val c : float -> tMake monomial of a constant value.
val var : ?integer:bool -> ?lb:float -> ?ub:float -> string -> tMake monomial of a variable. You can optionally set its bounds (lb and ub) and whether it is an integer. By default, it becomes continuous and non-negative (integer = false, lb = Float.zero, and ub = Float.infinity).
val binary : string -> tMake monomial of a binary variable.
val range :
?integer:bool ->
?lb:float ->
?ub:float ->
?start:int ->
int ->
string ->
t arrayMake an array of monomials of a variable with uniform bounds.
val range2 :
?integer:bool ->
?lb:float ->
?ub:float ->
?start0:int ->
?start1:int ->
int ->
int ->
string ->
t array arrayMake 2D array of monomials of a variable with uniform bounds.
val range3 :
?integer:bool ->
?lb:float ->
?ub:float ->
?start0:int ->
?start1:int ->
?start2:int ->
int ->
int ->
int ->
string ->
t array array arrayMake 3D array of monomials of a variable with uniform bounds.
val rangeb : ?start:int -> int -> string -> t arrayMake an array of monomials of a binary variable.
val range2b :
?start0:int ->
?start1:int ->
int ->
int ->
string ->
t array arrayMake 2D array of monomials of a binary variable.
val range3b :
?start0:int ->
?start1:int ->
?start2:int ->
int ->
int ->
int ->
string ->
t array array arrayMake 3D array of monomials of a binary variable.
val rangev :
?integer:bool ->
?lb:float array ->
?ub:float array ->
?start:int ->
int ->
string ->
t arrayMake an array of monomials of a variable with different bounds.
val range2v :
?integer:bool ->
?lb:float array array ->
?ub:float array array ->
?start0:int ->
?start1:int ->
int ->
int ->
string ->
t array arrayMake 2D array of monomials of a variable with different bounds.
val range3v :
?integer:bool ->
?lb:float array array array ->
?ub:float array array array ->
?start0:int ->
?start1:int ->
?start2:int ->
int ->
int ->
int ->
string ->
t array array arrayMake 3D array of monomials of a variable with different bounds.
val of_float_array : float array -> tConvert a float array into a polynomial.
val to_float : t -> floatConvert a Constant monomial to float.
val zero : tThe monomial of constant zero.
val one : tThe monomial of constant one.
val to_string : ?short:bool -> t -> stringGet string expression of the polynomial.
val classify : t -> classifiedClassify terms into three categories: quad, linear, and const (classified).
val decompose : t -> decomposedDecompose the polynomial into decomposed.
val collision : t -> boolCheck if any variable collision exist in the polynomial.
Simplify the polynomial. The polynomial is sorted and terms with same variables are accumulated. After that, near-zero terms are dropped. eps specifies the threshold of near-zero, defaulting to 10. *. epsilon_float.
val degree : t -> intGet the degree of polynomial.
take quad coefficient of the variables in a polynomial.
Divide polynomial by a univariate polynomial. Be careful as this function raises exception in some cases.
with_bound name lb ub transforms the bounds of the variable name with lb and ub.
to_integer name transforms the variable name into general integer variable.
Apply a function to all terms in the polynomial and build a list.
Apply a function only to linear terms in the polynomial and build a list.
Apply a function to all terms in the polynomial and build a list.
Apply a function only to linear terms in the polynomial. * non-linear terms are just ignored.
Apply a function only to linear terms in the polynomial.
val length : t -> intGet number of terms (length) of a polynomial.
val take_linear_coeffs : t -> float listMake list of coefficients in linear terms in a polynomial.