Drake
SolverInterface Class Referenceabstract

Interface used by implementations of individual solvers. More...

#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 SolutionResult Solve (MathematicalProgram &prog) const =0
 Sets values for the decision variables on the given MathematicalProgram prog, or: More...
 
virtual void Solve (const MathematicalProgram &prog, const optional< Eigen::VectorXd > &initial_guess, const 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 ()
 

Detailed Description

Interface used by implementations of individual solvers.

Constructor & Destructor Documentation

◆ SolverInterface() [1/3]

SolverInterface ( const SolverInterface )
delete

◆ SolverInterface() [2/3]

◆ ~SolverInterface()

~SolverInterface ( )
virtualdefault

◆ SolverInterface() [3/3]

SolverInterface ( )
protecteddefault

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.

Implemented in SolverBase.

◆ operator=() [1/2]

SolverInterface& operator= ( SolverInterface &&  )
delete

◆ operator=() [2/2]

SolverInterface& operator= ( const SolverInterface )
delete

◆ Solve() [1/2]

virtual SolutionResult Solve ( MathematicalProgram prog) const
pure virtual

Sets values for the decision variables on the given MathematicalProgram prog, or:

  • If no solver is available, throws std::runtime_error
  • If the solver returns an error, returns a nonzero SolutionResult.

Implemented in GurobiSolver, and SolverBase.

◆ Solve() [2/2]

virtual void Solve ( const MathematicalProgram prog,
const optional< Eigen::VectorXd > &  initial_guess,
const 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 files: