|
|
| Function () |
| | Default constructor.
|
| |
|
| Function (LinearFunctionPtr lf) |
| | Construct a function using only a linear function.
|
| |
| | Function (LinearFunctionPtr lf, QuadraticFunctionPtr qf) |
| |
|
| Function (LinearFunctionPtr lf, NonlinearFunctionPtr nlf) |
| | Construct a function using a linear function and a nonlinear function.
|
| |
| | Function (LinearFunctionPtr lf, QuadraticFunctionPtr qf, NonlinearFunctionPtr nlf) |
| |
|
| Function (NonlinearFunctionPtr nlf) |
| | Construct a function using only a nonlinear function.
|
| |
|
virtual | ~Function () |
| | Destroy.
|
| |
| virtual FunctionPtr | cloneWithVars (VariableConstIterator vbeg, int *err) const |
| |
|
virtual FunctionPtr | cloneWithVarsPermute (VariableConstIterator vbeg, UIntVector variableaddress, int *err) const |
| | similar to above function, but for shuffling variables
|
| |
| virtual double | eval (const DoubleVector &x, int *error) const |
| |
|
virtual double | eval (const double *x, int *error) const |
| | Evaluate the function at a given point x.
|
| |
|
virtual void | prepJac () |
| |
| virtual void | evalGradient (const double *x, double *grad_f, int *error) const |
| |
|
virtual void | fillJac (const double *x, double *values, int *error) |
| |
| virtual UInt | getNumNzInHess () |
| |
| virtual bool | hasVar (VariablePtr var) const |
| |
| virtual FunctionType | getType () |
| |
| bool | isLinearIn (ConstVariablePtr v) |
| | Check if function is linear in a variable. More...
|
| |
|
virtual FunctionType | getVarFunType (ConstVariablePtr v) |
| |
|
virtual LinearFunctionPtr | getLinearFunction () const |
| | Return the linear part of the function.
|
| |
|
virtual QuadraticFunctionPtr | getQuadraticFunction () const |
| | Return the quadratic part of the function.
|
| |
|
virtual NonlinearFunctionPtr | getNonlinearFunction () const |
| | Return the nonlinear part of the function.
|
| |
|
VarSetConstIterator | varsBegin () |
| | Return a begin-iterator for the variables that are in this function.
|
| |
|
VarSetConstIterator | varsEnd () |
| | Return an end-iterator for the variables that are in this function.
|
| |
|
virtual UInt | getNumVars () const |
| | Return the number of variables that are in this function.
|
| |
| virtual void | evalHessian (const double mult, const double *x, const size_t *offset, double *values, int *error) |
| |
|
virtual void | evalHessian (double mult, const double *x, const LTHessStor *stor, double *values, int *error) |
| |
|
virtual void | fillHessOffset (size_t *offset, size_t &pos, std::set< ConstVariablePair, CompareVariablePair > &v_pairs) |
| | Fill in the values of offset, starting from position pos.
|
| |
|
virtual void | fillHessStor (LTHessStor *stor) |
| |
|
virtual void | finalHessStor (const LTHessStor *stor) |
| |
|
virtual void | changeLf (LinearFunctionPtr lf) |
| | Change the linear function part.
|
| |
|
virtual void | changeNlf (NonlinearFunctionPtr nlf) |
| | Change the nonlinear function part.
|
| |
|
virtual void | subst (VariablePtr out, VariablePtr in, double rat) |
| | Substitute a variable with another.
|
| |
| virtual void | operator*= (const double c) |
| |
| QuadraticFunctionPtr | removeQuadratic () |
| |
| LinearFunctionPtr | removeLinear () |
| |
| NonlinearFunctionPtr | removeNonlinear () |
| |
| void | add (ConstLinearFunctionPtr lPtr) |
| |
|
void | removeVar (VariablePtr v, double val) |
| |
|
double | getFixVarOffset (VariablePtr v, double val) |
| |
|
virtual void | write (std::ostream &out) const |
| | Express the function and send the output to the output stream "out".
|
| |
The class Function is meant to model functions that are used to specify constraints and objectives in a problem. A function can have three or more components: linear, quadratic and nonlinear. Each of these types is implemented as a separate class. A Function thus keeps a pointer to each of these components and has methods to consolidate methods of these components. For instance, a function evaluation will just call these evaluation routines of the components and add them together. If any of the individual components of a function (linear, quadratic, nonlinear) are modified, one should delete the existing function and create a new one as some of the data-structures may not get updated with the changes.