MQExpression::MQExpression()
Construct a MQExpression object with the given constant.
Synopsis
MQExpression(double constant)
Arguments
constant
: constant number.
MQExpression::MQExpression()
Construct a MQExpression object with the given quadratic expression.
Synopsis
MQExpression(const QuadExpr &expr)
Arguments
expr
: a quadratic expression.
MQExpression::AddConstant()
Add constant for the expression.
Synopsis
void AddConstant(double constant)
Arguments
constant
: the value of the constant.
MQExpression::AddExpr()
Add a linear expression to MQExpression 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.
MQExpression::AddMExpr()
Add MExpression to MQExpression object.
Synopsis
void AddMExpr(const MExpression &expr, double mult)
Arguments
expr
: MExpression object.
mult
: the multiplier of MExpression, default value is 1.0.
MQExpression::AddMQExpr()
Add MQExpression to MQExpression object.
Synopsis
void AddMQExpr(const MQExpression &expr, double mult)
Arguments
expr
: MQExpression object.
mult
: the multiplier of MQExpression, default value is 1.0.
MQExpression::AddQuadExpr()
Add a quadratic expression to MQExpression object.
Synopsis
void AddQuadExpr(const MExpression &left, const MExpression &right)
Arguments
left
: left MExpression object.
right
: right MExpression object.
MQExpression::AddQuadExpr()
Add a quadratic expression to MQExpression object.
Synopsis
void AddQuadExpr(const QuadExpr &expr, double mult)
Arguments
expr
: quadratic expression object.
mult
: the multiplier of quadratic expression, default value is 1.0.
MQExpression::AddQuadExpr()
Add a quadratic expression to MQExpression object.
Synopsis
void AddQuadExpr(const MExpression &expr, const Var &var)
Arguments
expr
: MExpression object.
var
: Var object.
MQExpression::AddQuadExpr()
Add a quadratic expression to MQExpression object.
Synopsis
void AddQuadExpr(const MExpression &left, const Expr &right)
Arguments
left
: MExpression object.
right
: Expr object.
MQExpression::AddTerm()
Add a linear term to MQExpression object.
Synopsis
void AddTerm(const Var &var, double coeff)
Arguments
var
: variable of new term.
coeff
: coefficient of new term.
MQExpression::AddTerm()
Add a quadratic term to MQExpression object.
Synopsis
void AddTerm(
const Var &var1,
const 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.
MQExpression::Clone()
Clone MQExpression object.
Synopsis
MQExpression Clone()
Return
new MQExpression object.
MQExpression::GetConstant()
Get constant in expression.
Synopsis
double GetConstant()
Return
constant in expression.
MQExpression::Represent()
String representation of MQExpression object.
Synopsis
std::string Represent(size_t maxlen)
Arguments
maxlen
: max length of representation.Return
string object.