OpenGM  2.3.x
Discrete Graphical Model Library
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
opengm::LPCplex< GM, ACC > Class Template Reference

Optimization by Linear Programming (LP) or Integer LP using IBM ILOG CPLEX

http://www.ilog.com/products/cplex/. More...

#include <lpcplex.hxx>

+ Inheritance diagram for opengm::LPCplex< GM, ACC >:
+ Collaboration diagram for opengm::LPCplex< GM, ACC >:

Classes

class  Parameter
 

Public Types

typedef ACC AccumulationType
 
typedef ACC AccumulatorType
 
typedef GM GraphicalModelType
 
typedef visitors::VerboseVisitor< LPCplex< GM, ACC > > VerboseVisitorType
 
typedef visitors::EmptyVisitor< LPCplex< GM, ACC > > EmptyVisitorType
 
typedef visitors::TimingVisitor< LPCplex< GM, ACC > > TimingVisitorType
 
- Public Types inherited from opengm::Inference< GM, ACC >
typedef GM GraphicalModelType
 
typedef ACC 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 Types inherited from opengm::LPDef
enum  LP_SOLVER {
  LP_SOLVER_AUTO, LP_SOLVER_PRIMAL_SIMPLEX, LP_SOLVER_DUAL_SIMPLEX, LP_SOLVER_NETWORK_SIMPLEX,
  LP_SOLVER_BARRIER, LP_SOLVER_SIFTING, LP_SOLVER_CONCURRENT
}
 
enum  LP_PRESOLVE { LP_PRESOLVE_AUTO, LP_PRESOLVE_OFF, LP_PRESOLVE_CONSERVATIVE, LP_PRESOLVE_AGGRESSIVE }
 
enum  MIP_EMPHASIS {
  MIP_EMPHASIS_BALANCED, MIP_EMPHASIS_FEASIBILITY, MIP_EMPHASIS_OPTIMALITY, MIP_EMPHASIS_BESTBOUND,
  MIP_EMPHASIS_HIDDENFEAS
}
 
enum  MIP_CUT {
  MIP_CUT_DEFAULT, MIP_CUT_AUTO, MIP_CUT_OFF, MIP_CUT_ON,
  MIP_CUT_AGGRESSIVE, MIP_CUT_VERYAGGRESSIVE
}
 

Public Member Functions

 LPCplex (const GraphicalModelType &, const Parameter &=Parameter())
 
 ~LPCplex ()
 
virtual std::string name () const
 
const GraphicalModelTypegraphicalModel () 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...
 
void setStartingPoint (typename std::vector< LabelType >::const_iterator)
 set initial labeling 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...
 
template<class LABELING_ITERATOR >
size_t lpFactorVi (const typename LPCplex< GM, ACC >::IndexType factorIndex, LABELING_ITERATOR labelingBegin, LABELING_ITERATOR labelingEnd) const
 
- Public Member Functions inherited from opengm::Inference< GM, ACC >
virtual ~Inference ()
 
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
 

Additional Inherited Members

- Static Public Attributes inherited from opengm::LPDef
static const int default_numberOfThreads_
 
static const bool default_verbose_
 
static const double default_cutUp_
 
static const double default_epOpt_
 
static const double default_epMrk_
 
static const double default_epRHS_
 
static const double default_epInt_
 
static const double default_epAGap_
 
static const double default_epGap_
 
static const double default_workMem_
 
static const double default_treeMemoryLimit_
 
static const double default_timeLimit_
 
static const int default_probingLevel_
 
static const LP_SOLVER default_rootAlg_
 
static const LP_SOLVER default_nodeAlg_
 
static const MIP_EMPHASIS default_mipEmphasis_
 
static const LP_PRESOLVE default_presolve_
 
static const MIP_CUT default_cutLevel_
 
static const MIP_CUT default_cliqueCutLevel_
 
static const MIP_CUT default_coverCutLevel_
 
static const MIP_CUT default_gubCutLevel_
 
static const MIP_CUT default_mirCutLevel_
 
static const MIP_CUT default_iboundCutLevel_
 
static const MIP_CUT default_flowcoverCutLevel_
 
static const MIP_CUT default_flowpathCutLevel_
 
static const MIP_CUT default_disjunctCutLevel_
 
static const MIP_CUT default_gomoryCutLevel_
 

Detailed Description

template<class GM, class ACC>
class opengm::LPCplex< GM, ACC >

Optimization by Linear Programming (LP) or Integer LP using IBM ILOG CPLEX

http://www.ilog.com/products/cplex/.

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.

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

Definition at line 38 of file lpcplex.hxx.

Member Typedef Documentation

template<class GM, class ACC>
typedef ACC opengm::LPCplex< GM, ACC >::AccumulationType

Definition at line 40 of file lpcplex.hxx.

template<class GM, class ACC>
typedef ACC opengm::LPCplex< GM, ACC >::AccumulatorType

Definition at line 41 of file lpcplex.hxx.

template<class GM, class ACC>
typedef visitors::EmptyVisitor<LPCplex<GM,ACC> > opengm::LPCplex< GM, ACC >::EmptyVisitorType

Definition at line 45 of file lpcplex.hxx.

template<class GM, class ACC>
typedef GM opengm::LPCplex< GM, ACC >::GraphicalModelType

Definition at line 42 of file lpcplex.hxx.

template<class GM, class ACC>
typedef visitors::TimingVisitor<LPCplex<GM,ACC> > opengm::LPCplex< GM, ACC >::TimingVisitorType

