|
OpenGM
2.3.x
Discrete Graphical Model Library
|
Optimization by Linear Programming (LP) or Integer LP using Guroi
http://www.gurobi.com.
More...
#include <lpgurobi.hxx>
Inheritance diagram for opengm::LPGurobi< GM, ACC >:
Collaboration diagram for opengm::LPGurobi< GM, ACC >:Classes | |
| class | Parameter |
Public Member Functions | |
| LPGurobi (const GraphicalModelType &, const Parameter &=Parameter()) | |
| ~LPGurobi () | |
| virtual std::string | name () const |
| const GraphicalModelType & | graphicalModel () const |
| virtual InferenceTermination | infer () |
| template<class VisitorType > | |
| InferenceTermination | infer (VisitorType &) |
| virtual InferenceTermination | arg (std::vector< LabelType > &, const size_t=1) const |
| output a solution More... | |
| virtual InferenceTermination | args (std::vector< std::vector< LabelType > > &) const |
| void | variable (const size_t, IndependentFactorType &out) const |
| void | factorVariable (const size_t, IndependentFactorType &out) const |
| GM::ValueType | bound () const |
| return a bound on the solution More... | |
| GM::ValueType | value () const |
| return the solution (value) More... | |
| size_t | lpNodeVi (const IndexType variableIndex, const LabelType label) const |
| size_t | lpFactorVi (const IndexType factorIndex, const size_t labelingIndex) const |
| template<class LABELING_ITERATOR > | |
| size_t | lpFactorVi (const IndexType factorIndex, LABELING_ITERATOR labelingBegin, LABELING_ITERATOR labelingEnd) const |
| template<class LPVariableIndexIterator , class CoefficientIterator > | |
| void | addConstraint (LPVariableIndexIterator, LPVariableIndexIterator, CoefficientIterator, const ValueType &, const ValueType &, const char *name=0) |
| add constraint More... | |
| void | writeModelToDisk (const std::string &filename) const |
| template<class LABELING_ITERATOR > | |
| size_t | lpFactorVi (const typename LPGurobi< GM, ACC >::IndexType factorIndex, LABELING_ITERATOR labelingBegin, LABELING_ITERATOR labelingEnd) const |
Public Member Functions inherited from opengm::Inference< GM, ACC > | |
| virtual | ~Inference () |
| virtual void | setStartingPoint (typename std::vector< LabelType >::const_iterator) |
| set initial labeling More... | |
| 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 | |
Optimization by Linear Programming (LP) or Integer LP using Guroi
http://www.gurobi.com.
The optimization problem is reformulated as an LP or ILP. For the LP, a first order local polytope approximation of the marginal polytope is used, i.e. the affine instead of the convex hull.
Gurobi is a commercial product that is free for accadamical use.
Definition at line 38 of file lpgurobi.hxx.
| typedef ACC opengm::LPGurobi< GM, ACC >::AccumulationType |
Definition at line 40 of file lpgurobi.hxx.
| typedef ACC opengm::LPGurobi< GM, ACC >::AccumulatorType |
Definition at line 41 of file lpgurobi.hxx.
| typedef visitors::EmptyVisitor< LPGurobi<GM, ACC> > opengm::LPGurobi< GM, ACC >::EmptyVisitorType |
Definition at line 46 of file lpgurobi.hxx.
| typedef GM opengm::LPGurobi< GM, ACC >::GraphicalModelType |
Definition at line 42 of file lpgurobi.hxx.
| typedef visitors::TimingVisitor<LPGurobi<GM, ACC> > opengm::LPGurobi< GM, ACC >::TimingVisitorType |
Definition at line 45 of file lpgurobi.hxx.
| typedef visitors::VerboseVisitor<LPGurobi<GM, ACC> > opengm::LPGurobi< GM, ACC >::VerboseVisitorType |
Definition at line 44 of file lpgurobi.hxx.
| opengm::LPGurobi< GM, ACC >::LPGurobi | ( | const GraphicalModelType & | gm, |
| const Parameter & | para = Parameter() |
||
| ) |
| opengm::LPGurobi< GM, ACC >::~LPGurobi | ( | ) |
Definition at line 657 of file lpgurobi.hxx.
|
inline |
add constraint
| viBegin | iterator to the beginning of a sequence of variable indices |
| viEnd | iterator to the end of a sequence of variable indices |
| coefficient | iterator to the beginning of a sequence of coefficients |
| lowerBound | lower bound |
| upperBound | upper bound |
variable indices refer to variables of the LP that is set up in the constructor of LPGurobi (NOT to the variables of the graphical model).
Definition at line 828 of file lpgurobi.hxx.
|
inlinevirtual |
output a solution
| [out] | arg | labeling |
| argIndex | solution index (1=best, 2=second best, etc.) |
Reimplemented from opengm::Inference< GM, ACC >.
Definition at line 665 of file lpgurobi.hxx.
|
inlinevirtual |
Reimplemented from opengm::Inference< GM, ACC >.
Definition at line 156 of file lpgurobi.hxx.
|
virtual |
return a bound on the solution
Reimplemented from opengm::Inference< GM, ACC >.
Definition at line 752 of file lpgurobi.hxx.
| void opengm::LPGurobi< GM, ACC >::factorVariable | ( | const size_t | factorId, |
| IndependentFactorType & | out | ||
| ) | const |
Definition at line 712 of file lpgurobi.hxx.
|
inlinevirtual |
Implements opengm::Inference< GM, ACC >.
Definition at line 739 of file lpgurobi.hxx.
|
virtual |
Implements opengm::Inference< GM, ACC >.
Definition at line 616 of file lpgurobi.hxx.
| InferenceTermination opengm::LPGurobi< GM, ACC >::infer | ( | VisitorType & | visitor | ) |
Definition at line 625 of file lpgurobi.hxx.
| size_t opengm::LPGurobi< GM, ACC >::lpFactorVi | ( | const IndexType | factorIndex, |
| const size_t | labelingIndex | ||
| ) | const |
| size_t opengm::LPGurobi< GM, ACC >::lpFactorVi | ( | const IndexType | factorIndex, |
| LABELING_ITERATOR | labelingBegin, | ||
| LABELING_ITERATOR | labelingEnd | ||
| ) | const |
|
inline |
Definition at line 794 of file lpgurobi.hxx.
|
inline |
Definition at line 767 of file lpgurobi.hxx.
|
inlinevirtual |
Implements opengm::Inference< GM, ACC >.
Definition at line 149 of file lpgurobi.hxx.
|
virtual |
return the solution (value)
Reimplemented from opengm::Inference< GM, ACC >.
Definition at line 745 of file lpgurobi.hxx.
| void opengm::LPGurobi< GM, ACC >::variable | ( | const size_t | nodeId, |
| IndependentFactorType & | out | ||
| ) | const |
Definition at line 695 of file lpgurobi.hxx.
|
inline |
Definition at line 171 of file lpgurobi.hxx.
| opengm::LPGurobi< GM, ACC >::OPENGM_GM_TYPE_TYPEDEFS |
Definition at line 43 of file lpgurobi.hxx.
1.8.9.1