NlExpr::NlExpr()
Constructor of a nonlinear expression with a constant.
Synopsis
NlExpr(double constant)
Arguments
constant
: constant value in nonlinear expression object.
NlExpr::NlExpr()
Constructor of a nonlinear expression with one linear term.
Synopsis
NlExpr(const Var &var, double coeff)
Arguments
var
: variable for the added term.
coeff
: coefficent for the added term.
NlExpr::NlExpr()
Constructor of a nonlinear expression with a linear expression.
Synopsis
NlExpr(const Expr &expr)
Arguments
expr
: linear expression.
NlExpr::NlExpr()
Constructor of a nonlinear expression with a quadratic expression.
Synopsis
NlExpr(const QuadExpr &expr)
Arguments
expr
: quadratic expression.
NlExpr::AddConstant()
Add constant to the nonlinear expression.
Synopsis
void AddConstant(double constant)
Arguments
constant
: value to be added.
NlExpr::AddLinExpr()
Add a linear expression to self.
Synopsis
void AddLinExpr(const Expr &expr, double mult)
Arguments
expr
: linear expression to be added.
mult
: optional, constant multiplier, default value is 1.0.
NlExpr::AddNlExpr()
Add a nonlinear expression to self.
Synopsis
void AddNlExpr(const NlExpr &expr, double mult)
Arguments
expr
: nonlinear expression to be added.
mult
: optional, constant multiplier, default value is 1.0.
NlExpr::AddQuadExpr()
Add a quadratic expression to self.
Synopsis
void AddQuadExpr(const QuadExpr &expr, double mult)
Arguments
expr
: quadratic expression to be added.
mult
: optional, constant multiplier, default value is 1.0.
NlExpr::AddTerm()
Add a linear term to nonlinear expression object.
Synopsis
void AddTerm(const Var &var, double coeff)
Arguments
var
: variable of new linear term.
coeff
: coefficient of new linear term.
NlExpr::AddTerms()
Add linear terms to nonlinear expression object.
Synopsis
int AddTerms(
const VarArray &vars,
double *pCoeff,
int len)
Arguments
vars
: variables for added linear terms.
pCoeff
: coefficient array for added linear terms.
len
: length of coefficient array.Return
number of added linear terms.
NlExpr::Clear()
Clear nonlinear expression object.
Synopsis
void Clear()
NlExpr::Clone()
Deep copy nonlinear expression object.
Synopsis
NlExpr Clone()
Return
cloned nonlinear expression object.
NlExpr::GetConstant()
Get constant in nonlinear expression.
Synopsis
double GetConstant()
Return
constant in nonlinear expression.
NlExpr::GetLinExpr()
Get linear expression in nonlinear expression.
Synopsis
Expr &GetLinExpr()
Return
linear expression object.
NlExpr::operator*=()
Multiply a nonlinear expression to self.
Synopsis
void operator*=(const NlExpr &expr)
Arguments
expr
: nonlinear expression for multiplication, including double, Var, Expr, QuadExpr and NlExpr.
NlExpr::operator*()
Multiply expression and return new nonlinear expression.
Synopsis
NlExpr operator*(const NlExpr &other)
Arguments
other
: operand of multiplication, including double, Var, Expr, QuadExpr and NlExpr.Return
result expression.
NlExpr::operator/=()
Divide a nonlinear expression by self.
Synopsis
void operator/=(const NlExpr &expr)
Arguments
expr
: nonlinear expression for multiplication, including double, Var, Expr, QuadExpr and NlExpr.
NlExpr::operator/()
Divide an expression and return new nonlinear expression.
Synopsis
NlExpr operator/(const NlExpr &other)
Arguments
other
: operand of division, including double, Var, Expr, QuadExpr and NlExpr.Return
result expression.
NlExpr::operator+=()
Add an expression to self.
Synopsis
void operator+=(const NlExpr &expr)
Arguments
expr
: nonlinear expression for addition, including double, Var, Expr, QuadExpr and NlExpr.
NlExpr::operator+()
Add expression and return new expression.
Synopsis
NlExpr operator+(const NlExpr &other)
Arguments
other
: operand of addition, including double, Var, Expr, QuadExpr and NlExpr.Return
result expression.
NlExpr::operator-=()
Substract an expression from self.
Synopsis
void operator-=(const NlExpr &expr)
Arguments
expr
: nonlinear expression for substraction, including double, Var, Expr, QuadExpr and NlExpr.
NlExpr::operator-()
Substract expression and return new expression.
Synopsis
NlExpr operator-(const NlExpr &other)
Arguments
other
: operand of substraction, including double, Var, Expr, QuadExpr and NlExpr.Return
result expression.
NlExpr::Reserve()
Reserve capacity to contain at least n items.
Synopsis
void Reserve(size_t n)
Arguments
n
: minimum capacity for nonlinear expression object.
NlExpr::SetConstant()
Set constant for the nonlinear expression.
Synopsis
void SetConstant(double constant)
Arguments
constant
: the value of the constant.
NlExpr::Size()
Get size of tokens in nonlinear expression.
Synopsis
size_t Size()
Return
size of none-linear tokens.