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::LPSolverCplex Class Reference

Wrapper class for the IBM ILOG CPLEX optimizer. More...

#include <lp_solver_cplex.hxx>

+ Inheritance diagram for opengm::LPSolverCplex:
+ Collaboration diagram for opengm::LPSolverCplex:

Public Types

typedef IloNum CplexValueType
 Defines the value type used by CPLEX. More...
 
typedef IloInt CplexIndexType
 Defines the index type used by CPLEX. More...
 
typedef IloNumArrayIterator CplexSolutionIteratorType
 Defines the iterator type which can be used to iterate over the solution of CPLEX. More...
 
typedef IloNum CplexTimingType
 Defines the timing type used by CPLEX. More...
 
typedef LPSolverInterface< LPSolverCplex, CplexValueType, CplexIndexType, CplexSolutionIteratorType, CplexTimingTypeLPSolverBaseClass
 Defines the type of the base class. More...
 
- Public Types inherited from opengm::LPSolverInterface< LPSolverCplex, IloNum, IloInt, IloNumArrayIterator, IloNum >
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 LPSolverCplex SolverType
 Defines the type of the child class which inherits from LPSolverInterface. More...
 
typedef IloNum SolverValueType
 Defines the value type used by the LP Solver. More...
 
typedef IloInt SolverIndexType
 Defines the index type used by the LP Solver. More...
 
typedef IloNumArrayIterator SolverSolutionIteratorType
 Defines the iterator type which can be used to iterate over the solution of the LP Solver. More...
 
typedef IloNum SolverTimingType
 Defines the timing type used by the LP Solver. More...
 

Public Member Functions

 LPSolverCplex (const Parameter &parameter=Parameter())
 Default constructor for LPSolverCplex. More...
 
 ~LPSolverCplex ()
 Destructor for LPSolverCplex. More...
 
- Public Member Functions inherited from opengm::LPSolverInterface< LPSolverCplex, IloNum, IloInt, IloNumArrayIterator, IloNum >
 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 CplexIndexType numVariables, const CplexValueType lowerBound, const CplexValueType upperBound)
 Add new continuous variables to the model. More...
 
void addIntegerVariables_impl (const CplexIndexType numVariables, const CplexValueType lowerBound, const CplexValueType upperBound)
 Add new integer variables to the model. More...
 
void addBinaryVariables_impl (const CplexIndexType 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 CplexIndexType variable, const CplexValueType 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 CplexValueType 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 CplexValueType 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 CplexValueType bound, const std::string &constraintName="")
 Add a new greater equal constraint to the model. More...
 
void addConstraintsFinished_impl ()
 Join all constraints added via LPSolverCplex::addEqualityConstraint, LPSolverCplex::addLessEqualConstraint and LPSolverCplex::addGreaterEqualConstraint to the model. More...
 
void addConstraintsFinished_impl (CplexTimingType &timing)
 Join all constraints added via LPSolverCplex::addEqualityConstraint, LPSolverCplex::addLessEqualConstraint and LPSolverCplex::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 CPLEX parameter. More...
 
bool solve_impl ()
 Solve the current model. More...
 
bool solve_impl (CplexTimingType &timing)
 Solve the current model and measure solving time. More...
 
CplexSolutionIteratorType solutionBegin_impl () const
 Get an iterator which is pointing to the begin of the solution computed by CPLEX. More...
 
CplexSolutionIteratorType solutionEnd_impl () const
 Get an iterator which is pointing to the end of the solution computed by CPLEX. More...
 
CplexValueType solution_impl (const CplexIndexType variable) const
 Get the solution value of a variable computed by CPLEX. More...
 
CplexValueType objectiveFunctionValue_impl () const
 Get the objective function value from CPLEX. More...
 
CplexValueType 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 CplexValueType infinity_impl ()
 Get the value which is used by CPLEX to represent infinity. More...
 
static int getCutLevelValue (const LPDef::MIP_CUT cutLevel)
 Translate LPDef::MIP_CUT into corresponding CPLEX int value. More...
 

Protected Attributes

IloEnv cplexEnvironment_
 The CPLEX environment. More...
 
IloModel cplexModel_
 The CPLEX model of the LP/MIP problem. More...
 
IloNumVarArray cplexVariables_
 The variables which are present in the model. More...
 
IloObjective cplexObjective_
 The objective function. More...
 
IloRangeArray cplexConstraints_
 Puffer for the constraints which are added by CPlexSolver::addEqualityConstraint, CPlexSolver::addLessEqualConstraint and CPlexSolver::addGreaterEqualConstraint. Will be flushed into the CPLEX model when CPlexSolver::addConstraintsFinished is called. More...
 
IloNumArray cplexSolution_
 Storage for the solution computed by CPLEX. More...
 
bool cplexSolutionValid_
 Tell if the currently stored solution is valid. More...
 
IloCplex cplexSolver_
 The CPLEX solver. More...
 
- Protected Attributes inherited from opengm::LPSolverInterface< LPSolverCplex, IloNum, IloInt, IloNumArrayIterator, IloNum >
const Parameter parameter_
 Storage for parameter. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from opengm::LPSolverInterface< LPSolverCplex, IloNum, IloInt, IloNumArrayIterator, IloNum >
static SolverValueType infinity ()
 Get the value which is used by the LP Solver to represent infinity. More...
 

Detailed Description

Wrapper class for the IBM ILOG CPLEX optimizer.

Note
IBM ILOG CPLEX is a commercial product that is free for academical use.

Definition at line 41 of file lp_solver_cplex.hxx.

Member Typedef Documentation

Defines the index type used by CPLEX.

Definition at line 45 of file lp_solver_cplex.hxx.

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

Definition at line 46 of file lp_solver_cplex.hxx.

Defines the timing type used by CPLEX.

Definition at line 47 of file lp_solver_cplex.hxx.

Defines the value type used by CPLEX.

Definition at line 44 of file lp_solver_cplex.hxx.

Defines the type of the base class.

Definition at line 49 of file lp_solver_cplex.hxx.

Constructor & Destructor Documentation

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

Default constructor for LPSolverCplex.

Parameters
[in]parameterSettings for the CPLEX solver.

Definition at line 633 of file lp_solver_cplex.hxx.

+ Here is the call graph for this function:

opengm::LPSolverCplex::~LPSolverCplex ( )
inline

Destructor for LPSolverCplex.

Definition at line 865 of file lp_solver_cplex.hxx.

Member Function Documentation

