Simbody  3.6
SimTK::OptimizerSystem Class Reference

Abstract class which defines an objective/cost function which is optimized by and Optimizer object. More...

Public Member Functions

 OptimizerSystem ()
 
 OptimizerSystem (int nParameters)
 
virtual ~OptimizerSystem ()
 
virtual int objectiveFunc (const Vector &parameters, bool new_parameters, Real &f) const
 Objective/cost function which is to be optimized; return 0 when successful. More...
 
virtual int gradientFunc (const Vector &parameters, bool new_parameters, Vector &gradient) const
 Computes the gradient of the objective function; return 0 when successful. More...
 
virtual int constraintFunc (const Vector &parameters, bool new_parameters, Vector &constraints) const
 Computes the value of the constraints; return 0 when successful. More...
 
virtual int constraintJacobian (const Vector &parameters, bool new_parameters, Matrix &jac) const
 Computes Jacobian of the constraints; return 0 when successful. More...
 
virtual int hessian (const Vector &parameters, bool new_parameters, Vector &gradient) const
 Computes Hessian of the objective function; return 0 when successful. More...
 
void setNumParameters (const int nParameters)
 Sets the number of parameters in the objective function. More...
 
void setNumEqualityConstraints (const int n)
 Sets the number of equality constraints. More...
 
void setNumInequalityConstraints (const int n)
 Sets the number of inequality constraints. More...
 
void setNumLinearEqualityConstraints (const int n)
 Sets the number of lineaer equality constraints. More...
 
void setNumLinearInequalityConstraints (const int n)
 Sets the number of lineaer inequality constraints. More...
 
void setParameterLimits (const Vector &lower, const Vector &upper)
 Set the upper and lower bounds on the parameters. More...
 
int getNumParameters () const
 Returns the number of parameters, that is, the number of variables that the Optimizer may adjust while searching for a solution. More...
 
int getNumConstraints () const
 Returns the total number of constraints. More...
 
int getNumEqualityConstraints () const
 Returns the number of equality constraints. More...
 
int getNumInequalityConstraints () const
 Returns the number of inequality constraints. More...
 
int getNumLinearEqualityConstraints () const
 Returns the number of linear equality constraints. More...
 
int getNumNonlinearEqualityConstraints () const
 Returns the number of nonlinear equality constraints. More...
 
int getNumLinearInequalityConstraints () const
 Returns the number of linear inequality constraints. More...
 
int getNumNonlinearInequalityConstraints () const
 Returns the number of linear inequality constraints. More...
 
bool getHasLimits () const
 Returns true if there are limits on the parameters. More...
 
void getParameterLimits (Real **lower, Real **upper) const
 Returns the limits on the allowed values of each parameter, as an array of lower bounds and an array of upper bounds, with assumed lengths matching the number of parameters. More...
 

Detailed Description

Abstract class which defines an objective/cost function which is optimized by and Optimizer object.

The OptimizerSystem also defines any constraints which must be satisfied.

Constructor & Destructor Documentation

◆ OptimizerSystem() [1/2]

SimTK::OptimizerSystem::OptimizerSystem ( )
inline

◆ OptimizerSystem() [2/2]

SimTK::OptimizerSystem::OptimizerSystem ( int  nParameters)
inlineexplicit

◆ ~OptimizerSystem()

virtual SimTK::OptimizerSystem::~OptimizerSystem ( )
inlinevirtual

Member Function Documentation

◆ objectiveFunc()

virtual int SimTK::OptimizerSystem::objectiveFunc ( const Vector parameters,
bool  new_parameters,
Real f 
) const
inlinevirtual

Objective/cost function which is to be optimized; return 0 when successful.

The value of f upon entry into the function is undefined. This method must be supplied by concrete class.

◆ gradientFunc()

virtual int SimTK::OptimizerSystem::gradientFunc ( const Vector parameters,
bool  new_parameters,
Vector gradient 
) const
inlinevirtual

