DART
6.7.3
|
#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< FunctionPtr > | mEqConstraints |
Equality constraint functions. More... | |
std::vector< FunctionPtr > | mIneqConstraints |
Inequality constraint functions. More... | |
double | mOptimumValue |
Optimal objective value. More... | |
Eigen::VectorXd | mOptimalSolution |
Optimal solution. More... | |
class Problem
|
explicit |
Constructor.
|
virtualdefault |
Destructor.
void dart::optimizer::Problem::addEqConstraint | ( | FunctionPtr | _eqConst | ) |
Add equality constraint.
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.
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.
void dart::optimizer::Problem::clearAllSeeds | ( | ) |
Clear the seeds that this Problem currently contains.
std::size_t dart::optimizer::Problem::getDimension | ( | ) | const |
Get dimension.
FunctionPtr dart::optimizer::Problem::getEqConstraint | ( | std::size_t | _idx | ) | const |
Get equality constraint.
FunctionPtr dart::optimizer::Problem::getIneqConstraint | ( | std::size_t | _idx | ) | const |
Get inequality constraint.
const Eigen::VectorXd & dart::optimizer::Problem::getInitialGuess | ( | ) | const |
Set initial guess for opimization parameters.
const Eigen::VectorXd & dart::optimizer::Problem::getLowerBounds | ( | ) | const |
Get lower bounds for optimization parameters.
std::size_t dart::optimizer::Problem::getNumEqConstraints | ( | ) | const |
Get number of equality constraints.
std::size_t dart::optimizer::Problem::getNumIneqConstraints | ( | ) | const |
Get number of inequality constraints.
FunctionPtr dart::optimizer::Problem::getObjective | ( | ) | const |
Get objective function.
const Eigen::VectorXd & dart::optimizer::Problem::getOptimalSolution | ( | ) |
Get optimal solution.
double dart::optimizer::Problem::getOptimumValue | ( | ) | const |
Get optimum value of the objective function.
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.
const Eigen::VectorXd & dart::optimizer::Problem::getSeed | ( | std::size_t | _index | ) | const |
An immutable version of getSeed(std::size_t)
std::vector< Eigen::VectorXd > & dart::optimizer::Problem::getSeeds | ( | ) |
Get a mutable reference to the full vector of seeds that this Problem currently contains.
const std::vector< Eigen::VectorXd > & dart::optimizer::Problem::getSeeds | ( | ) | const |
An immutable version of getSeeds()
const Eigen::VectorXd & dart::optimizer::Problem::getUpperBounds | ( | ) | const |
Get upper bounds for optimization parameters.
void dart::optimizer::Problem::removeAllEqConstraints | ( | ) |
Remove all equality constraints.
void dart::optimizer::Problem::removeAllIneqConstraints | ( | ) |
Remove all inequality constraints.
void dart::optimizer::Problem::removeEqConstraint | ( | FunctionPtr | _eqConst | ) |
Remove equality constraint.
void dart::optimizer::Problem::removeIneqConstraint | ( | FunctionPtr | _ineqConst | ) |
Remove inequality constraint.
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.
void dart::optimizer::Problem::setInitialGuess | ( | const Eigen::VectorXd & | _initGuess | ) |
Set initial guess for opimization parameters.
void dart::optimizer::Problem::setLowerBounds | ( | const Eigen::VectorXd & | _lb | ) |
Set lower bounds for optimization parameters.
void dart::optimizer::Problem::setObjective | ( | FunctionPtr | _obj | ) |
Set minimum objective function.
void dart::optimizer::Problem::setOptimalSolution | ( | const Eigen::VectorXd & | _optParam | ) |
Set optimal solution. This function called by Solver.
void dart::optimizer::Problem::setOptimumValue | ( | double | _val | ) |
Set optimum value of the objective function.
This function called by Solver.
void dart::optimizer::Problem::setUpperBounds | ( | const Eigen::VectorXd & | _ub | ) |
Set upper bounds for optimization parameters.
|
protected |
Dimension of this problem.
|
protected |
Equality constraint functions.
|
protected |
Inequality constraint functions.
|
protected |
Initial guess for optimization parameters.
|
protected |
Lower bounds for optimization parameters.
|
protected |
Objective function.
|
protected |
Optimal solution.
|
protected |
Optimal objective value.
|
protected |
Additional guess hints for the Solver.
|
protected |
Upper bounds for optimization parameters.