void opengm::LPSolverCplex::addBinaryVariables_impl ( const CplexIndexType  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 893 of file lp_solver_cplex.hxx.

void opengm::LPSolverCplex::addConstraintsFinished_impl ( )
inlineprotected

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

Note
Implementation for base class LPSolverInterface::addConstraintsFinished method.

Definition at line 1030 of file lp_solver_cplex.hxx.

void opengm::LPSolverCplex::addConstraintsFinished_impl ( CplexTimingType timing)
inlineprotected

Join all constraints added via LPSolverCplex::addEqualityConstraint, LPSolverCplex::addLessEqualConstraint and LPSolverCplex::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 1043 of file lp_solver_cplex.hxx.

void opengm::LPSolverCplex::addContinuousVariables_impl ( const CplexIndexType  numVariables,
const CplexValueType  lowerBound,
const CplexValueType  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 873 of file lp_solver_cplex.hxx.

template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void opengm::LPSolverCplex::addEqualityConstraint_impl ( VARIABLES_ITERATOR_TYPE  variableIDsBegin,
const VARIABLES_ITERATOR_TYPE  variableIDsEnd,
COEFFICIENTS_ITERATOR_TYPE  coefficientsBegin,
const CplexValueType  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 LPSolverCplex::addEqualityConstraint, LPSolverCplex::addLessEqualConstraint and LPSolverCplex::addGreaterEqualConstraint are stored in a puffer and will be added to the model all at once when the function LPSolverCplex::addConstraintsFinished is called.

Definition at line 980 of file lp_solver_cplex.hxx.

template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void opengm::LPSolverCplex::addGreaterEqualConstraint_impl ( VARIABLES_ITERATOR_TYPE  variableIDsBegin,
const VARIABLES_ITERATOR_TYPE  variableIDsEnd,
COEFFICIENTS_ITERATOR_TYPE  coefficientsBegin,
const CplexValueType  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 LPSolverCplex::addEqualityConstraint, LPSolverCplex::addLessEqualConstraint and LPSolverCplex::addGreaterEqualConstraint are stored in a puffer and will be added to the model all at once when the function LPSolverCplex::addConstraintsFinished is called.

Definition at line 1014 of file lp_solver_cplex.hxx.

void opengm::LPSolverCplex::addIntegerVariables_impl ( const CplexIndexType  numVariables,
const CplexValueType  lowerBound,
const CplexValueType  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 883 of file lp_solver_cplex.hxx.

template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void opengm::LPSolverCplex::addLessEqualConstraint_impl ( VARIABLES_ITERATOR_TYPE  variableIDsBegin,
const VARIABLES_ITERATOR_TYPE  variableIDsEnd,
COEFFICIENTS_ITERATOR_TYPE  coefficientsBegin,
const CplexValueType  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 LPSolverCplex::addEqualityConstraint, LPSolverCplex::addLessEqualConstraint and LPSolverCplex::addGreaterEqualConstraint are stored in a puffer and will be added to the model all at once when the function LPSolverCplex::addConstraintsFinished is called.

Definition at line 997 of file lp_solver_cplex.hxx.

void opengm::LPSolverCplex::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 1150 of file lp_solver_cplex.hxx.

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

Translate LPDef::MIP_CUT into corresponding CPLEX int value.

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

Definition at line 1171 of file lp_solver_cplex.hxx.

+ Here is the caller graph for this function:

LPSolverCplex::CplexValueType opengm::LPSolverCplex::infinity_impl ( )
inlinestaticprotected

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

Note
Implementation for base class LPSolverInterface::infinity method.

Definition at line 869 of file lp_solver_cplex.hxx.

LPSolverCplex::CplexValueType opengm::LPSolverCplex::objectiveFunctionValue_impl ( ) const
inlineprotected

Get the objective function value from CPLEX.

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

Definition at line 1128 of file lp_solver_cplex.hxx.

LPSolverCplex::CplexValueType opengm::LPSolverCplex::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 1137 of file lp_solver_cplex.hxx.

void opengm::LPSolverCplex::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 903 of file lp_solver_cplex.hxx.

void opengm::LPSolverCplex::setObjectiveValue_impl ( const CplexIndexType  variable,
const CplexValueType  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 929 of file lp_solver_cplex.hxx.

template<class ITERATOR_TYPE >
void opengm::LPSolverCplex::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 939 of file lp_solver_cplex.hxx.

template<class VARIABLES_ITERATOR_TYPE , class COEFFICIENTS_ITERATOR_TYPE >
void opengm::LPSolverCplex::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 958 of file lp_solver_cplex.hxx.

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

Set CPLEX parameter.

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

Definition at line 1060 of file lp_solver_cplex.hxx.

LPSolverCplex::CplexValueType opengm::LPSolverCplex::solution_impl ( const CplexIndexType  variable) const
inlineprotected

Get the solution value of a variable computed by CPLEX.

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 1118 of file lp_solver_cplex.hxx.

+ Here is the call graph for this function:

LPSolverCplex::CplexSolutionIteratorType opengm::LPSolverCplex::solutionBegin_impl ( ) const
inlineprotected

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

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

Definition at line 1108 of file lp_solver_cplex.hxx.

+ Here is the call graph for this function:

LPSolverCplex::CplexSolutionIteratorType opengm::LPSolverCplex::solutionEnd_impl ( ) const
inlineprotected

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

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

Definition at line 1113 of file lp_solver_cplex.hxx.

+ Here is the call graph for this function:

bool opengm::LPSolverCplex::solve_impl ( )
inlineprotected

Solve the current model.

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

Definition at line 1069 of file lp_solver_cplex.hxx.

bool opengm::LPSolverCplex::solve_impl ( CplexTimingType timing)
inlineprotected

Solve the current model and measure solving time.

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

Definition at line 1086 of file lp_solver_cplex.hxx.

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

Update solution if required.

Definition at line 1159 of file lp_solver_cplex.hxx.

+ Here is the caller graph for this function:

Member Data Documentation

LPSolverCplex::cplexConstraints_
protected

Puffer for the constraints which are added by CPlexSolver::addEqualityConstraint, CPlexSolver::addLessEqualConstraint and CPlexSolver::addGreaterEqualConstraint. Will be flushed into the CPLEX model when CPlexSolver::addConstraintsFinished is called.

Definition at line 63 of file lp_solver_cplex.hxx.

LPSolverCplex::cplexEnvironment_
protected

The CPLEX environment.

Definition at line 59 of file lp_solver_cplex.hxx.

LPSolverCplex::cplexModel_
protected

The CPLEX model of the LP/MIP problem.

Definition at line 60 of file lp_solver_cplex.hxx.

LPSolverCplex::cplexObjective_
protected

The objective function.

Definition at line 62 of file lp_solver_cplex.hxx.

LPSolverCplex::cplexSolution_
protected

Storage for the solution computed by CPLEX.

Definition at line 64 of file lp_solver_cplex.hxx.

LPSolverCplex::cplexSolutionValid_
mutableprotected

Tell if the currently stored solution is valid.

Definition at line 65 of file lp_solver_cplex.hxx.

LPSolverCplex::cplexSolver_
protected

The CPLEX solver.

Definition at line 66 of file lp_solver_cplex.hxx.

LPSolverCplex::cplexVariables_
protected

The variables which are present in the model.

Definition at line 61 of file lp_solver_cplex.hxx.