OpenGM  2.3.x
Discrete Graphical Model Library
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
opengm::LPSolverGurobi Class Reference

Wrapper class for the Gurobi optimizer. More...

#include <lp_solver_gurobi.hxx>

+ Inheritance diagram for opengm::LPSolverGurobi:
+ Collaboration diagram for opengm::LPSolverGurobi:

Public Types

typedef double GurobiValueType
 Defines the value type used by Gurobi. More...
 
typedef int GurobiIndexType
 Defines the index type used by Gurobi. More...
 
typedef std::vector< GurobiValueType >::const_iterator GurobiSolutionIteratorType
 Defines the iterator type which can be used to iterate over the solution of Gurobi. More...
 
typedef double GurobiTimingType
 Defines the timing type used by Gurobi. More...
 
typedef LPSolverInterface< LPSolverGurobi, GurobiValueType, GurobiIndexType, GurobiSolutionIteratorType, GurobiTimingTypeLPSolverBaseClass
 Defines the type of the base class. More...
 
- Public Types inherited from opengm::LPSolverInterface< LPSolverGurobi, double, int, std::vector< double >::const_iterator, double >
enum  Objective
 This enum defines the type of the objective. It is used to select either to minimize or to maxime the objective function. More...
 
typedef LPSolverGurobi SolverType
 Defines the type of the child class which inherits from LPSolverInterface. More...
 
typedef double SolverValueType
 Defines the value type used by the LP Solver. More...
 
typedef int SolverIndexType
 Defines the index type used by the LP Solver. More...
 
typedef std::vector< double >::const_iterator SolverSolutionIteratorType
 Defines the iterator type which can be used to iterate over the solution of the LP Solver. More...
 
typedef double SolverTimingType
 Defines the timing type used by the LP Solver. More...
 

Public Member Functions

 LPSolverGurobi (const Parameter &parameter=Parameter())
 Default constructor for LPSolverGurobi. More...
 
 ~LPSolverGurobi ()
 Destructor for LPSolverGurobi. More...
 
- Public Member Functions inherited from opengm::LPSolverInterface< LPSolverGurobi, double, int, std::vector< double >::const_iterator, double >
 LPSolverInterface (const Parameter &parameter=Parameter())
 Default constructor of class LPSolverInterface. More...
 
 ~LPSolverInterface ()
 Default destructor of class LPSolverInterface. More...
 
void addContinuousVariables (const SolverIndexType numVariables, const SolverValueType lowerBound, const SolverValueType upperBound)
 Add new continuous variables to the model. More...
 
void addIntegerVariables (const SolverIndexType numVariables, const SolverValueType lowerBound, const SolverValueType upperBound)
 Add new integer variables to the model. More...
 
void addBinaryVariables (const SolverIndexType numVariables)
 Add new binary variables to the model. More...
 
void setObjective (const Objective objective)
 Set objective to minimize or maximize. More...
 
void setObjectiveValue (const SolverIndexType variable, const SolverValueType value)
 Set the coefficient of a variable in the objective function. More...
 
void setObjectiveValue (ITERATOR_TYPE begin, const ITERATOR_TYPE end)
 Set the coefficients of all variables in the objective function. More...
 
void setObjectiveValue (VARIABLES_ITERATOR_TYPE variableIDsBegin, const VARIABLES_ITERATOR_TYPE variableIDsEnd, COEFFICIENTS_ITERATOR_TYPE coefficientsBegin)
 Set the coefficients of selected variables in the objective function. More...
 
void addEqualityConstraint (VARIABLES_ITERATOR_TYPE variableIDsBegin, const VARIABLES_ITERATOR_TYPE variableIDsEnd, COEFFICIENTS_ITERATOR_TYPE coefficientsBegin, const SolverValueType bound, const std::string &constraintName="")
 Add a new equality constraint to the model. More...
 
