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

GraphicalModelManipulator. More...

#include <graphicalmodel_manipulator.hxx>

+ Collaboration diagram for opengm::GraphicalModelManipulator< GM >:

Public Types

enum  ManipulationMode { FIX, DROP }
 
typedef GM OGM
 
typedef GM::SpaceType OSpaceType
 
typedef GM::IndexType IndexType
 
typedef GM::LabelType LabelType
 
typedef GM::ValueType ValueType
 
typedef opengm::DiscreteSpace< IndexType, LabelTypeMSpaceType
 
typedef meta::TypeListGenerator< ViewFixVariablesFunction< GM >, ViewFunction< GM >, ConstantFunction< ValueType, IndexType, LabelType >, ExplicitFunction< ValueType, IndexType, LabelType > >::type MFunctionTypeList
 
typedef GraphicalModel< ValueType, typename GM::OperatorType, MFunctionTypeList, MSpaceTypeMGM
 

Public Member Functions

 GraphicalModelManipulator (const GM &gm, const ManipulationMode mode=FIX)
 
void buildModifiedModel ()
 build modified model More...
 
void buildModifiedSubModels ()
 build modified sub-models More...
 
const OGMgetOriginalModel () const
 return the original graphical model More...
 
const MGMgetModifiedModel () const
 return the modified graphical model More...
 
const MGMgetModifiedSubModel (size_t) const
 return the i-th modified sub graphical model More...
 
size_t numberOfSubmodels () const
 return the number of submodels More...
 
void modifiedState2OriginalState (const std::vector< LabelType > &, std::vector< LabelType > &) const
 transforming label of the modified to the labeling of the original problem More...
 
void modifiedSubStates2OriginalState (const std::vector< std::vector< LabelType > > &, std::vector< LabelType > &) const
 transforming label of the modified subproblems to the labeling of the original problem More...
 
bool isLocked () const
 return true if model is locked More...
 
void fixVariable (const typename GM::IndexType, const typename GM::LabelType)
 fix label for variable More...
 
void freeVariable (const typename GM::IndexType)
 remove fixed label for variable More...
 
void freeAllVariables ()
 remove fixed label for all variable More...
 
void unlock ()
 unlock model More...
 
void lock ()
 lock model More...
 
template<class ACC >
void lockAndTentacelElimination ()
 
bool isFixed (const typename GM::IndexType) const
 

Detailed Description

template<class GM>
class opengm::GraphicalModelManipulator< GM >

GraphicalModelManipulator.

Implementation of the core part of reduction techniques proposed in J.H. Kappes, M. Speth, G. Reinelt, and C. Schnörr: Towards Efficient and Exact MAP-Inference for Large Scale Discrete Computer Vision Problems via Combinatorial Optimization, CVPR 2013

it provides:

it extends the published version by

it requires:

Corresponding author: Jörg Hendrik Kappes

Invariant: Order of the variables in the modified subgraphs is the same as in the original graph See also: reducedinference.hxx

Definition at line 47 of file graphicalmodel_manipulator.hxx.

Member Typedef Documentation

template<class GM>
typedef GM::IndexType opengm::GraphicalModelManipulator< GM >::IndexType

Definition at line 52 of file graphicalmodel_manipulator.hxx.

template<class GM>
typedef GM::LabelType opengm::GraphicalModelManipulator< GM >::LabelType

Definition at line 53 of file graphicalmodel_manipulator.hxx.

Definition at line 66 of file graphicalmodel_manipulator.hxx.

template<class GM>
typedef GraphicalModel<ValueType, typename GM::OperatorType, MFunctionTypeList, MSpaceType> opengm::GraphicalModelManipulator< GM >::MGM

Definition at line 67 of file graphicalmodel_manipulator.hxx.

Definition at line 61 of file graphicalmodel_manipulator.hxx.

template<class GM>
typedef GM opengm::GraphicalModelManipulator< GM >::OGM

