Expr.Expr()

Constructor of a constant linear expression with default constant value 0.

Synopsis

Expr(double constant)

Arguments

constant: optional, constant value in expression object.

Expr.Expr()

Constructor of a linear expression with one term.

Synopsis

Expr(Var var, double coeff)

Arguments

var: variable for the added term.

coeff: coefficent for the added term with default value 1.0.

Expr.AddConstant()

Add extra constant to the expression.

Synopsis

void AddConstant(double constant)

Arguments

constant: delta value to be added to expression constant.

Expr.AddExpr()

Add an expression to self.

Synopsis

void AddExpr(Expr expr, double mult)

Arguments

expr: expression to be added.

mult: multiply constant.

Expr.AddTerm()

Add a term to expression object.

Synopsis

void AddTerm(Var var, double coeff)

Arguments

var: a variable for new term.

coeff: coefficient for new term.

Expr.AddTerms()

Add terms to expression object.

Synopsis

void AddTerms(Var[] vars, double coeff)

Arguments

vars: variables for added terms.

coeff: coefficient array for added terms with default value 1.0.

Expr.AddTerms()

Add terms to expression object.

Synopsis

void AddTerms(Var[] vars, double[] coeffs)

Arguments

vars: variables for added terms.

coeffs: coefficients array for added terms.

Expr.AddTerms()

Add terms to expression object.

Synopsis

void AddTerms(VarArray vars, double coeff)

Arguments

vars: variables for added terms.

coeff: coefficient array for added terms with default value 1.0.

Expr.AddTerms()

Add terms to expression object.

Synopsis

void AddTerms(VarArray vars, double[] coeffs)

Arguments

vars: variables for added terms.

coeffs: coefficients array for added terms.

Expr.Clone()

Deep copy linear expression object.

Synopsis

Expr Clone()

Return

cloned linear expression object.

Expr.GetCoeff()

Get coefficient from the i-th term in expression.

Synopsis

double GetCoeff(int i)

Arguments

i: index of the term.

Return

coefficient of the i-th term in expression object.

Expr.GetConstant()

Get constant in expression.

Synopsis

double GetConstant()

Return

constant in expression.

Expr.GetVar()

Get variable from the i-th term in expression.

Synopsis

Var GetVar(int i)

Arguments

i: index of the term.

Return

variable of the i-th term in expression object.

Expr.Remove()

Remove idx-th term from expression object.

Synopsis

void Remove(int idx)

Arguments

idx: index of the term to be removed.

Expr.Remove()

Remove the term associated with variable from expression.

Synopsis

void Remove(Var var)

Arguments

var: a variable whose term should be removed.

Expr.SetCoeff()

Set coefficient for the i-th term in expression.

Synopsis

void SetCoeff(int i, double val)

Arguments

i: index of the term.

val: coefficient of the term.

Expr.SetConstant()

Set constant for the expression.

Synopsis

void SetConstant(double constant)

Arguments

constant: the value of the constant.

Expr.Size()

Get number of terms in expression.

Synopsis

long Size()

Return

number of terms.