Drake
SolverResult Class Reference

This class is used by implementations of the class MathematicalProgramSolverInterface to report their results to the mathematical program. More...

#include <drake/solvers/solver_result.h>

Public Member Functions

 SolverResult (const SolverId &solver_id)
 
const SolverIdsolver_id () const
 
void set_decision_variable_values (const Eigen::Ref< const Eigen::VectorXd > &values)
 Sets the decision variable values. More...
 
const optional< Eigen::VectorXd > & decision_variable_values () const
 
void set_optimal_cost (double optimal_cost)
 Sets the optimal cost. More...
 
const optional< double > & optimal_cost () const
 
void set_optimal_cost_lower_bound (double val)
 Sets the lower bound of the optimal cost. More...
 
const optional< double > & optimal_cost_lower_bound () const
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 SolverResult (const SolverResult &)=default
 
SolverResultoperator= (const SolverResult &)=default
 
 SolverResult (SolverResult &&)=default
 
SolverResultoperator= (SolverResult &&)=default
 

Detailed Description

This class is used by implementations of the class MathematicalProgramSolverInterface to report their results to the mathematical program.

It is guaranteed to have a defined solver id; all other fields can be left undefined. Reading those values should be guarded by a test on whether the field has been defined.

Constructor & Destructor Documentation

◆ SolverResult() [1/3]

SolverResult ( const SolverResult )
default

◆ SolverResult() [2/3]

SolverResult ( SolverResult &&  )
default

◆ SolverResult() [3/3]

SolverResult ( const SolverId solver_id)
inlineexplicit

Member Function Documentation

◆ decision_variable_values()

const optional<Eigen::VectorXd>& decision_variable_values ( ) const
inline

◆ operator=() [1/2]

SolverResult& operator= ( const SolverResult )
default

◆ operator=() [2/2]

SolverResult& operator= ( SolverResult &&  )
default

◆ optimal_cost()

const optional<double>& optimal_cost ( ) const
inline

◆ optimal_cost_lower_bound()

const optional<double>& optimal_cost_lower_bound ( ) const
inline

◆ set_decision_variable_values()

void set_decision_variable_values ( const Eigen::Ref< const Eigen::VectorXd > &  values)

Sets the decision variable values.

Eventually the decision variable values in this class will be passed to MathematicalProgram, to set the values for ALL variables in the mathematical program, such that MathematicalProgram::decision_variables_(i) will have value values(i).

◆ set_optimal_cost()

void set_optimal_cost ( double  optimal_cost)
inline

Sets the optimal cost.

Eventually this optimal cost will be passed to MathematicalProgram, when calling MathematicalProgram::SetSolverResult(...);

◆ set_optimal_cost_lower_bound()

void set_optimal_cost_lower_bound ( double  val)
inline

Sets the lower bound of the optimal cost.

Eventually this lower bound of the optimal cost will be passed to MathematicalProgram, when calling MathematicalProgram::SetSolverResult(...); Some problems, such as mixed-integer convex program, can find a lower bound of its optimal cost, before finding the global optimal.

◆ solver_id()

const SolverId& solver_id ( ) const
inline

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