Computes the gradient of the objective function; return 0 when successful.

This method does not have to be supplied if a numerical gradient is used.

◆ constraintFunc()

virtual int SimTK::OptimizerSystem::constraintFunc ( const Vector parameters,
bool  new_parameters,
Vector constraints 
) const
inlinevirtual

Computes the value of the constraints; return 0 when successful.

This method must be supplied if the objective function has constraints.

◆ constraintJacobian()

virtual int SimTK::OptimizerSystem::constraintJacobian ( const Vector parameters,
bool  new_parameters,
Matrix jac 
) const
inlinevirtual

Computes Jacobian of the constraints; return 0 when successful.

This method does not have to be supplied if a numerical jacobian is used.

◆ hessian()

virtual int SimTK::OptimizerSystem::hessian ( const Vector parameters,
bool  new_parameters,
Vector gradient 
) const
inlinevirtual

Computes Hessian of the objective function; return 0 when successful.

This method does not have to be supplied if limited memory is used.

◆ setNumParameters()

void SimTK::OptimizerSystem::setNumParameters ( const int  nParameters)
inline

Sets the number of parameters in the objective function.

◆ setNumEqualityConstraints()

void SimTK::OptimizerSystem::setNumEqualityConstraints ( const int  n)
inline

Sets the number of equality constraints.

◆ setNumInequalityConstraints()

void SimTK::OptimizerSystem::setNumInequalityConstraints ( const int  n)
inline

Sets the number of inequality constraints.

◆ setNumLinearEqualityConstraints()

void SimTK::OptimizerSystem::setNumLinearEqualityConstraints ( const int  n)
inline

Sets the number of lineaer equality constraints.

◆ setNumLinearInequalityConstraints()

void SimTK::OptimizerSystem::setNumLinearInequalityConstraints ( const int  n)
inline

Sets the number of lineaer inequality constraints.

◆ setParameterLimits()

void SimTK::OptimizerSystem::setParameterLimits ( const Vector lower,
const Vector upper 
)
inline

Set the upper and lower bounds on the parameters.

◆ getNumParameters()

int SimTK::OptimizerSystem::getNumParameters ( ) const
inline

Returns the number of parameters, that is, the number of variables that the Optimizer may adjust while searching for a solution.

◆ getNumConstraints()

int SimTK::OptimizerSystem::getNumConstraints ( ) const
inline

Returns the total number of constraints.

◆ getNumEqualityConstraints()

int SimTK::OptimizerSystem::getNumEqualityConstraints ( ) const
inline

Returns the number of equality constraints.

◆ getNumInequalityConstraints()

int SimTK::OptimizerSystem::getNumInequalityConstraints ( ) const
inline

Returns the number of inequality constraints.

◆ getNumLinearEqualityConstraints()

int SimTK::OptimizerSystem::getNumLinearEqualityConstraints ( ) const
inline

Returns the number of linear equality constraints.

◆ getNumNonlinearEqualityConstraints()

int SimTK::OptimizerSystem::getNumNonlinearEqualityConstraints ( ) const
inline

Returns the number of nonlinear equality constraints.

◆ getNumLinearInequalityConstraints()

int SimTK::OptimizerSystem::getNumLinearInequalityConstraints ( ) const
inline

Returns the number of linear inequality constraints.

◆ getNumNonlinearInequalityConstraints()

int SimTK::OptimizerSystem::getNumNonlinearInequalityConstraints ( ) const
inline

Returns the number of linear inequality constraints.

◆ getHasLimits()

bool SimTK::OptimizerSystem::getHasLimits ( ) const
inline

Returns true if there are limits on the parameters.

◆ getParameterLimits()

void SimTK::OptimizerSystem::getParameterLimits ( Real **  lower,
Real **  upper 
) const
inline

Returns the limits on the allowed values of each parameter, as an array of lower bounds and an array of upper bounds, with assumed lengths matching the number of parameters.


The documentation for this class was generated from the following file: