OpenGM  2.3.x
Discrete Graphical Model Library
Public Types | Public Member Functions | Public Attributes | List of all members
opengm::LPCplex2< GM_TYPE, ACC_TYPE > Class Template Reference

LP inference with CPLEX. More...

#include <lpcplex2.hxx>

+ Inheritance diagram for opengm::LPCplex2< GM_TYPE, ACC_TYPE >:
+ Collaboration diagram for opengm::LPCplex2< GM_TYPE, ACC_TYPE >:

Public Types

typedef ACC_TYPE AccumulationType
 Typedef of the Accumulation type. More...
 
typedef GM_TYPE GraphicalModelType
 Typedef of the graphical model type. More...
 
typedef LPInferenceBase< LPCplex2< GraphicalModelType, AccumulationType > > LPInferenceBaseType
 Typedef of class opengm::LPInferenceBase with appropriate template parameter. More...
 
typedef LPInferenceBaseType::Parameter Parameter
 Typedef of the parameter type defined by class opengm::LPInferenceBase. More...
 
- Public Types inherited from opengm::LPSolverCplex
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 Types inherited from opengm::LPInferenceBase< LPCplex2< GM_TYPE, ACC_TYPE > >
typedef LPCplex2< GM_TYPE, ACC_TYPE > LPInferenceType
 Typedef of the child class which inherits from opengm::LPInferenceBase. More...
 
typedef LPInferenceTraits< LPInferenceTypeLPInferenceTraitsType
 Typedef of the opengm::LPInferenceTraits class with appropriate template parameter. More...
 
typedef LPInferenceBase< LPInferenceTypeLPInferenceBaseType
 Typedef of the opengm::LPInferenceBase class with appropriate template parameter. More...
 
typedef LPInferenceTraitsType::AccumulationType AccumulationType
 Typedef of the Accumulation type. More...
 
typedef LPInferenceTraitsType::GraphicalModelType GraphicalModelType
 Typedef of the graphical model type. More...
 
typedef visitors::VerboseVisitor< LPInferenceBaseTypeVerboseVisitorType
 Typedef of the opengm::visitors::VerboseVisitor class with appropriate template parameter. More...
 
typedef visitors::EmptyVisitor< LPInferenceBaseTypeEmptyVisitorType
 Typedef of the opengm::visitors::EmptyVisitor class with appropriate template parameter. More...
 
typedef visitors::TimingVisitor< LPInferenceBaseTypeTimingVisitorType
 Typedef of the opengm::visitors::TimingVisitor class with appropriate template parameter. More...
 
typedef LinearConstraint< ValueType, IndexType, LabelTypeLinearConstraintType
 Typedef of the opengm::LinearConstraint class with appropriate template parameter. Used to represent linear constraints. More...
 
typedef std::vector< LinearConstraintTypeLinearConstraintsContainerType
 Typedef of the container type used to store a set of linear constraints. More...
 
typedef LinearConstraintsContainerType::const_iterator LinearConstraintsIteratorType
 Typedef of the iterator type used to iterate over a set of linear constraints. More...
 
typedef LinearConstraintType::IndicatorVariableType IndicatorVariableType
 Typedef of the indicator variable type used within linear constraints. More...
 
typedef LinearConstraintType::IndicatorVariablesContainerType IndicatorVariablesContainerType
 Typedef of the container type used to store a set of indicator variables. More...
 
typedef LinearConstraintType::IndicatorVariablesIteratorType IndicatorVariablesIteratorType
 Typedef of the iterator type used to iterate over a set of indicator variables. More...
 
typedef LinearConstraintType::VariableLabelPairsIteratorType VariableLabelPairsIteratorType
 Typedef of the iterator type used to iterate over a set of varible label pairs used within an indicator variable. More...
 
typedef LPFunctionTransfer< ValueType, IndexType, LabelTypeLPFunctionTransferType
 Typedef of the opengm::LPFunctionTransfer class with appropriate template parameter. More...
 
typedef LPInferenceTraitsType::SolverType SolverType
 Typedef of the solver type used to solve the LP or MIP which is generated from the graphical model. More...
 
typedef LPInferenceTraitsType::SolverIndexType SolverIndexType
 Typedef of the index type used by the LP/MIP solver. More...
 
typedef LPInferenceTraitsType::SolverValueType SolverValueType
 Typedef of the value type used by the LP/MIP solver. More...
 
