|
OpenGM
2.3.x
Discrete Graphical Model Library
|
LP inference with Gurobi. More...
#include <lpgurobi2.hxx>
Inheritance diagram for opengm::LPGurobi2< GM_TYPE, ACC_TYPE >:
Collaboration diagram for opengm::LPGurobi2< 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< LPGurobi2< 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::LPSolverGurobi | |
| 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, GurobiTimingType > | LPSolverBaseClass |
| 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 Types inherited from opengm::LPInferenceBase< LPGurobi2< GM_TYPE, ACC_TYPE > > | |
| typedef LPGurobi2< GM_TYPE, ACC_TYPE > | LPInferenceType |
| Typedef of the child class which inherits from opengm::LPInferenceBase. More... | |
| typedef LPInferenceTraits< LPInferenceType > | LPInferenceTraitsType |
| Typedef of the opengm::LPInferenceTraits class with appropriate template parameter. More... | |
| typedef LPInferenceBase< LPInferenceType > | LPInferenceBaseType |
| 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< LPInferenceBaseType > | VerboseVisitorType |
| Typedef of the opengm::visitors::VerboseVisitor class with appropriate template parameter. More... | |
| typedef visitors::EmptyVisitor< LPInferenceBaseType > | EmptyVisitorType |
| Typedef of the opengm::visitors::EmptyVisitor class with appropriate template parameter. More... | |
| typedef visitors::TimingVisitor< LPInferenceBaseType > | TimingVisitorType |
| Typedef of the opengm::visitors::TimingVisitor class with appropriate template parameter. More... | |
| typedef LinearConstraint< ValueType, IndexType, LabelType > | LinearConstraintType |
| Typedef of the opengm::LinearConstraint class with appropriate template parameter. Used to represent linear constraints. More... | |
| typedef std::vector< LinearConstraintType > | LinearConstraintsContainerType |
| 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, LabelType > | LPFunctionTransferType |
| 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< LPGurobi2< GM_TYPE, ACC_TYPE > >::GraphicalModelType, LPInferenceTraits< LPGurobi2< GM_TYPE, ACC_TYPE > >::AccumulationType > | |
| typedef LPInferenceTraits< LPGurobi2< GM_TYPE, ACC_TYPE > >::GraphicalModelType | GraphicalModelType |
| typedef LPInferenceTraits< LPGurobi2< 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 | |
| LPGurobi2 (const GraphicalModelType &gm, const Parameter ¶meter=Parameter()) | |
| LPGurobi2 constructor. More... | |
| virtual | ~LPGurobi2 () |
| LPGurobi2 destructor. More... | |
| virtual std::string | name () const |
| Name of the inference method. More... | |
Public Member Functions inherited from opengm::LPSolverGurobi | |
| LPSolverGurobi (const Parameter ¶meter=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 ¶meter=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< LPGurobi2< GM_TYPE, ACC_TYPE > > | |
| virtual const GraphicalModelType & | graphicalModel () 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< LPGurobi2< GM_TYPE, ACC_TYPE > >::GraphicalModelType, LPInferenceTraits< LPGurobi2< 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< LPGurobi2< GM_TYPE, ACC_TYPE > > | |
| OPENGM_GM_TYPE_TYPEDEFS | |
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... | |
Protected Types inherited from opengm::LPInferenceBase< LPGurobi2< GM_TYPE, ACC_TYPE > > | |
| typedef std::list< ConstraintStorage > | InactiveConstraintsListType |
| 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, FactorIndexConstraintPointerPairType > | InactiveConstraintFactorConstraintPairType |
| 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, InactiveConstraintFactorConstraintPairType > | SortedViolatedConstraintsListType |
| 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::LPSolverGurobi | |
| 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... | |
Protected Member Functions inherited from opengm::LPInferenceBase< LPGurobi2< GM_TYPE, ACC_TYPE > > | |
| LPInferenceBase (const GraphicalModelType &gm, const Parameter ¶meter=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::LPSolverGurobi | |
| 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 inherited from opengm::LPSolverGurobi | |
| 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< GurobiValueType > | gurobiSolution_ |
| 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... | |
Protected Attributes inherited from opengm::LPInferenceBase< LPGurobi2< GM_TYPE, ACC_TYPE > > | |
| const GraphicalModelType & | gm_ |
| 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< IndexType > | unaryFactors_ |
| List of all unary factors. More... | |
| std::vector< IndexType > | higherOrderFactors_ |
| List of all higher order factors. More... | |
| std::vector< IndexType > | linearConstraintFactors_ |
| List of all linear constraint factors. More... | |
| std::vector< IndexType > | transferableFactors_ |
| 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< SolverIndexType > | nodesLPVariablesOffset_ |
| The offsets for the indices of the lp variables for each node of the graphical model. More... | |
| std::vector< SolverIndexType > | factorsLPVariablesOffset_ |
| 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< SolverIndexType > | addLocalPolytopeFactorConstraintCacheFactorLPVariableIDs_ |
| 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... | |
LP inference with Gurobi.
This class combines opengm::LPSolverGurobi and opengm::LPInferenceBase to provide inference for graphical models using Gurobi.
| GM_TYPE | Graphical Model type. |
| ACC_TYPE | Accumulation type. |
Definition at line 13 of file lpgurobi2.hxx.
| opengm::LPGurobi2< GM_TYPE, ACC_TYPE >::AccumulationType |
Typedef of the Accumulation type.
Definition at line 16 of file lpgurobi2.hxx.
| opengm::LPGurobi2< GM_TYPE, ACC_TYPE >::GraphicalModelType |
Typedef of the graphical model type.
Definition at line 17 of file lpgurobi2.hxx.
| opengm::LPGurobi2< GM_TYPE, ACC_TYPE >::LPInferenceBaseType |
Typedef of class opengm::LPInferenceBase with appropriate template parameter.
Definition at line 19 of file lpgurobi2.hxx.
| opengm::LPGurobi2< GM_TYPE, ACC_TYPE >::Parameter |
Typedef of the parameter type defined by class opengm::LPInferenceBase.
Definition at line 20 of file lpgurobi2.hxx.
|
inline |
LPGurobi2 constructor.
| [in] | gm | The graphical model for inference. |
| [in] | parameter | The parameter defining the settings for inference. See opengm::LPSolverInterface::Parameter and opengm::LPInferenceBase::Parameter for possible settings. |
Definition at line 102 of file lpgurobi2.hxx.
|
inlinevirtual |
LPGurobi2 destructor.
Definition at line 108 of file lpgurobi2.hxx.
|
inlinevirtual |
Name of the inference method.
Definition at line 113 of file lpgurobi2.hxx.
| opengm::LPGurobi2< GM_TYPE, ACC_TYPE >::OPENGM_GM_TYPE_TYPEDEFS |
Definition at line 18 of file lpgurobi2.hxx.
1.8.9.1