Definition at line 46 of file lpcplex.hxx.

template<class GM, class ACC>
typedef visitors::VerboseVisitor<LPCplex<GM,ACC> > opengm::LPCplex< GM, ACC >::VerboseVisitorType

Definition at line 44 of file lpcplex.hxx.

Constructor & Destructor Documentation

template<class GM , class ACC >
opengm::LPCplex< GM, ACC >::LPCplex ( const GraphicalModelType gm,
const Parameter para = Parameter() 
)

Definition at line 195 of file lpcplex.hxx.

+ Here is the call graph for this function:

template<class GM , class ACC >
opengm::LPCplex< GM, ACC >::~LPCplex ( )

Definition at line 526 of file lpcplex.hxx.

Member Function Documentation

template<class GM , class ACC >
template<class LPVariableIndexIterator , class CoefficientIterator >
void opengm::LPCplex< GM, ACC >::addConstraint ( LPVariableIndexIterator  viBegin,
LPVariableIndexIterator  viEnd,
CoefficientIterator  coefficient,
const ValueType lowerBound,
const ValueType upperBound,
const char *  name = 0 
)
inline

add constraint

Parameters
viBeginiterator to the beginning of a sequence of variable indices
viEnditerator to the end of a sequence of variable indices
coefficientiterator to the beginning of a sequence of coefficients
lowerBoundlower bound
upperBoundupper bound

variable indices refer to variables of the LP that is set up in the constructor of LPCplex (NOT to the variables of the graphical model).

Definition at line 712 of file lpcplex.hxx.

template<class GM, class ACC>
InferenceTermination opengm::LPCplex< GM, ACC >::arg ( std::vector< LabelType > &  arg,
const size_t  argIndex = 1 
) const
inlinevirtual

output a solution

Parameters
[out]arglabeling
argIndexsolution index (1=best, 2=second best, etc.)

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 533 of file lpcplex.hxx.

template<class GM, class ACC>
virtual InferenceTermination opengm::LPCplex< GM, ACC >::args ( std::vector< std::vector< LabelType > > &  ) const
inlinevirtual

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 159 of file lpcplex.hxx.

template<class GM , class ACC >
GM::ValueType opengm::LPCplex< GM, ACC >::bound ( ) const
virtual

return a bound on the solution

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 633 of file lpcplex.hxx.

template<class GM , class ACC >
void opengm::LPCplex< GM, ACC >::factorVariable ( const size_t  factorId,
IndependentFactorType out 
) const

Definition at line 577 of file lpcplex.hxx.

template<class GM , class ACC >
const LPCplex< GM, ACC >::GraphicalModelType & opengm::LPCplex< GM, ACC >::graphicalModel ( ) const
inlinevirtual

Implements opengm::Inference< GM, ACC >.

Definition at line 620 of file lpcplex.hxx.

template<class GM , class ACC >
InferenceTermination opengm::LPCplex< GM, ACC >::infer ( )
virtual

Implements opengm::Inference< GM, ACC >.

Definition at line 353 of file lpcplex.hxx.

template<class GM , class ACC >
template<class VisitorType >
InferenceTermination opengm::LPCplex< GM, ACC >::infer ( VisitorType &  visitor)

Definition at line 362 of file lpcplex.hxx.

template<class GM, class ACC>
size_t opengm::LPCplex< GM, ACC >::lpFactorVi ( const IndexType  factorIndex,
const size_t  labelingIndex 
) const
template<class GM, class ACC>
template<class LABELING_ITERATOR >
size_t opengm::LPCplex< GM, ACC >::lpFactorVi ( const IndexType  factorIndex,
LABELING_ITERATOR  labelingBegin,
LABELING_ITERATOR  labelingEnd 
) const
template<class GM, class ACC>
template<class LABELING_ITERATOR >
size_t opengm::LPCplex< GM, ACC >::lpFactorVi ( const typename LPCplex< GM, ACC >::IndexType  factorIndex,
LABELING_ITERATOR  labelingBegin,
LABELING_ITERATOR  labelingEnd 
) const
inline

Definition at line 678 of file lpcplex.hxx.

template<class GM, class ACC>
size_t opengm::LPCplex< GM, ACC >::lpNodeVi ( const IndexType  variableIndex,
const LabelType  label 
) const
inline

Definition at line 651 of file lpcplex.hxx.

template<class GM, class ACC>
virtual std::string opengm::LPCplex< GM, ACC >::name ( ) const
inlinevirtual

Implements opengm::Inference< GM, ACC >.

Definition at line 152 of file lpcplex.hxx.

template<class GM, class ACC>
void opengm::LPCplex< GM, ACC >::setStartingPoint ( typename std::vector< LabelType >::const_iterator  begin)
inlinevirtual

set initial labeling

Parameters
beginiterator to the beginning of a sequence of labels

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 603 of file lpcplex.hxx.

template<class GM , class ACC >
GM::ValueType opengm::LPCplex< GM, ACC >::value ( ) const
virtual

return the solution (value)

Reimplemented from opengm::Inference< GM, ACC >.

Definition at line 626 of file lpcplex.hxx.

template<class GM , class ACC >
void opengm::LPCplex< GM, ACC >::variable ( const size_t  nodeId,
IndependentFactorType out 
) const

Definition at line 562 of file lpcplex.hxx.

Member Data Documentation

template<class GM, class ACC>
opengm::LPCplex< GM, ACC >::OPENGM_GM_TYPE_TYPEDEFS

Definition at line 43 of file lpcplex.hxx.