typedef LPInferenceTraitsType::SolverSolutionIteratorType SolverSolutionIteratorType
 Typedef of the iterator type used to iterate over the computed solution from the LP/MIP solver. More...
 
typedef LPInferenceTraitsType::SolverTimingType SolverTimingType
 Typedef of the type used by the LP/MIP solver to measure timings. More...
 
typedef LPInferenceTraitsType::SolverParameterType SolverParameterType
 Typedef of the parameter class used by the LP/MIP solver. More...
 
typedef SubsequenceIterator< typename std::vector< LabelType >::const_iterator, typename std::vector< size_t >::const_iterator > IntegerSolutionSubsequenceIterator
 Typedef of the iterator type used to iterate over a subset of the computed solution. This iterator type is used to challenge the linear constraint functions present in the model. Only used when the problem is solved as a MIP. More...
 
typedef SubsequenceIterator< SolverSolutionIteratorType, typename std::vector< size_t >::const_iterator > RelaxedSolutionSubsequenceIterator
 Typedef of the iterator type used to iterate over a subset of the computed solution. This iterator type is used to challenge the linear constraint functions present in the model. Only used when the problem is solved as a LP. More...
 
- Public Types inherited from opengm::Inference< LPInferenceTraits< LPCplex2< GM_TYPE, ACC_TYPE > >::GraphicalModelType, LPInferenceTraits< LPCplex2< GM_TYPE, ACC_TYPE > >::AccumulationType >
typedef LPInferenceTraits< LPCplex2< GM_TYPE, ACC_TYPE > >::GraphicalModelType GraphicalModelType
 
typedef LPInferenceTraits< LPCplex2< GM_TYPE, ACC_TYPE > >::AccumulationType AccumulationType
 
typedef GraphicalModelType::LabelType LabelType
 
typedef GraphicalModelType::IndexType IndexType
 
typedef GraphicalModelType::ValueType ValueType
 
typedef GraphicalModelType::OperatorType OperatorType
 
typedef GraphicalModelType::FactorType FactorType
 
typedef GraphicalModelType::IndependentFactorType IndependentFactorType
 
typedef GraphicalModelType::FunctionIdentifier FunctionIdentifier
 

Public Member Functions

 LPCplex2 (const GraphicalModelType &gm, const Parameter &parameter=Parameter())
 LPCplex2 constructor. More...
 
virtual ~LPCplex2 ()
 LPCplex2 destructor. More...
 
virtual std::string name () const
 Name of the inference method. More...
 
- Public Member Functions inherited from opengm::LPSolverCplex
 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...
 
- Public Member Functions inherited from opengm::LPInferenceBase< LPCplex2< GM_TYPE, ACC_TYPE > >
virtual const GraphicalModelTypegraphicalModel () const
 Get graphical model. More...
 
virtual InferenceTermination infer ()
 Run inference with empty visitor. More...
 
InferenceTermination infer (VISITOR_TYPE &visitor)
 Run inference with provided visitor. More...
 
virtual ValueType bound () const
 Get the current bound. More...
 
virtual ValueType value () const
 Get the current value. More...
 
virtual InferenceTermination arg (std::vector< LabelType > &x, const size_t N=1) const
 Get the current argument. More...
 
- Public Member Functions inherited from opengm::Inference< LPInferenceTraits< LPCplex2< GM_TYPE, ACC_TYPE > >::GraphicalModelType, LPInferenceTraits< LPCplex2< GM_TYPE, ACC_TYPE > >::AccumulationType >
virtual ~Inference ()
 
virtual void setStartingPoint (typename std::vector< LabelType >::const_iterator)
 set initial labeling More...
 
virtual InferenceTermination args (std::vector< std::vector< LabelType > > &) const
 
virtual InferenceTermination marginal (const size_t, IndependentFactorType &) const
 output a solution for a marginal for a specific variable More...
 
virtual InferenceTermination factorMarginal (const size_t, IndependentFactorType &) const
 output a solution for a marginal for all variables connected to a factor More...
 
InferenceTermination constrainedOptimum (std::vector< IndexType > &, std::vector< LabelType > &, std::vector< LabelType > &) const
 
InferenceTermination modeFromMarginal (std::vector< LabelType > &) const
 
InferenceTermination modeFromFactorMarginal (std::vector< LabelType > &) const
 

Public Attributes

 OPENGM_GM_TYPE_TYPEDEFS
 
- Public Attributes inherited from opengm::LPInferenceBase< LPCplex2< GM_TYPE, ACC_TYPE > >
 OPENGM_GM_TYPE_TYPEDEFS
 

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...
 
- Protected Types inherited from opengm::LPInferenceBase< LPCplex2< GM_TYPE, ACC_TYPE > >
typedef std::list< ConstraintStorageInactiveConstraintsListType
 Typedef of the container type used to sore a set of LPInferenceBase::ConstraintStorage objects. More...
 
typedef InactiveConstraintsListType::iterator InactiveConstraintsListIteratorType
 Typedef of the iterator type used to iterate over a set of LPInferenceBase::ConstraintStorage objects. More...
 
typedef std::pair< IndexType, const LinearConstraintType * > FactorIndexConstraintPointerPairType
 Typedef of the pair type used to store a pointer to a linear constraint in combination with the linear constraint factor index it belongs to. More...
 
typedef std::pair< InactiveConstraintsListIteratorType, FactorIndexConstraintPointerPairTypeInactiveConstraintFactorConstraintPairType
 Typedef of the pair type used to store a pointer to an inactive constraint of the local polytope constraints and a LPInferenceBase::FactorIndexConstraintPointerPairType. More...
 
typedef std::multimap< double, InactiveConstraintFactorConstraintPairTypeSortedViolatedConstraintsListType
 Typedef of the map type used to store a set of violated constraints sorted by their weights. Is only used when LPInferenceBase::Parameter::Weighted is selected as challenge heuristic. More...
 
typedef meta::GetLinearConstraintFunctionTypeList< typename GraphicalModelType::FunctionTypeList >::type LinearConstraintFunctionTypeList
 Typelist of all linear constraint function types which are present in the graphical model type. More...
 
- Protected Member Functions inherited from opengm::LPSolverCplex
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...
 
- Protected Member Functions inherited from opengm::LPInferenceBase< LPCplex2< GM_TYPE, ACC_TYPE > >
 LPInferenceBase (const GraphicalModelType &gm, const Parameter &parameter=Parameter())
 LPInferenceBase constructor. More...
 
virtual ~LPInferenceBase ()
 LPInferenceBase destructor. More...
 
void sortFactors ()
 Sorts the factors of the graphical model into the lists unaryFactors_, higherOrderFactors_, linearConstraintFactors_ and transferableFactors_. More...
 
void countLPVariables ()
 Count the number of lp variables required to build a lp model for inference of the graphical model. More...
 
void fillLinearConstraintLPVariablesSubsequenceIndices ()
 Fill the variable LPInferenceBase::linearConstraintLPVariablesSubsequenceIndices_ with the appropriate indices of the subset of the solution variables which are relevant for each linear constraint. More...
 
void setAccumulation ()
 Set the accumulation for the lp solver. More...
 
void addLPVariables ()
 Add the number of lp variables computed by LPInferenceBase::countLPVariables to the lp model. More...
 
void createObjectiveFunction ()
 Create the objective function for the lp model. More...
 
void addLocalPolytopeConstraints ()
 Add all constraints to the lp model which are required by the local polytope relaxation. More...
 
void addLoosePolytopeConstraints ()
 Add all constraints to the lp model which are required by the loose polytope relaxation. More...
 
void addTightPolytopeConstraints ()
 Add all constraints to the lp model which are required by the tight polytope relaxation. More...
 
SolverIndexType nodeLPVariableIndex (const IndexType nodeID, const LabelType label) const
 Get the lp variable which corresponds to the variable label pair of the graphical model. More...
 
SolverIndexType factorLPVariableIndex (const IndexType factorID, const size_t labelingIndex) const
 Get the lp variable which corresponds to the labeling of the factor. More...
 
SolverIndexType factorLPVariableIndex (const IndexType factorID, LABELING_ITERATOR_TYPE labelingBegin, const LABELING_ITERATOR_TYPE labelingEnd) const
 Get the lp variable which corresponds to the labeling of the factor. More...
 
bool getLPVariableIndexFromIndicatorVariable (const HIGHER_ORDER_FACTORS_MAP_TYPE &higherOrderFactorVariablesLookupTable, const INDICATOR_VARIABLES_MAP_TYPE &indicatorVariablesLookupTable, const IndicatorVariableType &indicatorVariable, const IndexType linearConstraintFactorIndex, SolverIndexType &lpVariableIndex) const
 Get the index of the lp variable associated with an indicator variable. More...
 
void addLocalPolytopeVariableConstraint (const IndexType variableID, const bool addToModel)
 Add a new variable constraint to the lp model. More...
 
void addLocalPolytopeFactorConstraint (const IndexType factor, const IndexType variable, const LabelType label, const bool addToModel)
 Add a new factor constraint to the lp model. More...
 
void addIndicatorVariableConstraints (const IndexType factor, const IndicatorVariableType &indicatorVariable, const SolverIndexType indicatorVariableLPVariable, const bool addToModel)
 Add constraints for an indicator variable to the lp model. More...
 
void addLinearConstraint (const IndexType linearConstraintFactor, const LinearConstraintType &constraint)
 Add a new linear constraint from a linear constraint function to the lp model. More...
 
InferenceTermination infer_impl_selectRelaxation (VISITOR_TYPE &visitor)
 Helper function for LPInferenceBase::infer_impl to select the relaxation template parameter. More...
 
InferenceTermination infer_impl_selectHeuristic (VISITOR_TYPE &visitor)
 Helper function for LPInferenceBase::infer_impl to select the challenge heuristic template parameter. More...
 
InferenceTermination infer_impl_selectIterations (VISITOR_TYPE &visitor)
 Helper function for LPInferenceBase::infer_impl to select the use infinite iterations template parameter. More...
 
InferenceTermination infer_impl_selectViolatedConstraints (VISITOR_TYPE &visitor)
 Helper function for LPInferenceBase::infer_impl to select the add all violated constraints template parameter. More...
 
InferenceTermination infer_impl_selectLPType (VISITOR_TYPE &visitor)
 Helper function for LPInferenceBase::infer_impl to select the use integer constraints template parameter. More...
 
InferenceTermination infer_impl (VISITOR_TYPE &visitor)
 The implementation of the inference method. More...
 
bool tightenPolytope ()
 Search for linear constraints which are violated by the current integer solution and add them to the MIP model. More...
 
bool tightenPolytopeRelaxed ()
 Search for linear constraints which are violated by the current relaxed solution and add them to the LP model. More...
 
void checkInactiveConstraint (const ConstraintStorage &constraint, double &weight) const
 Check if a given linear constraint from the local polytope constraints is violated. More...
 
void addInactiveConstraint (const ConstraintStorage &constraint)
 Add a linear constraint from the local polytope constraint to the LP/MIP model. More...
 
- Static Protected Member Functions inherited from opengm::LPSolverCplex
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 inherited from opengm::LPSolverCplex
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...
 
- Protected Attributes inherited from opengm::LPInferenceBase< LPCplex2< GM_TYPE, ACC_TYPE > >
const GraphicalModelTypegm_
 Reference to the graphical model. More...
 
const Parameter parameter_
 Parameter which stores the settings for the inference. More...
 
ValueType constValue_
 Constant value offset. More...
 
std::vector< IndexTypeunaryFactors_
 List of all unary factors. More...
 
std::vector< IndexTypehigherOrderFactors_
 List of all higher order factors. More...
 
std::vector< IndexTypelinearConstraintFactors_
 List of all linear constraint factors. More...
 
std::vector< IndexTypetransferableFactors_
 List of all transferable factors. More...
 
bool inferenceStarted_
 Tell if inference was already started. More...
 
SolverIndexType numLPVariables_
 The total number of lp variables except slack variables. More...
 
SolverIndexType numNodesLPVariables_
 The number of lp variables for the nodes of the graphical model. More...
 
SolverIndexType numFactorsLPVariables_
 The number of lp variables for the factors of the graphical model. More...
 
SolverIndexType numLinearConstraintsLPVariables_
 The number of lp variables for the linear constraint factors of the graphical model. More...
 
SolverIndexType numTransferedFactorsLPVariables
 The number of lp variables for the transferable factors of the graphical model. More...
 
SolverIndexType numSlackVariables_
 The number of slack variables for the transferable factors of the graphical model. More...
 
std::vector< SolverIndexTypenodesLPVariablesOffset_
 The offsets for the indices of the lp variables for each node of the graphical model. More...
 
std::vector< SolverIndexTypefactorsLPVariablesOffset_
 The offsets for the indices of the lp variables for each factor of the graphical model. More...
 
std::vector< std::map< const IndicatorVariableType, SolverIndexType > > linearConstraintsLPVariablesIndicesLookupTable_
 Lookup table for the lp variable indices of each linear constraint. More...
 
