MExpression::MExpression()
Construct a MExpression object with the given constant.
Synopsis
MExpression(double constant)
Arguments
constant
: constant number.
MExpression::MExpression()
Construct a MExpression object with the given linear expression.
Synopsis
MExpression(const Expr &expr)
Arguments
expr
: a linear expression.
MExpression::MExpression()
Construct a MExpression object with the given variable.
Synopsis
MExpression(const Var &var)
Arguments
var
: variable object.
MExpression::AddConstant()
Add constant for the expression.
Synopsis
void AddConstant(double constant)
Arguments
constant
: the value of the constant.
MExpression::AddExpr()
Add a linear expression to MExpression object.
Synopsis
void AddExpr(const Expr &expr, double mult)
Arguments
expr
: linear expression object.
mult
: the multiplier of linear expression, default value is 1.0.
MExpression::AddMExpr()
Add MExpression to MExpression object.
Synopsis
void AddMExpr(const MExpression &expr, double mult)
Arguments
expr
: MExpression object.
mult
: the multiplier of MExpression, default value is 1.0.
MExpression::AddTerm()
Add a linear term to MExpression object.
Synopsis
void AddTerm(const Var &var, double coeff)
Arguments
var
: variable of new term.
coeff
: coefficient of new term.
MExpression::Clone()
Clone MExpression object.
Synopsis
MExpression Clone()
Return
new MExpression object.
MExpression::GetConstant()
Get constant in expression.
Synopsis
double GetConstant()
Return
constant in expression.
MExpression::Represent()
String representation of MExpression object.
Synopsis
std::string Represent(size_t maxlen)
Arguments
maxlen
: max length of representation.Return
string object.
MExpression::SetConstant()
Set constant for the expression.
Synopsis
void SetConstant(double constant)
Arguments
constant
: the value of the constant.