void addLessEqualConstraint (VARIABLES_ITERATOR_TYPE variableIDsBegin, const VARIABLES_ITERATOR_TYPE variableIDsEnd, COEFFICIENTS_ITERATOR_TYPE coefficientsBegin, const SolverValueType bound, const std::string &constraintName="")
 Add a new less equal constraint to the model. More...
 
void addGreaterEqualConstraint (VARIABLES_ITERATOR_TYPE variableIDsBegin, const VARIABLES_ITERATOR_TYPE variableIDsEnd, COEFFICIENTS_ITERATOR_TYPE coefficientsBegin, const SolverValueType bound, const std::string &constraintName="")
 Add a new greater equal constraint to the model. More...
 
void addConstraintsFinished ()
 Join all constraints added via LPSolverInterface::addEqualityConstraint, LPSolverInterface::addLessEqualConstraint and LPSolverInterface::addGreaterEqualConstraint to the model. More...
 
void addConstraintsFinished (SolverTimingType &timing)
 Join all constraints added via LPSolverInterface::addEqualityConstraint, LPSolverInterface::addLessEqualConstraint and LPSolverInterface::addGreaterEqualConstraint to the model. More...
 
void setParameter (const PARAMETER_TYPE parameter, const PARAMETER_VALUE_TYPE value)
 Set Solver parameter. More...
 
bool solve ()
 Solve the current model. More...
 
bool solve (SolverTimingType &timing)
 Solve the current model and measure solving time. More...
 
SolverSolutionIteratorType solutionBegin () const
 Get an iterator which is pointing to the begin of the solution computed by the Solver. More...
 
SolverSolutionIteratorType solutionEnd () const
 Get an iterator which is pointing to the end of the solution computed by the Solver. More...
 
SolverValueType solution (const SolverIndexType variable) const
 Get the solution value of a variable computed by the Solver. More...
 
SolverValueType objectiveFunctionValue () const
 Get the objective function value from the Solver. More...
 
SolverValueType objectiveFunctionValueBound () const
 Get the best known bound for the optimal solution of the current model. More...
 
void exportModel (const std::string &filename) const
 Export model to file. More...
 

Protected Member Functions

void addContinuousVariables_impl (const GurobiIndexType numVariables, const GurobiValueType lowerBound, const GurobiValueType upperBound)
 Add new continuous variables to the model. More...
 
void addIntegerVariables_impl (const GurobiIndexType numVariables, const GurobiValueType lowerBound, const GurobiValueType upperBound)
 Add new integer variables to the model. More...
 
void addBinaryVariables_impl (const GurobiIndexType numVariables)
 Add new binary variables to the model. More...
 
void setObjective_impl (const Objective objective)
 Set objective to minimize or maximize. More...
 
void setObjectiveValue_impl (const GurobiIndexType variable, const GurobiValueType value)
 Set the coefficient of a variable in the objective function. More...
 
template<class ITERATOR_TYPE >
void setObjectiveValue_impl (ITERATOR_TYPE begin, const ITERATOR_TYPE end)
 Set values of the coefficients of all variables in the objective function. More...
 
template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void setObjectiveValue_impl (VARIABLES_ITERATOR_TYPE variableIDsBegin, const VARIABLES_ITERATOR_TYPE variableIDsEnd, COEFFICIENTS_ITERATOR_TYPE coefficientsBegin)
 Set values as the coefficients of selected variables in the objective function. More...
 
template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void addEqualityConstraint_impl (VARIABLES_ITERATOR_TYPE variableIDsBegin, const VARIABLES_ITERATOR_TYPE variableIDsEnd, COEFFICIENTS_ITERATOR_TYPE coefficientsBegin, const GurobiValueType bound, const std::string &constraintName="")
 Add a new equality constraint to the model. More...
 
template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void addLessEqualConstraint_impl (VARIABLES_ITERATOR_TYPE variableIDsBegin, const VARIABLES_ITERATOR_TYPE variableIDsEnd, COEFFICIENTS_ITERATOR_TYPE coefficientsBegin, const GurobiValueType bound, const std::string &constraintName="")
 Add a new less equal constraint to the model. More...
 
