DART  6.10.1
dart::optimizer::Problem Class Reference

class Problem More...

#include <Problem.hpp>

Public Member Functions

 Problem (std::size_t _dim=0)
 Constructor. More...
 
virtual ~Problem ()=default
 Destructor. More...
 
void setDimension (std::size_t _dim)
 Set dimension. More...
 
std::size_t getDimension () const
 Get dimension. More...
 
void setInitialGuess (const Eigen::VectorXd &_initGuess)
 Set initial guess for opimization parameters. More...
 
const Eigen::VectorXd & getInitialGuess () const
 Set initial guess for opimization parameters. More...
 
void addSeed (const Eigen::VectorXd &_seed)
 Add a seed for the Solver to use as a hint for the neighborhood of the solution. More...
 
Eigen::VectorXd & getSeed (std::size_t _index)
 Get a mutable reference of the seed for the specified index. More...
 
const Eigen::VectorXd & getSeed (std::size_t _index) const
 An immutable version of getSeed(std::size_t) More...
 
std::vector< Eigen::VectorXd > & getSeeds ()
 Get a mutable reference to the full vector of seeds that this Problem currently contains. More...
 
const std::vector< Eigen::VectorXd > & getSeeds () const
 An immutable version of getSeeds() More...
 
void clearAllSeeds ()
 Clear the seeds that this Problem currently contains. More...
 
void setLowerBounds (const Eigen::VectorXd &_lb)
 Set lower bounds for optimization parameters. More...
 
const Eigen::VectorXd & getLowerBounds () const
 Get lower bounds for optimization parameters. More...
 
void setUpperBounds (const Eigen::VectorXd &_ub)
 Set upper bounds for optimization parameters. More...
 
const Eigen::VectorXd & getUpperBounds () const
 Get upper bounds for optimization parameters. More...
 
void setObjective (FunctionPtr _obj)
 Set minimum objective function. More...
 
FunctionPtr getObjective () const
 Get objective function. More...
 
void addEqConstraint (FunctionPtr _eqConst)
 Add equality constraint. More...
 
void addIneqConstraint (FunctionPtr _ineqConst)
 Add inequality constraint. More...
 
std::size_t getNumEqConstraints () const
 Get number of equality constraints. More...
 
std::size_t getNumIneqConstraints () const
 Get number of inequality constraints. More...
 
FunctionPtr getEqConstraint (std::size_t _idx) const
 Get equality constraint. More...
 
FunctionPtr getIneqConstraint (std::size_t _idx) const
 Get inequality constraint. More...
 
void removeEqConstraint (FunctionPtr _eqConst)
 Remove equality constraint. More...
 
void removeIneqConstraint (FunctionPtr _ineqConst)
 Remove inequality constraint. More...
 
void removeAllEqConstraints ()
 Remove all equality constraints. More...
 
void removeAllIneqConstraints ()
 Remove all inequality constraints. More...
 
void setOptimumValue (double _val)
 Set optimum value of the objective function. More...
 
double getOptimumValue () const
 Get optimum value of the objective function. More...
 
void setOptimalSolution (const Eigen::VectorXd &_optParam)
 Set optimal solution. This function called by Solver. More...
 
const Eigen::VectorXd & getOptimalSolution ()
 Get optimal solution. More...
 

Protected Attributes

std::size_t mDimension
 Dimension of this problem. More...
 
Eigen::VectorXd mInitialGuess
 Initial guess for optimization parameters. More...
 
std::vector< Eigen::VectorXd > mSeeds
 Additional guess hints for the Solver. More...
 
Eigen::VectorXd mLowerBounds
 Lower bounds for optimization parameters. More...
 
Eigen::VectorXd mUpperBounds
 Upper bounds for optimization parameters. More...
 
FunctionPtr mObjective
 Objective function. More...
 
std::vector< FunctionPtrmEqConstraints
 Equality constraint functions. More...
 
std::vector< FunctionPtrmIneqConstraints
 Inequality constraint functions. More...
 
double mOptimumValue
 Optimal objective value. More...
 
Eigen::VectorXd mOptimalSolution
 Optimal solution. More...
 

Detailed Description

class Problem

Constructor & Destructor Documentation

◆ Problem()

dart::optimizer::Problem::Problem ( std::size_t  _dim = 0)
explicit

Constructor.

◆ ~Problem()

virtual dart::optimizer::Problem::~Problem ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addEqConstraint()

void dart::optimizer::Problem::addEqConstraint ( FunctionPtr  _eqConst)

Add equality constraint.

◆ addIneqConstraint()

void dart::optimizer::Problem::addIneqConstraint ( FunctionPtr  _ineqConst)

Add inequality constraint.

Inequality constraints must evaluate to LESS THAN or equal to zero (within some tolerance) to be satisfied.

◆ addSeed()

void dart::optimizer::Problem::addSeed ( const Eigen::VectorXd &  _seed)

Add a seed for the Solver to use as a hint for the neighborhood of the solution.

◆ clearAllSeeds()

void dart::optimizer::Problem::clearAllSeeds ( )

Clear the seeds that this Problem currently contains.

◆ getDimension()

std::size_t dart::optimizer::Problem::getDimension ( ) const

Get dimension.

◆ getEqConstraint()

FunctionPtr dart::optimizer::Problem::getEqConstraint ( std::size_t  _idx) const

