Expr.Expr()

Constructor of a constant linear expression with constant 0.0

Synopsis

Expr()

Expr.Expr()

Constructor of a constant linear expression.

Synopsis

Expr(double constant)

Arguments

constant: constant value in expression object.

Expr.Expr()

Constructor of a linear expression with one term.

Synopsis

Expr(Var var)

Arguments

var: variable for the added term.

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.

Expr.add()

Add itself by a linear expression.

Synopsis

Expr add(Expr expr, double mult)

Arguments

expr: expression operand, including Expr, Var.

mult: constant multiplier.

Return

linear expression itself.

Expr.add()

Add itself by a linear expression.

Synopsis

Expr add(Expr expr)

Arguments

expr: expression operand, including Expr, Var and constant.

Return

linear expression itself.

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 a linear expression to self.

Synopsis

void addExpr(Expr expr)

Arguments

expr: linear expression to be added.

Expr.addExpr()

Add a linear expression to self.

Synopsis

void addExpr(Expr expr, double mult)

Arguments

expr: linear expression to be added.

mult: multiplier 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: one coefficient for added terms.

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: one coefficient for added terms.

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.divide()

Divide itself by double constant.

Synopsis

Expr divide(double c)

Arguments

c: constant operand.

Return

linear expression itself.

Expr.evaluate()

evaluate linear expression after solving.

Synopsis

double evaluate()

Return

value of linear expression.

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.multiply()

Multiply itself by double constant.

Synopsis

Expr multiply(double c)

Arguments

c: constant operand.

Return

linear expression itself.

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.