template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void addGreaterEqualConstraint_impl (VARIABLES_ITERATOR_TYPE variableIDsBegin, const VARIABLES_ITERATOR_TYPE variableIDsEnd, COEFFICIENTS_ITERATOR_TYPE coefficientsBegin, const GurobiValueType bound, const std::string &constraintName="")
 Add a new greater equal constraint to the model. More...
 
void addConstraintsFinished_impl ()
 Join all constraints added via LPSolverGurobi::addEqualityConstraint, LPSolverGurobi::addLessEqualConstraint and LPSolverGurobi::addGreaterEqualConstraint to the model. More...
 
void addConstraintsFinished_impl (GurobiTimingType &timing)
 Join all constraints added via LPSolverGurobi::addEqualityConstraint, LPSolverGurobi::addLessEqualConstraint and LPSolverGurobi::addGreaterEqualConstraint to the model. More...
 
template<class PARAMETER_TYPE , class PARAMETER_VALUE_TYPE >
void setParameter_impl (const PARAMETER_TYPE parameter, const PARAMETER_VALUE_TYPE value)
 Set Gurobi parameter. More...
 
bool solve_impl ()
 Solve the current model. More...
 
bool solve_impl (GurobiTimingType &timing)
 Solve the current model and measure solving time. More...
 
GurobiSolutionIteratorType solutionBegin_impl () const
 Get an iterator which is pointing to the begin of the solution computed by Gurobi. More...
 
GurobiSolutionIteratorType solutionEnd_impl () const
 Get an iterator which is pointing to the end of the solution computed by Gurobi. More...
 
GurobiValueType solution_impl (const GurobiIndexType variable) const
 Get the solution value of a variable computed by Gurobi. More...
 
GurobiValueType objectiveFunctionValue_impl () const
 Get the objective function value from Gurobi. More...
 
GurobiValueType objectiveFunctionValueBound_impl () const
 Get the best known bound for the optimal solution of the current model. More...
 
void exportModel_impl (const std::string &filename) const
 Export model to file. More...
 
void updateSolution () const
 Update solution if required. More...
 

Static Protected Member Functions

static GurobiValueType infinity_impl ()
 Get the value which is used by Gurobi to represent infinity. More...
 
static int getCutLevelValue (const LPDef::MIP_CUT cutLevel)
 Translate LPDef::MIP_CUT into corresponding Gurobi int value. More...
 

Protected Attributes

GRBEnv gurobiEnvironment_
 The Gurobi environment. More...
 
GRBModel gurobiModel_
 The Gurobi model of the LP/MIP problem. More...
 
std::vector< GRBVar > gurobiVariables_
 The variables which are present in the model. More...
 
std::vector< GurobiValueTypegurobiSolution_
 Storage for the solution computed by Gurobi. More...
 
bool gurobiSolutionValid_
 Tell if the currently stored solution is valid. More...
 
- Protected Attributes inherited from opengm::LPSolverInterface< LPSolverGurobi, double, int, std::vector< double >::const_iterator, double >
const Parameter parameter_
 Storage for parameter. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from opengm::LPSolverInterface< LPSolverGurobi, double, int, std::vector< double >::const_iterator, double >
static SolverValueType infinity ()
 Get the value which is used by the LP Solver to represent infinity. More...
 

Detailed Description

Wrapper class for the Gurobi optimizer.

Note
Gurobi is a commercial product that is free for academical use.

Definition at line 15 of file lp_solver_gurobi.hxx.

Member Typedef Documentation

Defines the index type used by Gurobi.

Definition at line 19 of file lp_solver_gurobi.hxx.

Defines the iterator type which can be used to iterate over the solution of Gurobi.

Definition at line 20 of file lp_solver_gurobi.hxx.

Defines the timing type used by Gurobi.

Definition at line 21 of file lp_solver_gurobi.hxx.

Defines the value type used by Gurobi.

Definition at line 18 of file lp_solver_gurobi.hxx.

Defines the type of the base class.

