Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
NloptSolver Class Referencefinal

#include <drake/solvers/nlopt_solver.h>

Public Types

using Details = NloptSolverDetails
 Type of details stored in MathematicalProgramResult.

Public Member Functions

 NloptSolver ()
 ~NloptSolver () final
Does not allow copy, move, or assignment
 NloptSolver (const NloptSolver &)=delete
NloptSolver & operator= (const NloptSolver &)=delete
 NloptSolver (NloptSolver &&)=delete
NloptSolver & operator= (NloptSolver &&)=delete
Public Member Functions inherited from SolverBase
 ~SolverBase () override
MathematicalProgramResult Solve (const MathematicalProgram &prog, const std::optional< Eigen::VectorXd > &initial_guess=std::nullopt, const std::optional< SolverOptions > &solver_options=std::nullopt) const
 Like SolverInterface::Solve(), but the result is a return value instead of an output argument.
void Solve (const MathematicalProgram &, const std::optional< Eigen::VectorXd > &, const std::optional< SolverOptions > &, MathematicalProgramResult *) const override
 Solves an optimization program with optional initial guess and solver options.
bool available () const override
 Returns true iff support for this solver has been compiled into Drake.
bool enabled () const override
 Returns true iff this solver is properly configured for use at runtime.
SolverId solver_id () const final
 Returns the identifier of this solver.
bool AreProgramAttributesSatisfied (const MathematicalProgram &) const override
 Returns true iff the program's attributes are compatible with this solver's capabilities.
std::string ExplainUnsatisfiedProgramAttributes (const MathematicalProgram &) const override
 Describes the reasons (if any) why the program is incompatible with this solver's capabilities.
 SolverBase (const SolverBase &)=delete
SolverBase & operator= (const SolverBase &)=delete
 SolverBase (SolverBase &&)=delete
SolverBase & operator= (SolverBase &&)=delete
Public Member Functions inherited from SolverInterface
virtual ~SolverInterface ()
 SolverInterface (const SolverInterface &)=delete
SolverInterface & operator= (const SolverInterface &)=delete
 SolverInterface (SolverInterface &&)=delete
SolverInterface & operator= (SolverInterface &&)=delete

Static Public Member Functions

static std::string ConstraintToleranceName ()
 The key name for the double-valued constraint tolerance.
static std::string XRelativeToleranceName ()
 The key name for double-valued x relative tolerance.
static std::string XAbsoluteToleranceName ()
 The key name for double-valued x absolute tolerance.
static std::string FRelativeToleranceName ()
 The key name for the double-valued relative tolerance on the objective function value.
static std::string FAbsoluteToleranceName ()
 The key name for the double-valued absolute tolerance on the objective function value.
static std::string MaxEvalName ()
 The key name for int-valued maximum number of evaluations.
static std::string MaxTimeName ()
 The key name for the maximum runtime.
static std::string StopValName ()
 The key name for the double-valued target objective value.
static std::string AlgorithmName ()
 The key name for the string-valued algorithm.
static std::string LocalOptimizerAlgorithmName ()
 The key name for the string-valued algorithm of the local (inner) optimizer.
static std::string LocalOptimizerXRelativeToleranceName ()
 The key name for the double-valued x relative tolerance of the local (inner) optimizer.
static std::string LocalOptimizerXAbsoluteToleranceName ()
 The key name for the double-valued x absolute tolerance of the local (inner) optimizer.
static std::string LocalOptimizerFRelativeToleranceName ()
 The key name for the double-valued relative tolerance on the objective function value of the local (inner) optimizer.
static std::string LocalOptimizerFAbsoluteToleranceName ()
 The key name for the double-valued absolute tolerance on the objective function value of the local (inner) optimizer.
static std::string LocalOptimizerMaxEvalName ()
 The key name for the int-valued maximum number of evaluations of the local (inner) optimizer.
static std::string LocalOptimizerMaxTimeName ()
 The key name for the maximum runtime of the local (inner) optimizer.

Static versions of the instance methods with similar names.

MathematicalProgramResult Solve (const MathematicalProgram &prog, const std::optional< Eigen::VectorXd > &initial_guess=std::nullopt, const std::optional< SolverOptions > &solver_options=std::nullopt) const
 Like SolverInterface::Solve(), but the result is a return value instead of an output argument.
void Solve (const MathematicalProgram &, const std::optional< Eigen::VectorXd > &, const std::optional< SolverOptions > &, MathematicalProgramResult *) const override
 Solves an optimization program with optional initial guess and solver options.
static SolverId id ()
static bool is_available ()
static bool is_enabled ()
static bool ProgramAttributesSatisfied (const MathematicalProgram &)

Additional Inherited Members

Protected Member Functions inherited from SolverBase
 SolverBase (const SolverId &id, std::function< bool()> available, std::function< bool()> enabled, std::function< bool(const MathematicalProgram &)> are_satisfied, std::function< std::string(const MathematicalProgram &)> explain_unsatisfied=nullptr)
 Constructs a SolverBase with the given default implementations of the solver_id(), available(), enabled(), AreProgramAttributesSatisfied(), and ExplainUnsatisfiedProgramAttributes() methods.
virtual void DoSolve (const MathematicalProgram &prog, const Eigen::VectorXd &initial_guess, const SolverOptions &merged_options, MathematicalProgramResult *result) const
 Hook for subclasses to implement Solve.
Protected Member Functions inherited from SolverInterface
 SolverInterface ()

Member Typedef Documentation

◆ Details

Type of details stored in MathematicalProgramResult.

Constructor & Destructor Documentation

