Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Lp.Poly
SourceModule for polynomial expression type
Type for the polynomial with order up to two (quadratic).
Type for the polynomial classified by orders
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
Make 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 array
Make 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 array
Make 3D array of monomials of a variable with uniform bounds
Make an array of monomials of a binary variable
Make 2D array of monomials of a binary variable
val range3b :
?start0:int ->
?start1:int ->
?start2:int ->
int ->
int ->
int ->
string ->
t array array array
Make 3D array of monomials of a binary variable
val rangev :
?integer:bool ->
?lb:float array ->
?ub:float array ->
?start:int ->
int ->
string ->
t array
Make 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 array
Make 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 array
Make 3D array of monomials of a variable with different bounds
Convert a Constant monomial to float. * Raises Failure if it's not constant monomial
Classify terms into three categories quad, linear, const
Decompose the polynomial into const, lcs, lvs, qcs, qv0s, qv1s
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.
take quad coefficient of the variables in a polynomial
Multiply two polynomials. specifically, performs polynomial expansion.
Divide polynomial by a univariate polynomial. Be careful as this function raises exception in following cases.
trans_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
to_integer name
transforms the variable name
into binary 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. * Raise Failure if non-linear terms exist.
apply a function to all terms in the polynomial and build a list
apply a function to all terms in the polynomial
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. * Raise Failure if non-linear terms exist.