Definition at line 23 of file lp_solver_gurobi.hxx.

Constructor & Destructor Documentation

opengm::LPSolverGurobi::LPSolverGurobi ( const Parameter &  parameter = Parameter())
inline

Default constructor for LPSolverGurobi.

Parameters
[in]parameterSettings for the Gurobi solver.

Definition at line 471 of file lp_solver_gurobi.hxx.

+ Here is the call graph for this function:

opengm::LPSolverGurobi::~LPSolverGurobi ( )
inline

Destructor for LPSolverGurobi.

Definition at line 664 of file lp_solver_gurobi.hxx.

Member Function Documentation

void opengm::LPSolverGurobi::addBinaryVariables_impl ( const GurobiIndexType  numVariables)
inlineprotected

Add new binary variables to the model.

Parameters
[in]numVariablesThe number of new Variables.
Note
Implementation for base class LPSolverInterface::addBinaryVariables method.

Definition at line 712 of file lp_solver_gurobi.hxx.

void opengm::LPSolverGurobi::addConstraintsFinished_impl ( )
inlineprotected

Join all constraints added via LPSolverGurobi::addEqualityConstraint, LPSolverGurobi::addLessEqualConstraint and LPSolverGurobi::addGreaterEqualConstraint to the model.

Note
Implementation for base class LPSolverInterface::addConstraintsFinished method.

Definition at line 885 of file lp_solver_gurobi.hxx.

void opengm::LPSolverGurobi::addConstraintsFinished_impl ( GurobiTimingType timing)
inlineprotected

Join all constraints added via LPSolverGurobi::addEqualityConstraint, LPSolverGurobi::addLessEqualConstraint and LPSolverGurobi::addGreaterEqualConstraint to the model.

Parameters
[out]timingReturns the time needed to join all constraints into the model.
Note
Implementation for base class LPSolverInterface::addConstraintsFinished method.

Definition at line 898 of file lp_solver_gurobi.hxx.

+ Here is the call graph for this function:

void opengm::LPSolverGurobi::addContinuousVariables_impl ( const GurobiIndexType  numVariables,
const GurobiValueType  lowerBound,
const GurobiValueType  upperBound 
)
inlineprotected

Add new continuous variables to the model.

Parameters
[in]numVariablesThe number of new Variables.
[in]lowerBoundThe lower bound for the new Variables.
[in]upperBoundThe upper bound for the new Variables.
Note
Implementation for base class LPSolverInterface::addContinuousVariables method.

Definition at line 672 of file lp_solver_gurobi.hxx.

template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void opengm::LPSolverGurobi::addEqualityConstraint_impl ( VARIABLES_ITERATOR_TYPE  variableIDsBegin,
const VARIABLES_ITERATOR_TYPE  variableIDsEnd,
COEFFICIENTS_ITERATOR_TYPE  coefficientsBegin,
const GurobiValueType  bound,
const std::string &  constraintName = "" 
)
inlineprotected

Add a new equality constraint to the model.

Template Parameters
VARIABLES_ITERATOR_TYPEIterator type to iterate over the variable ids of the constraints.
COEFFICIENTS_ITERATOR_TYPEIterator type to iterate over the coefficients of the constraints.
Parameters
[in]variableIDsBeginIterator pointing to the begin of a sequence of values defining the variables of the constraint.
[in]variableIDsEndIterator pointing to the end of a sequence of values defining the variables of the constraint.
[in]coefficientsBeginIterator pointing to the begin of a sequence of values defining the coefficients for the variables.
[in]boundThe right hand side of the equality constraint.
[in]constraintNameThe name for the equality constraint.
Note
  1. Implementation for base class LPSolverInterface::addEqualityConstraint method.
  2. To increase performance for adding multiple constraints to the model, all constraints added via LPSolverGurobi::addEqualityConstraint, LPSolverGurobi::addLessEqualConstraint and LPSolverGurobi::addGreaterEqualConstraint are stored in a puffer and will be added to the model all at once when the function LPSolverGurobi::addConstraintsFinished is called.

