dart
|
#include <Problem.hpp>
Public Member Functions | |
Problem (std::size_t _dim=0) | |
Constructor. | |
virtual | ~Problem ()=default |
Destructor. | |
void | setDimension (std::size_t _dim) |
Set dimension. More... | |
std::size_t | getDimension () const |
Get dimension. | |
void | setInitialGuess (const Eigen::VectorXd &_initGuess) |
Set initial guess for opimization parameters. | |
const Eigen::VectorXd & | getInitialGuess () const |
Set initial guess for opimization parameters. | |
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) | |
std::vector< Eigen::VectorXd > & | getSeeds () |
Get a mutable reference to the full vector of seeds that this Problem currently contains. | |
const std::vector< Eigen::VectorXd > & | getSeeds () const |
An immutable version of getSeeds() | |
void | clearAllSeeds () |
Clear the seeds that this Problem currently contains. | |
void | setLowerBounds (const Eigen::VectorXd &_lb) |
Set lower bounds for optimization parameters. | |
const Eigen::VectorXd & | getLowerBounds () const |
Get lower bounds for optimization parameters. | |
void | setUpperBounds (const Eigen::VectorXd &_ub) |
Set upper bounds for optimization parameters. | |
const Eigen::VectorXd & | getUpperBounds () const |
Get upper bounds for optimization parameters. | |
void | setObjective (FunctionPtr _obj) |
Set minimum objective function. | |
FunctionPtr | getObjective () const |
Get objective function. | |
void | addEqConstraint (FunctionPtr _eqConst) |
Add equality constraint. | |
void | addIneqConstraint (FunctionPtr _ineqConst) |
Add inequality constraint. More... | |
std::size_t | getNumEqConstraints () const |
Get number of equality constraints. | |
std::size_t | getNumIneqConstraints () const |
Get number of inequality constraints. | |
FunctionPtr | getEqConstraint (std::size_t _idx) const |
Get equality constraint. | |
FunctionPtr | getIneqConstraint (std::size_t _idx) const |
Get inequality constraint. | |
void | removeEqConstraint (FunctionPtr _eqConst) |
Remove equality constraint. | |
void | removeIneqConstraint (FunctionPtr _ineqConst) |
Remove inequality constraint. | |
void | removeAllEqConstraints () |
Remove all equality constraints. | |
void | removeAllIneqConstraints () |
Remove all inequality constraints. | |
void | setOptimumValue (double _val) |
Set optimum value of the objective function. More... | |
double | getOptimumValue () const |
Get optimum value of the objective function. | |
void | setOptimalSolution (const Eigen::VectorXd &_optParam) |
Set optimal solution. This function called by Solver. | |
const Eigen::VectorXd & | getOptimalSolution () |
Get optimal solution. | |
Protected Attributes | |
std::size_t | mDimension |
Dimension of this problem. | |
Eigen::VectorXd | mInitialGuess |
Initial guess for optimization parameters. | |
std::vector< Eigen::VectorXd > | mSeeds |
Additional guess hints for the Solver. | |
Eigen::VectorXd | mLowerBounds |
Lower bounds for optimization parameters. | |
Eigen::VectorXd | mUpperBounds |
Upper bounds for optimization parameters. | |
FunctionPtr | mObjective |
Objective function. | |
std::vector< FunctionPtr > | mEqConstraints |
Equality constraint functions. | |
std::vector< FunctionPtr > | mIneqConstraints |
Inequality constraint functions. | |
double | mOptimumValue |
Optimal objective value. | |
Eigen::VectorXd | mOptimalSolution |
Optimal solution. | |
class Problem
void dart::optimization::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::optimization::Problem::addSeed | ( | const Eigen::VectorXd & | _seed | ) |
Add a seed for the Solver to use as a hint for the neighborhood of the solution.
Eigen::VectorXd & dart::optimization::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.
void dart::optimization::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::optimization::Problem::setOptimumValue | ( | double | _val | ) |
Set optimum value of the objective function.
This function called by Solver.