◆ NloptSolver() [1/3]

NloptSolver ( const NloptSolver & )
delete

◆ NloptSolver() [2/3]

NloptSolver ( NloptSolver && )
delete

◆ NloptSolver() [3/3]

NloptSolver ( )

◆ ~NloptSolver()

~NloptSolver ( )
final

Member Function Documentation

◆ AlgorithmName()

std::string AlgorithmName ( )
static

The key name for the string-valued algorithm.

◆ ConstraintToleranceName()

std::string ConstraintToleranceName ( )
static

The key name for the double-valued constraint tolerance.

◆ FAbsoluteToleranceName()

std::string FAbsoluteToleranceName ( )
static

The key name for the double-valued absolute tolerance on the objective function value.

The default value is 0, which disables this stopping criterion.

◆ FRelativeToleranceName()

std::string FRelativeToleranceName ( )
static

The key name for the double-valued relative tolerance on the objective function value.

The default value is 0, which disables this stopping criterion.

◆ id()

SolverId id ( )
static

◆ is_available()

bool is_available ( )
static

◆ is_enabled()

bool is_enabled ( )
static

◆ LocalOptimizerAlgorithmName()

std::string LocalOptimizerAlgorithmName ( )
static

The key name for the string-valued algorithm of the local (inner) optimizer.

Some NLopt algorithms – notably the augmented Lagrangian family (e.g. LD_AUGLAG_EQ) and the multi-level single-linkage family – work by handing a sequence of subproblems to a separate "local" optimizer; this option chooses that optimizer's algorithm. The default value is the empty string, which leaves NLopt's own default in place. Algorithms that do not use a local optimizer ignore this option, as do the other LocalOptimizer... options below whenever this one is empty.

◆ LocalOptimizerFAbsoluteToleranceName()

std::string LocalOptimizerFAbsoluteToleranceName ( )
static

The key name for the double-valued absolute tolerance on the objective function value of the local (inner) optimizer.

The default value is 0, which disables this stopping criterion.

◆ LocalOptimizerFRelativeToleranceName()

std::string LocalOptimizerFRelativeToleranceName ( )
static

The key name for the double-valued relative tolerance on the objective function value of the local (inner) optimizer.

The default value is 0, which disables this stopping criterion.

◆ LocalOptimizerMaxEvalName()

std::string LocalOptimizerMaxEvalName ( )
static

The key name for the int-valued maximum number of evaluations of the local (inner) optimizer.

By default there is no maximum; a nonpositive value means no maximum. Setting a positive value truncates each subproblem solve, which lets the outer algorithm make progress more often instead of solving the first subproblem to convergence.

◆ LocalOptimizerMaxTimeName()

std::string LocalOptimizerMaxTimeName ( )
static

The key name for the maximum runtime of the local (inner) optimizer.

By default there is no maximum runtime. A nonpositive value will be interpreted as no maximum runtime.

◆ LocalOptimizerXAbsoluteToleranceName()

std::string LocalOptimizerXAbsoluteToleranceName ( )
static

The key name for the double-valued x absolute tolerance of the local (inner) optimizer.

◆ LocalOptimizerXRelativeToleranceName()

std::string LocalOptimizerXRelativeToleranceName ( )
static

The key name for the double-valued x relative tolerance of the local (inner) optimizer.

◆ MaxEvalName()

std::string MaxEvalName ( )
static

The key name for int-valued maximum number of evaluations.

◆ MaxTimeName()

std::string MaxTimeName ( )
static

The key name for the maximum runtime.

By default, there is no maximum runtime. A nonpositive value will be interpreted as no maximum runtime.

◆ operator=() [1/2]

NloptSolver & operator= ( const NloptSolver & )
delete

◆ operator=() [2/2]

NloptSolver & operator= ( NloptSolver && )
delete

◆ ProgramAttributesSatisfied()

bool ProgramAttributesSatisfied ( const MathematicalProgram & )
static

◆ Solve() [1/2]

void Solve ( const MathematicalProgram & prog,
const std::optional< Eigen::VectorXd > & initial_guess,
const std::optional< SolverOptions > & solver_options,
MathematicalProgramResult * result ) const
overridevirtual

Solves an optimization program with optional initial guess and solver options.

Note that these initial guess and solver options are not written to prog. If the prog has set an initial guess, and initial_guess is set, then initial_guess takes priority. If the prog has set an option for a solver, and solver_options contains a different value for the same option on the same solver, then solver_options takes priority. Derived implementations of this interface may elect to throw std::exception for badly formed programs.

Implements SolverInterface.

◆ Solve() [2/2]

MathematicalProgramResult Solve ( const MathematicalProgram & prog,
const std::optional< Eigen::VectorXd > & initial_guess = std::nullopt,
const std::optional< SolverOptions > & solver_options = std::nullopt ) const

Like SolverInterface::Solve(), but the result is a return value instead of an output argument.

◆ StopValName()

std::string StopValName ( )
static

The key name for the double-valued target objective value.

Because Drake always minimizes, the solve stops as soon as it finds a point whose cost is less than or equal to this value; it is a "good enough, stop here" target, not a bound that the solver enforces. The default value is negative infinity, so that the criterion never triggers. There is no local (inner) optimizer counterpart, because the algorithms that use a local optimizer derive its target from this option.

◆ XAbsoluteToleranceName()

std::string XAbsoluteToleranceName ( )
static

The key name for double-valued x absolute tolerance.

◆ XRelativeToleranceName()

std::string XRelativeToleranceName ( )
static

The key name for double-valued x relative tolerance.


The documentation for this class was generated from the following file: