33 #ifndef DART_OPTIMIZER_PROBLEM_HPP_
34 #define DART_OPTIMIZER_PROBLEM_HPP_
39 #include <Eigen/Dense>
51 explicit Problem(std::size_t _dim = 0);
72 void addSeed(
const Eigen::VectorXd& _seed);
77 Eigen::VectorXd&
getSeed(std::size_t _index);
80 const Eigen::VectorXd&
getSeed(std::size_t _index)
const;
84 std::vector<Eigen::VectorXd>&
getSeeds();
87 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:160
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:295
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:58
void removeAllEqConstraints()
Remove all equality constraints.
Definition: Problem.cpp:269
double mOptimumValue
Optimal objective value.
Definition: Problem.hpp:181
double getOptimumValue() const
Get optimum value of the objective function.
Definition: Problem.cpp:289
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:157
Eigen::VectorXd mOptimalSolution
Optimal solution.
Definition: Problem.hpp:184
void setDimension(std::size_t _dim)
Set dimension.
Definition: Problem.cpp:64
std::vector< FunctionPtr > mEqConstraints
Equality constraint functions.
Definition: Problem.hpp:175
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:166
std::size_t getDimension() const
Get dimension.
Definition: Problem.cpp:84
std::vector< Eigen::VectorXd > mSeeds
Additional guess hints for the Solver.
Definition: Problem.hpp:163
Eigen::VectorXd mUpperBounds
Upper bounds for optimization parameters.
Definition: Problem.hpp:169
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:276
const Eigen::VectorXd & getOptimalSolution()
Get optimal solution.
Definition: Problem.cpp:304
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:90
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:260
std::vector< FunctionPtr > mIneqConstraints
Inequality constraint functions.
Definition: Problem.hpp:178
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:283
FunctionPtr mObjective
Objective function.
Definition: Problem.hpp:172
std::shared_ptr< Function > FunctionPtr
Definition: Function.hpp:84
Definition: BulletCollisionDetector.cpp:65