QuadExpr.QuadExpr()
Constructor of a quadratic expression with default constant value 0.
Synopsis
QuadExpr(double constant)
Arguments
constant
: optional, constant value in quadratic expression object.
QuadExpr.QuadExpr()
Constructor of a quadratic expression with one linear term.
Synopsis
QuadExpr(Var var, double coeff)
Arguments
var
: variable of the added linear term.
coeff
: coefficent for the added linear term with default value 1.0.
QuadExpr.QuadExpr()
Constructor of a quadratic expression with a linear expression.
Synopsis
QuadExpr(Expr expr)
Arguments
expr
: linear expression added to the quadratic expression.
QuadExpr.QuadExpr()
Constructor of a quadratic expression with two linear expression.
Synopsis
QuadExpr(Expr expr, Var var)
Arguments
expr
: one linear expression.
var
: another variable.
QuadExpr.QuadExpr()
Constructor of a quadratic expression with two linear expression.
Synopsis
QuadExpr(Expr left, Expr right)
Arguments
left
: one linear expression.
right
: another linear expression.
QuadExpr.AddConstant()
Add a constant to the quadratic expression.
Synopsis
void AddConstant(double constant)
Arguments
constant
: value to be added.
QuadExpr.AddLinExpr()
Add a linear expression to self.
Synopsis
void AddLinExpr(Expr expr)
Arguments
expr
: linear expression to be added.
QuadExpr.AddLinExpr()
Add a linear expression to self.
Synopsis
void AddLinExpr(Expr expr, double mult)
Arguments
expr
: linear expression to be added.
mult
: multiplier constant.
QuadExpr.AddQuadExpr()
Add a quadratic expression to self.
Synopsis
void AddQuadExpr(QuadExpr expr)
Arguments
expr
: quadratic expression to be added.
QuadExpr.AddQuadExpr()
Add a quadratic expression to self.
Synopsis
void AddQuadExpr(QuadExpr expr, double mult)
Arguments
expr
: quadratic expression to be added.
mult
: multiplier constant.
QuadExpr.AddTerm()
Add a term to quadratic expression object.
Synopsis
void AddTerm(Var var, double coeff)
Arguments
var
: a variable of new term.
coeff
: coefficient of new term.
QuadExpr.AddTerm()
Add a quadratic term to expression object.
Synopsis
void AddTerm(
Var var1,
Var var2,
double coeff)
Arguments
var1
: first variable of new quadratic term.
var2
: second variable of new quadratic term.
coeff
: coefficient of new quadratic term.
QuadExpr.AddTerms()
Add linear terms to quadratic expression object.
Synopsis
void AddTerms(Var[] vars, double coeff)
Arguments
vars
: variables of added linear terms.
coeff
: one coefficient for added linear terms.
QuadExpr.AddTerms()
Add linear terms to quadratic expression object.
Synopsis
void AddTerms(Var[] vars, double[] coeffs)
Arguments
vars
: variables of added linear terms.
coeffs
: coefficients of added linear terms.
QuadExpr.AddTerms()
Add linear terms to quadratic expression object.
Synopsis
void AddTerms(VarArray vars, double coeff)
Arguments
vars
: variables of added linear terms.
coeff
: one coefficient for added linear terms.
QuadExpr.AddTerms()
Add linear terms to quadratic expression object.
Synopsis
void AddTerms(VarArray vars, double[] coeffs)
Arguments
vars
: variables of added terms.
coeffs
: coefficients of added terms.
QuadExpr.AddTerms()
Add quadratic terms to expression object.
Synopsis
void AddTerms(
VarArray vars1,
VarArray vars2,
double[] coeffs)
Arguments
vars1
: first set of variables for added quadratic terms.
vars2
: second set of variables for added quadratic terms.
coeffs
: coefficient array for added quadratic terms.
QuadExpr.AddTerms()
Add quadratic terms to expression object.
Synopsis
void AddTerms(
Var[] vars1,
Var[] vars2,
double[] coeffs)
Arguments
vars1
: first set of variables for added quadratic terms.
vars2
: second set of variables for added quadratic terms.
coeffs
: coefficient array for added quadratic terms.
QuadExpr.Clone()
Deep copy quadratic expression object.
Synopsis
QuadExpr Clone()
Return
cloned quadratic expression object.
QuadExpr.Evaluate()
evaluate quadratic expression after solving
Synopsis
double Evaluate()
Return
value of quadratic expression
QuadExpr.GetCoeff()
Get coefficient from the i-th term in quadratic expression.
Synopsis
double GetCoeff(int i)
Arguments
i
: index of the term.Return
coefficient of the i-th term in quadratic expression object.
QuadExpr.GetConstant()
Get constant in quadratic expression.
Synopsis
double GetConstant()
Return
constant in quadratic expression.
QuadExpr.GetLinExpr()
Get linear expression in quadratic expression.
Synopsis
Expr GetLinExpr()
Return
linear expression object.
QuadExpr.GetVar1()
Get first variable from the i-th term in quadratic expression.
Synopsis
Var GetVar1(int i)
Arguments
i
: index of the term.Return
first variable of the i-th term in quadratic expression object.
QuadExpr.GetVar2()
Get second variable from the i-th term in quadratic expression.
Synopsis
Var GetVar2(int i)
Arguments
i
: index of the term.Return
second variable of the i-th term in quadratic expression object.
QuadExpr.Remove()
Remove idx-th term from quadratic expression object.
Synopsis
void Remove(int idx)
Arguments
idx
: index of the term to be removed.
QuadExpr.Remove()
Remove the term associated with variable from quadratic expression.
Synopsis
void Remove(Var var)
Arguments
var
: a variable whose term should be removed.
QuadExpr.SetCoeff()
Set coefficient of the i-th term in quadratic expression.
Synopsis
void SetCoeff(int i, double val)
Arguments
i
: index of the quadratic term.
val
: coefficient of the term.
QuadExpr.SetConstant()
Set constant for the quadratic expression.
Synopsis
void SetConstant(double constant)
Arguments
constant
: the value of the constant.
QuadExpr.Size()
Get number of terms in quadratic expression.
Synopsis
long Size()
Return
number of quadratic terms.