Definition at line 814 of file lp_solver_gurobi.hxx.

template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void opengm::LPSolverGurobi::addGreaterEqualConstraint_impl ( VARIABLES_ITERATOR_TYPE  variableIDsBegin,
const VARIABLES_ITERATOR_TYPE  variableIDsEnd,
COEFFICIENTS_ITERATOR_TYPE  coefficientsBegin,
const GurobiValueType  bound,
const std::string &  constraintName = "" 
)
inlineprotected

Add a new greater equal constraint to the model.

Template Parameters
VARIABLES_ITERATOR_TYPEIterator type to iterate over the variable ids of the constraints.
COEFFICIENTS_ITERATOR_TYPEIterator type to iterate over the coefficients of the constraints.
Parameters
[in]variableIDsBeginIterator pointing to the begin of a sequence of values defining the variables of the constraint.
[in]variableIDsEndIterator pointing to the end of a sequence of values defining the variables of the constraint.
[in]coefficientsBeginIterator pointing to the begin of a sequence of values defining the coefficients for the variables.
[in]boundThe right hand side of the greater equal constraint.
[in]constraintNameThe name for the greater equal constraint.
Note
  1. Implementation for base class LPSolverInterface::addGreaterEqualConstraint method.
  2. To increase performance for adding multiple constraints to the model, all constraints added via LPSolverGurobi::addEqualityConstraint, LPSolverGurobi::addLessEqualConstraint and LPSolverGurobi::addGreaterEqualConstraint are stored in a puffer and will be added to the model all at once when the function LPSolverGurobi::addConstraintsFinished is called.

Definition at line 862 of file lp_solver_gurobi.hxx.

void opengm::LPSolverGurobi::addIntegerVariables_impl ( const GurobiIndexType  numVariables,
const GurobiValueType  lowerBound,
const GurobiValueType  upperBound 
)
inlineprotected

Add new integer variables to the model.

Parameters
[in]numVariablesThe number of new Variables.
[in]lowerBoundThe lower bound for the new Variables.
[in]upperBoundThe upper bound for the new Variables.
Note
Implementation for base class LPSolverInterface::addIntegerVariables method.

Definition at line 692 of file lp_solver_gurobi.hxx.

template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void opengm::LPSolverGurobi::addLessEqualConstraint_impl ( VARIABLES_ITERATOR_TYPE  variableIDsBegin,
const VARIABLES_ITERATOR_TYPE  variableIDsEnd,
COEFFICIENTS_ITERATOR_TYPE  coefficientsBegin,
const GurobiValueType  bound,
const std::string &  constraintName = "" 
)
inlineprotected

Add a new less equal constraint to the model.

Template Parameters
VARIABLES_ITERATOR_TYPEIterator type to iterate over the variable ids of the constraints.
COEFFICIENTS_ITERATOR_TYPEIterator type to iterate over the coefficients of the constraints.
Parameters
[in]variableIDsBeginIterator pointing to the begin of a sequence of values defining the variables of the constraint.
[in]variableIDsEndIterator pointing to the end of a sequence of values defining the variables of the constraint.
[in]coefficientsBeginIterator pointing to the begin of a sequence of values defining the coefficients for the variables.
[in]boundThe right hand side of the less equal constraint.
[in]constraintNameThe name for the less equal constraint.
Note
  1. Implementation for base class LPSolverInterface::addLessEqualConstraint method.
  2. To increase performance for adding multiple constraints to the model, all constraints added via LPSolverGurobi::addEqualityConstraint, LPSolverGurobi::addLessEqualConstraint and LPSolverGurobi::addGreaterEqualConstraint are stored in a puffer and will be added to the model all at once when the function LPSolverGurobi::addConstraintsFinished is called.

Definition at line 838 of file lp_solver_gurobi.hxx.

void opengm::LPSolverGurobi::exportModel_impl ( const std::string &  filename) const
inlineprotected

Export model to file.

