|
| PolynomialFunction () |
| Default constructor.
|
|
| PolynomialFunction (CGraphPtr cg) |
| Expand polynomial from a computational graph.
|
|
| ~PolynomialFunction () |
| Destroy.
|
|
PolyFunPtr | clone () const |
| Make a clone.
|
|
void | add (ConstMonomialFunPtr m) |
| Add a monomial m to this polynomial. The monomial is first cloned.
|
|
NonlinearFunctionPtr | cloneWithVars (VariableConstIterator vbeg, int *err) const |
| Make a clone using new variables. More...
|
|
void | createCG () |
|
double | eval (const double *x, int *error) |
| Evaluate the function at a given point x. More...
|
|
void | evalGradient (const double *x, double *grad_f, int *error) |
| Evaluate and add gradient at a given point. More...
|
|
void | evalHessian (const double mult, const double *x, const LTHessStor *stor, double *values, int *error) |
| Evaluate and add hessian at a given point. More...
|
|
void | fillHessStor (LTHessStor *stor) |
| Fill sparsity of hessian into hessian storage. More...
|
|
void | fillJac (const double *x, double *values, int *error) |
| Evaluate and add gradient at a given point to the jacobian. More...
|
|
void | finalHessStor (const LTHessStor *stor) |
| Finalize hessian preparation. More...
|
|
void | getVars (VariableSet *) |
| Get variables used in this function. More...
|
|
double | getConstant () |
| Get the constant term.
|
|
FunctionType | getType () const |
| Return type of function. More...
|
|
bool | isEmpty () const |
| Return true if the constant is 0 and there are no terms.
|
|
void | multiply (ConstLinearFunctionPtr lf, double c) |
| Multiply with (lf + c), where lf is a linear function.
|
|
void | multiply (double c) |
| Multiply with c, a constant. More...
|
|
void | prepJac (VarSetConstIter vb, VarSetConstIter ve) |
| Prepare for evaluating sparse jacobian. More...
|
|
void | recCG_ (const CNode *cnode, double *c, MonomialVector *terms) |
|
void | recCGMult_ (MonomialVector *t1, MonomialVector *t2, double c1, double c2, MonomialVector *terms, double *c) |
|
double | removeConstant () |
| If the polynomial has a constant term, return it, and remove it from the polynomial.
|
|
void | removeLinear (LinearFunctionPtr lf) |
|
void | removeQuadratic (QuadraticFunctionPtr qf) |
|
MonomialConstIter | termsBegin () |
| Get an iterator to the first monomial.
|
|
MonomialConstIter | termsEnd () |
| Get an iterator to the last monomial.
|
|
void | write (std::ostream &out) const |
| Display. More...
|
|
void | add (const double c) |
| Add a constant. More...
|
|
void | add (ConstLinearFunctionPtr lf) |
| Add a linear function.
|
|
void | add (ConstQuadraticFunctionPtr qf) |
| Add a quadratic.
|
|
void | add (ConstPolyFunPtr p) |
| Add a polynomial to the polynomial.
|
|
void | multiply (ConstQuadraticFunctionPtr qf) |
| Multiply with a quadratic.
|
|
void | multiply (ConstPolyFunPtr p2) |
| Multiply with a polynomial.
|
|
PolyFunPtr | copyAdd (ConstPolyFunPtr p2) const |
| Add two polynomials. Creates a new polynomial.
|
|
PolyFunPtr | copyMinus (ConstPolyFunPtr p2) |
| create a copy of this polynomial and subtract from it a given polynomial
|
|
PolyFunPtr | copyMult (double c) |
| Multiply a polynomial with constant.
|
|
PolyFunPtr | copyMult (ConstLinearFunctionPtr l2) const |
| Multiply a linear function and polynomial function.
|
|
PolyFunPtr | copyMult (ConstQuadraticFunctionPtr q2) const |
| Multiply a polynomial with quadratic.
|
|
PolyFunPtr | copyMult (ConstPolyFunPtr p2) const |
| Multiply a polynomial with constant.
|
|
| NonlinearFunction () |
| Default constructor.
|
|
virtual | ~NonlinearFunction () |
| Destroy.
|
|
virtual void | addConst (const double d, int &err) |
| Add a constant to the function. More...
|
|
virtual void | sqrRoot (int &err) |
| Change the nonlinear function to its square-root. More...
|
|
virtual NonlinearFunctionPtr | cloneWithVars (VariableConstIterator vbeg, int *err) const =0 |
| Make a clone using new variables. More...
|
|
virtual void | computeBounds (double *lb, double *ub, int *error) |
| Calculate upper and lower bounds on the function using bounds of the variables. More...
|
|
virtual double | eval (const double *x, int *error)=0 |
| Evaluate the function at a given point x. More...
|
|
virtual void | evalGradient (const double *x, double *grad_f, int *error)=0 |
| Evaluate and add gradient at a given point. More...
|
|
virtual void | evalHessian (const double mult, const double *x, const LTHessStor *stor, double *values, int *error)=0 |
| Evaluate and add hessian at a given point. More...
|
|
virtual void | fillHessStor (LTHessStor *stor)=0 |
| Fill sparsity of hessian into hessian storage. More...
|
|
virtual void | fillJac (const double *x, double *values, int *error)=0 |
| Evaluate and add gradient at a given point to the jacobian. More...
|
|
virtual void | finalHessStor (const LTHessStor *stor)=0 |
| Finalize hessian preparation. More...
|
|
virtual std::string | getNlString (int *err) |
| Return a string in AMPL's .nl format (postfix notation) of this nonlinear function. More...
|
|
virtual double | getFixVarOffset (VariablePtr, double) |
| If a variable is fixed at a given value and removed, what is the constant (offset) needed to be added. More...
|
|
virtual FunctionType | getType () const |
| Return the type of function: polynomial, ... More...
|
|
virtual void | getVars (VariableSet *vars)=0 |
| Get variables used in this function. More...
|
|
virtual bool | hasVar (ConstVariablePtr v) const |
| Check if function contains a variable. More...
|
|
virtual bool | isSumOfSquares () const |
| Check if the function is a sum of square terms. More...
|
|
virtual void | multiply (double c)=0 |
| Multiply by a constant. More...
|
|
virtual size_t | numVars () |
| Return the number of variables in this function.
|
|
virtual void | prepJac (VarSetConstIter vbeg, VarSetConstIter vend)=0 |
| Prepare for evaluating sparse jacobian. More...
|
|
virtual void | removeVar (VariablePtr, double) |
| Remove a variable v from the function after fixing it to value val. More...
|
|
virtual void | subst (VariablePtr, VariablePtr, double) |
| Substitute a variable with another. More...
|
|
virtual NonlinearFunctionPtr | getPersp (VariablePtr z, double eps, int *err) const |
| Take perspective of this function with respect to a given variable. More...
|
|
virtual void | varBoundMods (double, double, VarBoundModVector &, SolveStatus *) |
| Tighten variables based on function bounds. More...
|
|
virtual VariableSet::iterator | varsBegin () |
| First iterator for variables. More...
|
|
virtual VariableSet::iterator | varsEnd () |
| Last iterator for variables. More...
|
|
virtual void | write (std::ostream &out) const |
| Display the nonlinear function. More...
|
|
PolynomialFunction represents functions of the form
, where
is a MonomialFunction.