Get equality constraint.

◆ getIneqConstraint()

FunctionPtr dart::optimizer::Problem::getIneqConstraint ( std::size_t  _idx) const

Get inequality constraint.

◆ getInitialGuess()

const Eigen::VectorXd & dart::optimizer::Problem::getInitialGuess ( ) const

Set initial guess for opimization parameters.

◆ getLowerBounds()

const Eigen::VectorXd & dart::optimizer::Problem::getLowerBounds ( ) const

Get lower bounds for optimization parameters.

◆ getNumEqConstraints()

std::size_t dart::optimizer::Problem::getNumEqConstraints ( ) const

Get number of equality constraints.

◆ getNumIneqConstraints()

std::size_t dart::optimizer::Problem::getNumIneqConstraints ( ) const

Get number of inequality constraints.

◆ getObjective()

FunctionPtr dart::optimizer::Problem::getObjective ( ) const

Get objective function.

◆ getOptimalSolution()

const Eigen::VectorXd & dart::optimizer::Problem::getOptimalSolution ( )

Get optimal solution.

◆ getOptimumValue()

double dart::optimizer::Problem::getOptimumValue ( ) const

Get optimum value of the objective function.

◆ getSeed() [1/2]

Eigen::VectorXd & dart::optimizer::Problem::getSeed ( std::size_t  _index)

Get a mutable reference of the seed for the specified index.

If an out-of-bounds index is provided a warning will print, and a reference to the initial guess will be returned instead.

◆ getSeed() [2/2]

const Eigen::VectorXd & dart::optimizer::Problem::getSeed ( std::size_t  _index) const

An immutable version of getSeed(std::size_t)

◆ getSeeds() [1/2]

std::vector< Eigen::VectorXd > & dart::optimizer::Problem::getSeeds ( )

Get a mutable reference to the full vector of seeds that this Problem currently contains.

◆ getSeeds() [2/2]

const std::vector< Eigen::VectorXd > & dart::optimizer::Problem::getSeeds ( ) const

An immutable version of getSeeds()

◆ getUpperBounds()

const Eigen::VectorXd & dart::optimizer::Problem::getUpperBounds ( ) const

Get upper bounds for optimization parameters.

◆ removeAllEqConstraints()

void dart::optimizer::Problem::removeAllEqConstraints ( )

Remove all equality constraints.

◆ removeAllIneqConstraints()

void dart::optimizer::Problem::removeAllIneqConstraints ( )

Remove all inequality constraints.

◆ removeEqConstraint()

void dart::optimizer::Problem::removeEqConstraint ( FunctionPtr  _eqConst)

Remove equality constraint.

◆ removeIneqConstraint()

void dart::optimizer::Problem::removeIneqConstraint ( FunctionPtr  _ineqConst)

Remove inequality constraint.

◆ setDimension()

void dart::optimizer::Problem::setDimension ( std::size_t  _dim)

Set dimension.

Note: Changing the dimension will clear out the initial guess and any seeds that have been added.

◆ setInitialGuess()

void dart::optimizer::Problem::setInitialGuess ( const Eigen::VectorXd &  _initGuess)

Set initial guess for opimization parameters.

◆ setLowerBounds()

void dart::optimizer::Problem::setLowerBounds ( const Eigen::VectorXd &  _lb)

Set lower bounds for optimization parameters.

◆ setObjective()

void dart::optimizer::Problem::setObjective ( FunctionPtr  _obj)

Set minimum objective function.

◆ setOptimalSolution()

void dart::optimizer::Problem::setOptimalSolution ( const Eigen::VectorXd &  _optParam)

Set optimal solution. This function called by Solver.

◆ setOptimumValue()

void dart::optimizer::Problem::setOptimumValue ( double  _val)

Set optimum value of the objective function.

This function called by Solver.

◆ setUpperBounds()

void dart::optimizer::Problem::setUpperBounds ( const Eigen::VectorXd &  _ub)

Set upper bounds for optimization parameters.

Member Data Documentation

◆ mDimension

std::size_t dart::optimizer::Problem::mDimension
protected

Dimension of this problem.

◆ mEqConstraints

std::vector<FunctionPtr> dart::optimizer::Problem::mEqConstraints
protected

Equality constraint functions.

◆ mIneqConstraints

std::vector<FunctionPtr> dart::optimizer::Problem::mIneqConstraints
protected

Inequality constraint functions.

◆ mInitialGuess

Eigen::VectorXd dart::optimizer::Problem::mInitialGuess
protected

Initial guess for optimization parameters.

◆ mLowerBounds

Eigen::VectorXd dart::optimizer::Problem::mLowerBounds
protected

Lower bounds for optimization parameters.

◆ mObjective

FunctionPtr dart::optimizer::Problem::mObjective
protected

Objective function.

◆ mOptimalSolution

Eigen::VectorXd dart::optimizer::Problem::mOptimalSolution
protected

Optimal solution.

◆ mOptimumValue

double dart::optimizer::Problem::mOptimumValue
protected

Optimal objective value.

◆ mSeeds

std::vector<Eigen::VectorXd> dart::optimizer::Problem::mSeeds
protected

Additional guess hints for the Solver.

◆ mUpperBounds

Eigen::VectorXd dart::optimizer::Problem::mUpperBounds
protected

Upper bounds for optimization parameters.