Parameters
[in]filenameThe name of the file where the model will be stored.
Note
Implementation for base class LPSolverInterface::exportModel method.

Definition at line 1021 of file lp_solver_gurobi.hxx.

int opengm::LPSolverGurobi::getCutLevelValue ( const LPDef::MIP_CUT  cutLevel)
inlinestaticprotected

Translate LPDef::MIP_CUT into corresponding Gurobi int value.

Returns
Integer value corresponding to the LPDef::MIP_CUT parameter.

Definition at line 1052 of file lp_solver_gurobi.hxx.

+ Here is the caller graph for this function:

LPSolverGurobi::GurobiValueType opengm::LPSolverGurobi::infinity_impl ( )
inlinestaticprotected

Get the value which is used by Gurobi to represent infinity.

Note
Implementation for base class LPSolverInterface::infinity method.

Definition at line 668 of file lp_solver_gurobi.hxx.

LPSolverGurobi::GurobiValueType opengm::LPSolverGurobi::objectiveFunctionValue_impl ( ) const
inlineprotected

Get the objective function value from Gurobi.

Returns
Objective function value.
Note
Implementation for base class LPSolverInterface::objectiveFunctionValue method.

Definition at line 991 of file lp_solver_gurobi.hxx.

LPSolverGurobi::GurobiValueType opengm::LPSolverGurobi::objectiveFunctionValueBound_impl ( ) const
inlineprotected

Get the best known bound for the optimal solution of the current model.

Returns
The bound for the current model.
Note
Implementation for base class LPSolverInterface::objectiveFunctionValueBound method.

Definition at line 1004 of file lp_solver_gurobi.hxx.

void opengm::LPSolverGurobi::setObjective_impl ( const Objective  objective)
inlineprotected

Set objective to minimize or maximize.

Parameters
[in]objectiveThe new objective.
Note
Implementation for base class LPSolverInterface::setObjective_impl method.

Definition at line 732 of file lp_solver_gurobi.hxx.

void opengm::LPSolverGurobi::setObjectiveValue_impl ( const GurobiIndexType  variable,
const GurobiValueType  value 
)
inlineprotected

Set the coefficient of a variable in the objective function.

Parameters
[in]variableThe index of the variable.
[in]valueThe value which will be set as the coefficient of the variable in the objective function.
Note
Implementation for base class LPSolverInterface::setObjectiveValue method.

Definition at line 766 of file lp_solver_gurobi.hxx.

template<class ITERATOR_TYPE >
void opengm::LPSolverGurobi::setObjectiveValue_impl ( ITERATOR_TYPE  begin,
const ITERATOR_TYPE  end 
)
inlineprotected

Set values of the coefficients of all variables in the objective function.

Template Parameters
ITERATOR_TYPEIterator type used to iterate over the values which will be set as the coefficients of the objective function.
Parameters
[in]beginIterator pointing to the begin of the sequence of values which will be set as the coefficients of the objective function.
[in]endIterator pointing to the end of the sequence of values which will be set as the coefficients of the objective function.
Note
Implementation for base class LPSolverInterface::setObjectiveValue method.

Definition at line 780 of file lp_solver_gurobi.hxx.

template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void opengm::LPSolverGurobi::setObjectiveValue_impl ( VARIABLES_ITERATOR_TYPE  variableIDsBegin,
const VARIABLES_ITERATOR_TYPE  variableIDsEnd,
COEFFICIENTS_ITERATOR_TYPE  coefficientsBegin 
)
inlineprotected

Set values as the coefficients of selected variables in the objective function.

Template Parameters
VARIABLES_ITERATOR_TYPEIterator type used to iterate over the indices of the variables.
COEFFICIENTS_ITERATOR_TYPEIterator type used to iterate over the coefficients of the variables which will be set in the objective function.
Parameters
[in]variableIDsBeginIterator pointing to the begin of the sequence of indices of the variables.
[in]variableIDsEndIterator pointing to the end of the sequence of indices of the variables.
[in]coefficientsBeginIterator pointing to the begin of the sequence of values which will be set as the coefficients of the objective function.
Note
Implementation for base class LPSolverInterface::setObjectiveValue method.

