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/mathematical_program_solver_interface.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 ( const SolverResult & )
default
 SolverResult ( SolverResult && )
default
 SolverResult ( const SolverId & solver_id )
inlineexplicit

## Member Function Documentation

 const optional& decision_variable_values ( ) const
inline

Here is the caller graph for this function:

 SolverResult& operator= ( const SolverResult & )
default
 SolverResult& operator= ( SolverResult && )
default
 const optional& optimal_cost ( ) const
inline

Here is the caller graph for this function:

 const optional& optimal_cost_lower_bound ( ) const
inline

Here is the caller graph for this function:

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

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).

Here is the caller graph for this function:

 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(...);

Here is the call graph for this function:

Here is the caller graph for this function:

 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.

Here is the caller graph for this function:

 const SolverId& solver_id ( ) const
inline

Here is the caller graph for this function:

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