#include <Optimizer.h>
The OptimizerSystem also defines any constraints which must be satisfied.
Public Member Functions | |
OptimizerSystem () | |
OptimizerSystem (int nParameters) | |
virtual | ~OptimizerSystem () |
virtual int | objectiveFunc (const Vector ¶meters, const bool new_parameters, Real &f) const |
Objective/cost function which is to be optimized. | |
virtual int | gradientFunc (const Vector ¶meters, const bool new_parameters, Vector &gradient) const |
computes the gradient of the objective function this method does not have to be supplied if a numerical gradient is used | |
virtual int | constraintFunc (const Vector ¶meters, const bool new_parameters, Vector &constraints) const |
computes the value of the constraints this method must be supplied if the objective function has constraints | |
virtual int | constraintJacobian (const Vector ¶meters, const bool new_parameters, Matrix &jac) const |
computes jacobian of the constraints this method does not have to be supplied if a numerical jacobian is used | |
virtual int | hessian (const Vector ¶meters, const bool new_parameters, Vector &gradient) const |
computes Hessian of the objective function this method does not have to be supplied limited memory is used | |
virtual void | setNumParameters (const int nParameters) |
sets the number of paramters in the objective function | |
void | setNumEqualityConstraints (const int n) |
sets the number of equality constraints | |
void | setNumInequalityConstraints (const int n) |
sets the number of inequality constraints | |
void | setNumLinearEqualityConstraints (const int n) |
sets the number of lineaer equality constraints | |
void | setNumLinearInequalityConstraints (const int n) |
sets the number of lineaer inequality constraints | |
void | setParameterLimits (const Vector &lower, const Vector &upper) |
set the upper and lower bounds on the paramters | |
int | getNumParameters () const |
returns the number of paramters | |
int | getNumConstraints () const |
returns the total number of constraints | |
int | getNumEqualityConstraints () const |
returns the number of equality constraints | |
int | getNumInequalityConstraints () const |
returns the number of inequality constraints | |
int | getNumLinearEqualityConstraints () const |
returns the number of linear equality constraints | |
int | getNumNonlinearEqualityConstraints () const |
returns the number of nonlinear equality constraints | |
int | getNumLinearInequalityConstraints () const |
returns the number of linear inequality constraints | |
int | getNumNonlinearInequalityConstraints () const |
returns the number of linear inequality constraints | |
bool | getHasLimits () const |
returns a bool true if there are limits on the parameters | |
void | getParameterLimits (double **lower, double **upper) const |
returns the paramter limits | |
Public Attributes | |
int | numParameters |
int | numEqualityConstraints |
int | numInequalityConstraints |
int | numLinearEqualityConstraints |
int | numLinearInequalityConstraints |
bool | useLimits |
Vector * | lowerLimits |
Vector * | upperLimits |
OptimizerSystem | ( | ) | [inline] |
OptimizerSystem | ( | int | nParameters | ) | [inline] |
virtual ~OptimizerSystem | ( | ) | [inline, virtual] |
virtual int objectiveFunc | ( | const Vector & | parameters, | |
const bool | new_parameters, | |||
Real & | f | |||
) | const [inline, virtual] |
Objective/cost function which is to be optimized.
This method must be supplied by concreate class
References SimTK_THROW2.
virtual int gradientFunc | ( | const Vector & | parameters, | |
const bool | new_parameters, | |||
Vector & | gradient | |||
) | const [inline, virtual] |
computes the gradient of the objective function this method does not have to be supplied if a numerical gradient is used
References SimTK_THROW2.
virtual int constraintFunc | ( | const Vector & | parameters, | |
const bool | new_parameters, | |||
Vector & | constraints | |||
) | const [inline, virtual] |
computes the value of the constraints this method must be supplied if the objective function has constraints
References SimTK_THROW2.
virtual int constraintJacobian | ( | const Vector & | parameters, | |
const bool | new_parameters, | |||
Matrix & | jac | |||
) | const [inline, virtual] |
computes jacobian of the constraints this method does not have to be supplied if a numerical jacobian is used
References SimTK_THROW2.
virtual int hessian | ( | const Vector & | parameters, | |
const bool | new_parameters, | |||
Vector & | gradient | |||
) | const [inline, virtual] |
computes Hessian of the objective function this method does not have to be supplied limited memory is used
References SimTK_THROW2.
virtual void setNumParameters | ( | const int | nParameters | ) | [inline, virtual] |
void setNumEqualityConstraints | ( | const int | n | ) | [inline] |
sets the number of equality constraints
References SimTK_THROW3.
Referenced by ProblemSystem::ProblemSystem().
void setNumInequalityConstraints | ( | const int | n | ) | [inline] |
sets the number of inequality constraints
References SimTK_THROW3.
Referenced by ProblemSystem::ProblemSystem().
void setNumLinearEqualityConstraints | ( | const int | n | ) | [inline] |
void setNumLinearInequalityConstraints | ( | const int | n | ) | [inline] |
set the upper and lower bounds on the paramters
References SimTK_THROW5, and VectorBase::size().
Referenced by main().
int getNumParameters | ( | ) | const [inline] |
returns the number of paramters
int getNumConstraints | ( | ) | const [inline] |
returns the total number of constraints
int getNumEqualityConstraints | ( | ) | const [inline] |
returns the number of equality constraints
int getNumInequalityConstraints | ( | ) | const [inline] |
returns the number of inequality constraints
int getNumLinearEqualityConstraints | ( | ) | const [inline] |
returns the number of linear equality constraints
int getNumNonlinearEqualityConstraints | ( | ) | const [inline] |
returns the number of nonlinear equality constraints
int getNumLinearInequalityConstraints | ( | ) | const [inline] |
returns the number of linear inequality constraints
int getNumNonlinearInequalityConstraints | ( | ) | const [inline] |
returns the number of linear inequality constraints
bool getHasLimits | ( | ) | const [inline] |
returns a bool true if there are limits on the parameters
void getParameterLimits | ( | double ** | lower, | |
double ** | upper | |||
) | const [inline] |
returns the paramter limits
int numParameters |
Referenced by ProblemSystem::gradientFunc(), and ProblemSystem::objectiveFunc().
bool useLimits |