Definition at line 50 of file graphicalmodel_manipulator.hxx.

template<class GM>
typedef GM::SpaceType opengm::GraphicalModelManipulator< GM >::OSpaceType

Definition at line 51 of file graphicalmodel_manipulator.hxx.

template<class GM>
typedef GM::ValueType opengm::GraphicalModelManipulator< GM >::ValueType

Definition at line 54 of file graphicalmodel_manipulator.hxx.

Constructor & Destructor Documentation

template<class GM >
opengm::GraphicalModelManipulator< GM >::GraphicalModelManipulator ( const GM &  gm,
const ManipulationMode  mode = FIX 
)

Definition at line 133 of file graphicalmodel_manipulator.hxx.

Member Function Documentation

template<class GM >
void opengm::GraphicalModelManipulator< GM >::buildModifiedModel ( )

build modified model

Definition at line 300 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
void opengm::GraphicalModelManipulator< GM >::buildModifiedSubModels ( )

build modified sub-models

Definition at line 386 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
void opengm::GraphicalModelManipulator< GM >::fixVariable ( const typename GM::IndexType  var,
const typename GM::LabelType  l 
)

fix label for variable

Definition at line 210 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
void opengm::GraphicalModelManipulator< GM >::freeAllVariables ( )

remove fixed label for all variable

Definition at line 231 of file graphicalmodel_manipulator.hxx.

template<class GM >
void opengm::GraphicalModelManipulator< GM >::freeVariable ( const typename GM::IndexType  var)

remove fixed label for variable

Definition at line 221 of file graphicalmodel_manipulator.hxx.

template<class GM >
const GraphicalModelManipulator< GM >::MGM & opengm::GraphicalModelManipulator< GM >::getModifiedModel ( ) const
inline

return the modified graphical model

Definition at line 157 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
const GraphicalModelManipulator< GM >::MGM & opengm::GraphicalModelManipulator< GM >::getModifiedSubModel ( size_t  i) const
inline

return the i-th modified sub graphical model

Definition at line 166 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
const GraphicalModelManipulator< GM >::OGM & opengm::GraphicalModelManipulator< GM >::getOriginalModel ( ) const
inline

return the original graphical model

Definition at line 149 of file graphicalmodel_manipulator.hxx.

template<class GM >
bool opengm::GraphicalModelManipulator< GM >::isFixed ( const typename GM::IndexType  vi) const

Definition at line 127 of file graphicalmodel_manipulator.hxx.

template<class GM >
bool opengm::GraphicalModelManipulator< GM >::isLocked ( ) const

return true if model is locked

Definition at line 203 of file graphicalmodel_manipulator.hxx.

template<class GM >
void opengm::GraphicalModelManipulator< GM >::lock ( )

lock model

Definition at line 194 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
template<class ACC >
void opengm::GraphicalModelManipulator< GM >::lockAndTentacelElimination ( )

Definition at line 495 of file graphicalmodel_manipulator.hxx.

+ Here is the call graph for this function:

template<class GM >
void opengm::GraphicalModelManipulator< GM >::modifiedState2OriginalState ( const std::vector< LabelType > &  ml,
std::vector< LabelType > &  ol 
) const

transforming label of the modified to the labeling of the original problem

Definition at line 243 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
void opengm::GraphicalModelManipulator< GM >::modifiedSubStates2OriginalState ( const std::vector< std::vector< LabelType > > &  subconf,
std::vector< LabelType > &  conf 
) const

transforming label of the modified subproblems to the labeling of the original problem

Definition at line 272 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
size_t opengm::GraphicalModelManipulator< GM >::numberOfSubmodels ( ) const

return the number of submodels

Definition at line 175 of file graphicalmodel_manipulator.hxx.

+ Here is the caller graph for this function:

template<class GM >
void opengm::GraphicalModelManipulator< GM >::unlock ( )

unlock model

Definition at line 183 of file graphicalmodel_manipulator.hxx.