lpinterface
 All Classes Namespaces Files Functions Variables Enumerations Enumerator
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lpint::GurobiSolver Class Reference
Inheritance diagram for lpint::GurobiSolver:
lpint::LinearProgramSolver

Public Member Functions

 GurobiSolver (OptimizationType optim_type)
 
bool parameter_supported (const Param param) const override
 Check whether the solver backend supports the given parameter. More...
 
void set_parameter (const Param param, const int value) override
 Set an integer-valued parameter in the internal LP solver. This method will fail with LpError::UnsupportedParameterError if param is not a valid parameter for the internal solver. More...
 
void set_parameter (const Param param, const double value) override
 Set a double-valued parameter in the internal LP solver This method will fail with LpError::UnsupportedParameterError if param is not a valid parameter for the internal solver. More...
 
Status solve () override
 Solve the linear program.
 
Status solution_status () const override
 Query the LP solver for the solution status.
 
const ILinearProgramHandlelinear_program () const override
 Get immutable access to the underlying Linear Program object.
 
ILinearProgramHandlelinear_program () override
 Get mutable access to the underlying Linear Program object.
 
const Solution< double > & get_solution () const override
 Get the solution of the linear program. This method will fail with LpError::ModelNotsolvedError if the solution has not (yet) been found.
 
- Public Member Functions inherited from lpint::LinearProgramSolver
 LinearProgramSolver (const LinearProgramSolver &)=default
 
 LinearProgramSolver (LinearProgramSolver &&)=default
 
LinearProgramSolveroperator= (const LinearProgramSolver &)=default
 
LinearProgramSolveroperator= (LinearProgramSolver &&)=default
 

Static Public Member Functions

static Status convert_gurobi_status (int status)
 

Public Attributes

std::shared_ptr< GRBenv > gurobi_env_
 The gurobi environment object.
 
std::shared_ptr< GRBmodel > gurobi_model_
 The gurobi model object.
 
LinearProgramHandleGurobi lp_handle_
 The linear program to solve.
 
Solution< double > solution_
 The solution vector.
 

Static Public Attributes

static const
std::unordered_map< Param,
const char * > 
param_dict_
 
static const
std::unordered_map< int,
Status
status_dict_
 

Member Function Documentation

bool lpint::GurobiSolver::parameter_supported ( const Param  param) const
overridevirtual

Check whether the solver backend supports the given parameter.

Parameters
paramThe parameter to check support for.
Returns
true The solver supports the given parameter.
false The solver does not support the given parameter.

Implements lpint::LinearProgramSolver.

void lpint::GurobiSolver::set_parameter ( const Param  param,
const int  value 
)
overridevirtual

Set an integer-valued parameter in the internal LP solver. This method will fail with LpError::UnsupportedParameterError if param is not a valid parameter for the internal solver.

Parameters
paramThe parameter to change.
valueThe value to which to set the parameter.

Implements lpint::LinearProgramSolver.

void lpint::GurobiSolver::set_parameter ( const Param  param,
const double  value 
)
overridevirtual

Set a double-valued parameter in the internal LP solver This method will fail with LpError::UnsupportedParameterError if param is not a valid parameter for the internal solver.

Parameters
paramThe parameter to change.
valueThe value to which to set the parameter.

Implements lpint::LinearProgramSolver.


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