33 #ifndef DART_OPTIMIZER_PROBLEM_HPP_
34 #define DART_OPTIMIZER_PROBLEM_HPP_
39 #include <Eigen/Dense>
52 explicit Problem(std::size_t _dim = 0);
73 void addSeed(
const Eigen::VectorXd& _seed);
78 Eigen::VectorXd&
getSeed(std::size_t _index);
81 const Eigen::VectorXd&
getSeed(std::size_t _index)
const;
85 std::vector<Eigen::VectorXd>&
getSeeds();
88 const std::vector<Eigen::VectorXd>&
getSeeds()
const;
class Problem
Definition: Problem.hpp:48
void addIneqConstraint(FunctionPtr _ineqConst)
Add inequality constraint.
Definition: Problem.cpp:218
Eigen::VectorXd mInitialGuess
Initial guess for optimization parameters.
Definition: Problem.hpp:161
void setLowerBounds(const Eigen::VectorXd &_lb)
Set lower bounds for optimization parameters.
Definition: Problem.cpp:172
void setOptimalSolution(const Eigen::VectorXd &_optParam)
Set optimal solution. This function called by Solver.
Definition: Problem.cpp:297
std::size_t getNumIneqConstraints() const
Get number of inequality constraints.
Definition: Problem.cpp:231
FunctionPtr getObjective() const
Get objective function.
Definition: Problem.cpp:205
Problem(std::size_t _dim=0)
Constructor.
Definition: Problem.cpp:57
void removeAllEqConstraints()
Remove all equality constraints.
Definition: Problem.cpp:271
double mOptimumValue
Optimal objective value.
Definition: Problem.hpp:182
double getOptimumValue() const
Get optimum value of the objective function.
Definition: Problem.cpp:291
void setUpperBounds(const Eigen::VectorXd &_ub)
Set upper bounds for optimization parameters.
Definition: Problem.cpp:185
virtual ~Problem()=default
Destructor.
FunctionPtr getEqConstraint(std::size_t _idx) const
Get equality constraint.
Definition: Problem.cpp:237
std::size_t mDimension
Dimension of this problem.
Definition: Problem.hpp:158
Eigen::VectorXd mOptimalSolution
Optimal solution.
Definition: Problem.hpp:185
void setDimension(std::size_t _dim)
Set dimension.
Definition: Problem.cpp:65
std::vector< FunctionPtr > mEqConstraints
Equality constraint functions.
Definition: Problem.hpp:176
void addEqConstraint(FunctionPtr _eqConst)
Add equality constraint.
Definition: Problem.cpp:211
void removeEqConstraint(FunctionPtr _eqConst)
Remove equality constraint.
Definition: Problem.cpp:251
Eigen::VectorXd mLowerBounds
Lower bounds for optimization parameters.
Definition: Problem.hpp:167
std::size_t getDimension() const
Get dimension.
Definition: Problem.cpp:85
std::vector< Eigen::VectorXd > mSeeds
Additional guess hints for the Solver.
Definition: Problem.hpp:164
Eigen::VectorXd mUpperBounds
Upper bounds for optimization parameters.
Definition: Problem.hpp:170
Eigen::VectorXd & getSeed(std::size_t _index)
Get a mutable reference of the seed for the specified index.
Definition: Problem.cpp:130
void removeAllIneqConstraints()
Remove all inequality constraints.
Definition: Problem.cpp:278
const Eigen::VectorXd & getOptimalSolution()
Get optimal solution.
Definition: Problem.cpp:305
void addSeed(const Eigen::VectorXd &_seed)
Add a seed for the Solver to use as a hint for the neighborhood of the solution.
Definition: Problem.cpp:115
void clearAllSeeds()
Clear the seeds that this Problem currently contains.
Definition: Problem.cpp:166
const Eigen::VectorXd & getInitialGuess() const
Set initial guess for opimization parameters.
Definition: Problem.cpp:109
std::size_t getNumEqConstraints() const
Get number of equality constraints.
Definition: Problem.cpp:225
const Eigen::VectorXd & getUpperBounds() const
Get upper bounds for optimization parameters.
Definition: Problem.cpp:192
FunctionPtr getIneqConstraint(std::size_t _idx) const
Get inequality constraint.
Definition: Problem.cpp:244
void setInitialGuess(const Eigen::VectorXd &_initGuess)
Set initial guess for opimization parameters.
Definition: Problem.cpp:91
std::vector< Eigen::VectorXd > & getSeeds()
Get a mutable reference to the full vector of seeds that this Problem currently contains.
Definition: Problem.cpp:154
void removeIneqConstraint(FunctionPtr _ineqConst)
Remove inequality constraint.
Definition: Problem.cpp:261
std::vector< FunctionPtr > mIneqConstraints
Inequality constraint functions.
Definition: Problem.hpp:179
const Eigen::VectorXd & getLowerBounds() const
Get lower bounds for optimization parameters.
Definition: Problem.cpp:179
void setObjective(FunctionPtr _obj)
Set minimum objective function.
Definition: Problem.cpp:198
void setOptimumValue(double _val)
Set optimum value of the objective function.
Definition: Problem.cpp:285
FunctionPtr mObjective
Objective function.
Definition: Problem.hpp:173
std::shared_ptr< Function > FunctionPtr
Definition: Function.hpp:84
Definition: BulletCollisionDetector.cpp:63