Definition at line 796 of file lp_solver_gurobi.hxx.

template<class PARAMETER_TYPE , class PARAMETER_VALUE_TYPE >
void opengm::LPSolverGurobi::setParameter_impl ( const PARAMETER_TYPE  parameter,
const PARAMETER_VALUE_TYPE  value 
)
inlineprotected

Set Gurobi parameter.

Template Parameters
PARAMETER_VALUE_TYPEThe type of the parameter.
VALUE_TYPEThe type of the value.
Parameters
[in]parameterThe Gurobi parameter.
[in]valueThe new value to which the parameter will be set.
Note
Implementation for base class LPSolverInterface::setParameter method.

Definition at line 916 of file lp_solver_gurobi.hxx.

LPSolverGurobi::GurobiValueType opengm::LPSolverGurobi::solution_impl ( const GurobiIndexType  variable) const
inlineprotected

Get the solution value of a variable computed by Gurobi.

Parameters
[in]variableIndex of the variable for which the solution value is requested.
Returns
Solution value of the selected variable.
Note
Implementation for base class LPSolverInterface::solution method.

Definition at line 978 of file lp_solver_gurobi.hxx.

LPSolverGurobi::GurobiSolutionIteratorType opengm::LPSolverGurobi::solutionBegin_impl ( ) const
inlineprotected

Get an iterator which is pointing to the begin of the solution computed by Gurobi.

Returns
Iterator pointing to the begin of the solution.
Note
Implementation for base class LPSolverInterface::solutionBegin method.

Definition at line 968 of file lp_solver_gurobi.hxx.

+ Here is the call graph for this function:

LPSolverGurobi::GurobiSolutionIteratorType opengm::LPSolverGurobi::solutionEnd_impl ( ) const
inlineprotected

Get an iterator which is pointing to the end of the solution computed by Gurobi.

Returns
Iterator pointing to the begin of the solution.
Note
Implementation for base class LPSolverInterface::solutionEnd method.

Definition at line 973 of file lp_solver_gurobi.hxx.

+ Here is the call graph for this function:

bool opengm::LPSolverGurobi::solve_impl ( )
inlineprotected

Solve the current model.

Returns
True if solving the model finished successfully, false if Gurobi was not able to solve the model.
Note
Implementation for base class LPSolverInterface::solve method.

Definition at line 929 of file lp_solver_gurobi.hxx.

bool opengm::LPSolverGurobi::solve_impl ( GurobiTimingType timing)
inlineprotected

Solve the current model and measure solving time.

Parameters
[out]timingThe time Gurobi needed to solve the problem.
Returns
True if solving the model finished successfully, false if Gurobi was not able to solve the model.
Note
Implementation for base class LPSolverInterface::solve method.

Definition at line 948 of file lp_solver_gurobi.hxx.

void opengm::LPSolverGurobi::updateSolution ( ) const
inlineprotected

Update solution if required.

Definition at line 1034 of file lp_solver_gurobi.hxx.

+ Here is the caller graph for this function:

Member Data Documentation

LPSolverGurobi::gurobiEnvironment_
protected

The Gurobi environment.

Definition at line 33 of file lp_solver_gurobi.hxx.

LPSolverGurobi::gurobiModel_
mutableprotected

The Gurobi model of the LP/MIP problem.

Definition at line 34 of file lp_solver_gurobi.hxx.

LPSolverGurobi::gurobiSolution_
mutableprotected

Storage for the solution computed by Gurobi.

Definition at line 36 of file lp_solver_gurobi.hxx.

LPSolverGurobi::gurobiSolutionValid_
mutableprotected

Tell if the currently stored solution is valid.

Definition at line 37 of file lp_solver_gurobi.hxx.

LPSolverGurobi::gurobiVariables_
protected

The variables which are present in the model.

Definition at line 35 of file lp_solver_gurobi.hxx.