std::vector< std::map< const IndicatorVariableType, SolverIndexType > > transferedFactorsLPVariablesIndicesLookupTable_
 Lookup table for the lp variable indices of each transferable factor. More...
 
std::vector< std::vector< size_t > > linearConstraintLPVariablesSubsequenceIndices_
 The indices of the subset of the solution variables which are relevant for each linear constraint. More...
 
IndexType addLocalPolytopeFactorConstraintCachePreviousFactorID_
 Cache for the function LPInferenceBase::addLocalPolytopeFactorConstraint. It is used to store the factor id used for the last call of this function. If the previous factor id and the factor id of the current call to LPInferenceBase::addLocalPolytopeFactorConstraint are the same, the variable LPInferenceBase::addLocalPolytopeFactorConstraintCacheFactorLPVariableIDs_ does not have to be updated. More...
 
marray::Marray< SolverIndexTypeaddLocalPolytopeFactorConstraintCacheFactorLPVariableIDs_
 Lookup table for the factor lp variable ids required by the LPInferenceBase::addLocalPolytopeFactorConstraint function. This lookup table is cached as it may not be necessary to create a new lookup table at each function call. This is only required if the factor id of the previous function call and the factor id of the current function call differ. The factor id of the previous function call is stored in the variable LPInferenceBase::addLocalPolytopeFactorConstraintCachePreviousFactorID_. More...
 
InactiveConstraintsListType inactiveConstraints_
 Storage for all linear constraints representing the local polytope constraints. They are generated and stored for later use if LPInferenceBase::Parameter::LoosePolytope is selected as relaxation method. The constraints are removed from this list when they are added to the LP/MIP model. More...
 

Detailed Description

template<class GM_TYPE, class ACC_TYPE>
class opengm::LPCplex2< GM_TYPE, ACC_TYPE >

LP inference with CPLEX.

This class combines opengm::LPSolverCplex and opengm::LPInferenceBase to provide inference for graphical models using CPLEX.

Template Parameters
GM_TYPEGraphical Model type.
ACC_TYPEAccumulation type.

Definition at line 13 of file lpcplex2.hxx.

Member Typedef Documentation

template<class GM_TYPE , class ACC_TYPE >
opengm::LPCplex2< GM_TYPE, ACC_TYPE >::AccumulationType

Typedef of the Accumulation type.

Definition at line 16 of file lpcplex2.hxx.

template<class GM_TYPE , class ACC_TYPE >
opengm::LPCplex2< GM_TYPE, ACC_TYPE >::GraphicalModelType

Typedef of the graphical model type.

Definition at line 17 of file lpcplex2.hxx.

template<class GM_TYPE , class ACC_TYPE >
opengm::LPCplex2< GM_TYPE, ACC_TYPE >::LPInferenceBaseType

Typedef of class opengm::LPInferenceBase with appropriate template parameter.

Definition at line 19 of file lpcplex2.hxx.

template<class GM_TYPE , class ACC_TYPE >
opengm::LPCplex2< GM_TYPE, ACC_TYPE >::Parameter

Typedef of the parameter type defined by class opengm::LPInferenceBase.

Definition at line 20 of file lpcplex2.hxx.

Constructor & Destructor Documentation

template<class GM_TYPE , class ACC_TYPE >
opengm::LPCplex2< GM_TYPE, ACC_TYPE >::LPCplex2 ( const GraphicalModelType gm,
const Parameter parameter = Parameter() 
)
inline

LPCplex2 constructor.

Parameters
[in]gmThe graphical model for inference.
[in]parameterThe parameter defining the settings for inference. See opengm::LPSolverInterface::Parameter and opengm::LPInferenceBase::Parameter for possible settings.

Definition at line 102 of file lpcplex2.hxx.

template<class GM_TYPE , class ACC_TYPE >
opengm::LPCplex2< GM_TYPE, ACC_TYPE >::~LPCplex2 ( )
inlinevirtual

LPCplex2 destructor.

Definition at line 108 of file lpcplex2.hxx.

Member Function Documentation

template<class GM_TYPE , class ACC_TYPE >
std::string opengm::LPCplex2< GM_TYPE, ACC_TYPE >::name ( ) const
inlinevirtual

Member Data Documentation

template<class GM_TYPE , class ACC_TYPE >
opengm::LPCplex2< GM_TYPE, ACC_TYPE >::OPENGM_GM_TYPE_TYPEDEFS

Definition at line 18 of file lpcplex2.hxx.