DART
6.7.3
|
class NloptSolver More...
#include <NloptSolver.hpp>
Public Member Functions | |
NloptSolver (const Solver::Properties &_properties=Solver::Properties(), nlopt::algorithm _alg=nlopt::LN_COBYLA) | |
Default Constructor. More... | |
NloptSolver (std::shared_ptr< Problem > _problem, nlopt::algorithm _alg=nlopt::LN_COBYLA) | |
Alternative Constructor. More... | |
virtual | ~NloptSolver () |
Destructor. More... | |
bool | solve () override |
Solve optimization problem. More... | |
Eigen::VectorXd | getLastConfiguration () const |
std::string | getType () const override |
Get the type (implementation) of this Solver. More... | |
std::shared_ptr< Solver > | clone () const override |
Create an identical clone of this Solver. More... | |
void | copy (const NloptSolver &_other) |
Copy the Properties of another NloptSolver. More... | |
NloptSolver & | operator= (const NloptSolver &_other) |
Copy the Properties of another NloptSolver. More... | |
void | setAlgorithm (nlopt::algorithm _alg) |
Set the algorithm that is to be used by the nlopt solver. More... | |
nlopt::algorithm | getAlgorithm () const |
Get the algorithm that is to be used by the nlopt solver. More... | |
void | setProperties (const Properties &_properties) |
Set the generic Properties of this Solver. More... | |
const Properties & | getSolverProperties () const |
Get the generic Properties of this Solver. More... | |
void | copy (const Solver &_otherSolver) |
Copy the generic Properties of another Solver. More... | |
virtual void | setProblem (std::shared_ptr< Problem > _newProblem) |
Set the nonlinear optimization problem. More... | |
std::shared_ptr< Problem > | getProblem () const |
Get nonlinear optimization problem. More... | |
virtual void | setTolerance (double _newTolerance) |
Set the maximum step size allowed for the Problem to be considered converged. More... | |
double | getTolerance () const |
Get the maximum step size allowed for the Problem to be considered converged. More... | |
virtual void | setNumMaxIterations (std::size_t _newMax) |
Set the maximum number of iterations that the Solver should use. More... | |
std::size_t | getNumMaxIterations () const |
Get the maximum number of iterations that the Solver should use. More... | |
virtual void | setIterationsPerPrint (std::size_t _newRatio) |
Set the number of iterations that should pass between printing progress to the terminal. More... | |
std::size_t | getIterationsPerPrint () const |
Get the number of iterations that should pass between printing progress to the terminal. More... | |
virtual void | setOutStream (std::ostream *_os) |
Set the output stream that prints the Solver's progress. More... | |
std::ostream * | getOutStream () const |
Get the output stream that prints the Solver's progress. More... | |
virtual void | setPrintFinalResult (bool _print) |
Set to true if the final result should be printed to the terminal. More... | |
bool | getPrintFinalResult () const |
Returns true if the final result should be printed to the terminal. More... | |
virtual void | setResultFileName (const std::string &_resultFile) |
Set the name of the file that results should be printed to. More... | |
const std::string & | getResultFileName () const |
Get the name of the file that results should be printed to. More... | |
Protected Attributes | |
Properties | mProperties |
Static Private Member Functions | |
static double | _nlopt_func (unsigned _n, const double *_x, double *_gradient, void *_func_data) |
Wrapping function for nlopt callback function, nlopt_func. More... | |
static void | _nlopt_mfunc (unsigned _m, double *_result, unsigned _n, const double *_x, double *_gradient, void *_func_data) |
Wrapping function for nlopt callback function, nlopt_mfunc. More... | |
Private Attributes | |
std::unique_ptr< nlopt::opt > | mOpt |
NLOPT data structure. More... | |
nlopt::algorithm | mAlg |
Algorithm to be used by the nlopt::opt. More... | |
std::vector< double > | mX |
Optimization parameters. More... | |
double | mMinF |
Optimum value of the objective function. More... | |
class NloptSolver
dart::optimizer::NloptSolver::NloptSolver | ( | const Solver::Properties & | _properties = Solver::Properties() , |
nlopt::algorithm | _alg = nlopt::LN_COBYLA |
||
) |
Default Constructor.
dart::optimizer::NloptSolver::NloptSolver | ( | std::shared_ptr< Problem > | _problem, |
nlopt::algorithm | _alg = nlopt::LN_COBYLA |
||
) |
Alternative Constructor.
|
virtual |
Destructor.
|
staticprivate |
Wrapping function for nlopt callback function, nlopt_func.
|
staticprivate |
Wrapping function for nlopt callback function, nlopt_mfunc.
|
overridevirtual |
Create an identical clone of this Solver.
Implements dart::optimizer::Solver.
void dart::optimizer::NloptSolver::copy | ( | const NloptSolver & | _other | ) |
Copy the Properties of another NloptSolver.
|
inherited |
Copy the generic Properties of another Solver.
nlopt::algorithm dart::optimizer::NloptSolver::getAlgorithm | ( | ) | const |
Get the algorithm that is to be used by the nlopt solver.
|
inherited |
Get the number of iterations that should pass between printing progress to the terminal.
A value of 0 means there will be no printing.
Eigen::VectorXd dart::optimizer::NloptSolver::getLastConfiguration | ( | ) | const |
|
inherited |
Get the maximum number of iterations that the Solver should use.
|
inherited |
Get the output stream that prints the Solver's progress.
|
inherited |
Returns true if the final result should be printed to the terminal.
|
inherited |
Get nonlinear optimization problem.
|
inherited |
Get the name of the file that results should be printed to.
An empty string indicates that results should not be printed to a file.
|
inherited |
Get the generic Properties of this Solver.
|
inherited |
Get the maximum step size allowed for the Problem to be considered converged.
|
overridevirtual |
Get the type (implementation) of this Solver.
Implements dart::optimizer::Solver.
NloptSolver & dart::optimizer::NloptSolver::operator= | ( | const NloptSolver & | _other | ) |
Copy the Properties of another NloptSolver.
void dart::optimizer::NloptSolver::setAlgorithm | ( | nlopt::algorithm | _alg | ) |
Set the algorithm that is to be used by the nlopt solver.
|
virtualinherited |
Set the number of iterations that should pass between printing progress to the terminal.
Use 0 for no printing.
|
virtualinherited |
Set the maximum number of iterations that the Solver should use.
|
virtualinherited |
Set the output stream that prints the Solver's progress.
|
virtualinherited |
Set to true if the final result should be printed to the terminal.
|
virtualinherited |
Set the nonlinear optimization problem.
|
inherited |
Set the generic Properties of this Solver.
|
virtualinherited |
Set the name of the file that results should be printed to.
Use an empty string to indicate that results should not be printed to a file.
|
virtualinherited |
Set the maximum step size allowed for the Problem to be considered converged.
|
overridevirtual |
Solve optimization problem.
Implements dart::optimizer::Solver.
|
private |
Algorithm to be used by the nlopt::opt.
|
private |
Optimum value of the objective function.
|
private |
NLOPT data structure.
|
protectedinherited |
|
private |
Optimization parameters.