Drake

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 compiletime. 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  
SolverInterface &  operator= (const SolverInterface &)=delete 
SolverInterface (SolverInterface &&)=delete  
SolverInterface &  operator= (SolverInterface &&)=delete 
Protected Member Functions  
SolverInterface ()  

delete 

delete 

virtual 

protected 

pure virtual 
Returns true if the program attributes are satisfied by the solver's capability.
Implemented in SolverBase.

pure virtual 
Returns true iff this solver was enabled at compiletime.
Certain solvers may be excluded at compiletime due to licensing or linking restrictions. When this method returns false, the Solve method will throw.
Implemented in SolverBase.

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.

delete 

delete 

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.

pure virtual 
Returns the identifier of this solver.
Implemented in SolverBase.