Drake
SolverInterface Class Referenceabstract

Detailed Description

Interface used by implementations of individual solvers.

#include <drake/solvers/solver_interface.h>

Public Member Functions

virtual ~SolverInterface ()
 
virtual bool available () const =0
 Returns true iff this solver was enabled at compile-time. More...
 
virtual bool enabled () const =0
 Returns true iff this solver is enabled at runtime. More...
 
virtual void Solve (const MathematicalProgram &prog, const std::optional< Eigen::VectorXd > &initial_guess, const std::optional< SolverOptions > &solver_options, MathematicalProgramResult *result) const =0
 Solves an optimization program with optional initial guess and solver options. More...
 
virtual SolverId solver_id () const =0
 Returns the identifier of this solver. More...
 
virtual bool AreProgramAttributesSatisfied (const MathematicalProgram &prog) const =0
 Returns true if the program attributes are satisfied by the solver's capability. More...
 
Does not allow copy, move, or assignment
 SolverInterface (const SolverInterface &)=delete
 
SolverInterfaceoperator= (const SolverInterface &)=delete
 
 SolverInterface (SolverInterface &&)=delete
 
SolverInterfaceoperator= (SolverInterface &&)=delete
 

Protected Member Functions

 SolverInterface ()
 

Constructor & Destructor Documentation

◆ SolverInterface() [1/3]

SolverInterface ( const SolverInterface )
delete

◆ SolverInterface() [2/3]

◆ ~SolverInterface()

virtual ~SolverInterface ( )
virtual

◆ SolverInterface() [3/3]

SolverInterface ( )
protected

Member Function Documentation

◆ AreProgramAttributesSatisfied()

virtual bool AreProgramAttributesSatisfied ( const MathematicalProgram prog) const
pure virtual

Returns true if the program attributes are satisfied by the solver's capability.

Implemented in SolverBase.

◆ available()

virtual bool available ( ) const
pure virtual

Returns true iff this solver was enabled at compile-time.

Certain solvers may be excluded at compile-time due to licensing or linking restrictions. When this method returns false, the Solve method will throw.

Implemented in SolverBase.

◆ enabled()

virtual bool enabled ( ) const
pure virtual

Returns true iff this solver is enabled at runtime.

The toggle mechanism is specific to the solver in question, but typically uses an environment variable. When this method returns false, the Solve method will throw.

Implemented in SolverBase.

◆ operator=() [1/2]

SolverInterface& operator= ( SolverInterface &&  )
delete

◆ operator=() [2/2]

SolverInterface& operator= ( const SolverInterface )
delete

◆ Solve()

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

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 option for a solver, and solver_options contains a different value for the same option on the same solver, then solver_options takes priority.

Implemented in SolverBase.

◆ solver_id()

virtual SolverId solver_id ( ) const
pure virtual

Returns the identifier of this solver.

Implemented in SolverBase.


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