OpenGM  2.3.x
Discrete Graphical Model Library
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
opengm::external::GCOLIB< GM > Class Template Reference

GCOLIB GCOLIB inference algorithm class. More...

#include <gco.hxx>

+ Inheritance diagram for opengm::external::GCOLIB< GM >:
+ Collaboration diagram for opengm::external::GCOLIB< GM >:

Classes

struct  Parameter
 Parameter. More...
 

Public Types

typedef GM GraphicalModelType
 
typedef opengm::Minimizer AccumulationType
 
typedef visitors::VerboseVisitor< GCOLIB< GM > > VerboseVisitorType
 
typedef visitors::EmptyVisitor< GCOLIB< GM > > EmptyVisitorType
 
typedef visitors::TimingVisitor< GCOLIB< GM > > TimingVisitorType
 
- Public Types inherited from opengm::Inference< GM, opengm::Minimizer >
typedef GM GraphicalModelType
 
typedef opengm::Minimizer 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

 GCOLIB (const GraphicalModelType &gm, const Parameter &para)
 
 ~GCOLIB ()
 
std::string name () const
 
const GraphicalModelTypegraphicalModel () const
 
template<class VISITOR >
InferenceTermination infer (VISITOR &visitor)
 
InferenceTermination infer ()
 
InferenceTermination arg (std::vector< LabelType > &, const size_t &=1) const
 
GM::ValueType bound () const
 return a bound on the solution More...
 
GM::ValueType value () const
 return the solution (value) More...
 
- Public Member Functions inherited from opengm::Inference< GM, opengm::Minimizer >
virtual ~Inference ()
 
virtual void setStartingPoint (typename std::vector< LabelType >::const_iterator)
 set initial labeling More...
 
virtual InferenceTermination arg (std::vector< LabelType > &, const size_t=1) const
 output a solution 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
 

Protected Types

typedef gcoLib::GCoptimization::EnergyTermType EnergyTermType
 

Protected Member Functions

void generateEnergyWeightedTable ()
 
void setD ()
 
void setV ()
 
void setWeightedTableWeights ()
 
bool hasSameLabelNumber () const
 
bool sameEnergyTable () const
 
bool symmetricEnergyTable () const
 
void generateEnergyView ()
 
void generateFirstOrderFactorLookupTable ()
 
void generateSecondOrderFactorLookupTables ()
 
void generateEnergyTables ()
 
void copyFactorValues ()
 
bool valueCheck () const
 

Static Protected Member Functions

static EnergyTermType firstOrderFactorViewAccess (int pix, int i)
 
static EnergyTermType secondOrderFactorViewGridAccess (int pix1, int pix2, int i, int j)
 
static EnergyTermType secondOrderFactorViewGeneralAccess (int pix1, int pix2, int i, int j)
 
static EnergyTermType firstOrderFactorTablesAccess (int pix, int i)
 
static EnergyTermType secondOrderFactorTablesGridAccess (int pix1, int pix2, int i, int j)
 

Protected Attributes

const GraphicalModelTypegm_
 
Parameter parameter_
 
bool isGrid_
 
IndexType sizeX_
 
IndexType sizeY_
 
const IndexType numNodes_
 
const LabelType numLabels_
 
marray::Matrix< size_tgrid_
 
gcoLib::GCoptimizationGeneralGraph * GCOGeneralGraph_
 
gcoLib::GCoptimizationGridGraph * GCOGridGraph_
 
EnergyTermTypeD_
 
EnergyTermTypeV_
 
EnergyTermTypehCue_
 
EnergyTermTypevCue_
 
std::vector< std::vector< IndexType > > firstOrderFactorLookupTable_
 
std::vector< std::vector< IndexType > > horizontalSecondOrderFactorLookupTable_
 
std::vector< std::vector< IndexType > > verticalSecondOrderFactorLookupTable_
 
std::map< std::pair< IndexType, IndexType >, std::vector< IndexType > > generalSecondOrderFactorLookupTable_
 
std::vector< EnergyTermTypefirstOrderFactorValues
 
std::vector< EnergyTermTypesecondOrderFactorGridValues
 

Static Protected Attributes

static GCOLIB< GM > * mySelfView_ = NULL
 
static GCOLIB< GM > * mySelfTables_ = NULL
 
static const IndexType right_ = 0
 
static const IndexType down_ = 1
 

Detailed Description

template<class GM>
class opengm::external::GCOLIB< GM >

GCOLIB GCOLIB inference algorithm class.

Maximum factor order :2

Definition at line 29 of file gco.hxx.

Member Typedef Documentation

template<class GM>
typedef opengm::Minimizer opengm::external::GCOLIB< GM >::AccumulationType

Definition at line 32 of file gco.hxx.

Definition at line 35 of file gco.hxx.

template<class GM>
typedef gcoLib::GCoptimization::EnergyTermType opengm::external::GCOLIB< GM >::EnergyTermType
protected

Definition at line 75 of file gco.hxx.

template<class GM>
typedef GM opengm::external::GCOLIB< GM >::GraphicalModelType

Definition at line 31 of file gco.hxx.

Definition at line 36 of file gco.hxx.

Definition at line 34 of file gco.hxx.

Constructor & Destructor Documentation

template<class GM>
opengm::external::GCOLIB< GM >::GCOLIB ( const GraphicalModelType gm,
const Parameter para 
)

Definition at line 137 of file gco.hxx.

+ Here is the call graph for this function:

template<class GM >
opengm::external::GCOLIB< GM >::~GCOLIB ( )

Definition at line 202 of file gco.hxx.

Member Function Documentation

template<class GM >
InferenceTermination opengm::external::GCOLIB< GM >::arg ( std::vector< LabelType > &  arg,
const size_t n = 1 
) const
inline

Definition at line 335 of file gco.hxx.

template<class GM >
GM::ValueType opengm::external::GCOLIB< GM >::bound ( ) const
inlinevirtual

return a bound on the solution

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

Definition at line 356 of file gco.hxx.

+ Here is the call graph for this function:

template<class GM >
void opengm::external::GCOLIB< GM >::copyFactorValues ( )
inlineprotected

Definition at line 778 of file gco.hxx.

template<class GM >
GCOLIB< GM >::EnergyTermType opengm::external::GCOLIB< GM >::firstOrderFactorTablesAccess ( int  pix,
int  i 
)
inlinestaticprotected

Definition at line 838 of file gco.hxx.

template<class GM >
GCOLIB< GM >::EnergyTermType opengm::external::GCOLIB< GM >::firstOrderFactorViewAccess ( int  pix,
int  i 
)
inlinestaticprotected

Definition at line 703 of file gco.hxx.

template<class GM >
void opengm::external::GCOLIB< GM >::generateEnergyTables ( )
inlineprotected

Definition at line 393 of file gco.hxx.

+ Here is the caller graph for this function:

template<class GM >
void opengm::external::GCOLIB< GM >::generateEnergyView ( )
inlineprotected

Definition at line 370 of file gco.hxx.

+ Here is the caller graph for this function:

template<class GM >
void opengm::external::GCOLIB< GM >::generateEnergyWeightedTable ( )
inlineprotected

Definition at line 400 of file gco.hxx.

+ Here is the caller graph for this function:

template<class GM >
void opengm::external::GCOLIB< GM >::generateFirstOrderFactorLookupTable ( )
inlineprotected

Definition at line 635 of file gco.hxx.

template<class GM >
void opengm::external::GCOLIB< GM >::generateSecondOrderFactorLookupTables ( )
inlineprotected

Definition at line 658 of file gco.hxx.

template<class GM >
const GCOLIB< GM >::GraphicalModelType & opengm::external::GCOLIB< GM >::graphicalModel ( ) const
inlinevirtual

Implements opengm::Inference< GM, opengm::Minimizer >.

Definition at line 235 of file gco.hxx.

template<class GM >
bool opengm::external::GCOLIB< GM >::hasSameLabelNumber ( ) const
inlineprotected

Definition at line 560 of file gco.hxx.

+ Here is the caller graph for this function:

template<class GM >
template<class VISITOR >
InferenceTermination opengm::external::GCOLIB< GM >::infer ( VISITOR &  visitor)
inline

Definition at line 247 of file gco.hxx.

template<class GM >
InferenceTermination opengm::external::GCOLIB< GM >::infer ( )
inlinevirtual

Implements opengm::Inference< GM, opengm::Minimizer >.

Definition at line 240 of file gco.hxx.

template<class GM >
std::string opengm::external::GCOLIB< GM >::name ( ) const
inlinevirtual

Implements opengm::Inference< GM, opengm::Minimizer >.

Definition at line 230 of file gco.hxx.

template<class GM >
bool opengm::external::GCOLIB< GM >::sameEnergyTable ( ) const
inlineprotected

Definition at line 570 of file gco.hxx.

template<class GM >
GCOLIB< GM >::EnergyTermType opengm::external::GCOLIB< GM >::secondOrderFactorTablesGridAccess ( int  pix1,
int  pix2,
int  i,
int  j 
)
inlinestaticprotected

Definition at line 843 of file gco.hxx.

template<class GM >
GCOLIB< GM >::EnergyTermType opengm::external::GCOLIB< GM >::secondOrderFactorViewGeneralAccess ( int  pix1,
int  pix2,
int  i,
int  j 
)
inlinestaticprotected

Definition at line 749 of file gco.hxx.

template<class GM >
GCOLIB< GM >::EnergyTermType opengm::external::GCOLIB< GM >::secondOrderFactorViewGridAccess ( int  pix1,
int  pix2,
int  i,
int  j 
)
inlinestaticprotected

Definition at line 714 of file gco.hxx.

template<class GM >
void opengm::external::GCOLIB< GM >::setD ( )
inlineprotected

Definition at line 465 of file gco.hxx.

template<class GM >
void opengm::external::GCOLIB< GM >::setV ( )
inlineprotected

Definition at line 485 of file gco.hxx.

template<class GM >
void opengm::external::GCOLIB< GM >::setWeightedTableWeights ( )
inlineprotected

Definition at line 503 of file gco.hxx.

template<class GM >
bool opengm::external::GCOLIB< GM >::symmetricEnergyTable ( ) const
inlineprotected

Definition at line 612 of file gco.hxx.

template<class GM >
GM::ValueType opengm::external::GCOLIB< GM >::value ( ) const
inlinevirtual

return the solution (value)

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

Definition at line 361 of file gco.hxx.

template<class GM >
bool opengm::external::GCOLIB< GM >::valueCheck ( ) const
inlineprotected

Definition at line 624 of file gco.hxx.

Member Data Documentation

template<class GM>
EnergyTermType* opengm::external::GCOLIB< GM >::D_
protected

Definition at line 90 of file gco.hxx.

template<class GM>
const IndexType opengm::external::GCOLIB< GM >::down_ = 1
staticprotected

Definition at line 123 of file gco.hxx.

template<class GM>
std::vector<std::vector<IndexType> > opengm::external::GCOLIB< GM >::firstOrderFactorLookupTable_
protected

Definition at line 104 of file gco.hxx.

template<class GM>
std::vector<EnergyTermType> opengm::external::GCOLIB< GM >::firstOrderFactorValues
protected

Definition at line 120 of file gco.hxx.

template<class GM>
gcoLib::GCoptimizationGeneralGraph* opengm::external::GCOLIB< GM >::GCOGeneralGraph_
protected

Definition at line 85 of file gco.hxx.

template<class GM>
gcoLib::GCoptimizationGridGraph* opengm::external::GCOLIB< GM >::GCOGridGraph_
protected

Definition at line 86 of file gco.hxx.

template<class GM>
std::map<std::pair<IndexType, IndexType>, std::vector<IndexType> > opengm::external::GCOLIB< GM >::generalSecondOrderFactorLookupTable_
protected

Definition at line 107 of file gco.hxx.

template<class GM>
const GraphicalModelType& opengm::external::GCOLIB< GM >::gm_
protected

Definition at line 77 of file gco.hxx.

template<class GM>
marray::Matrix<size_t> opengm::external::GCOLIB< GM >::grid_
protected

Definition at line 84 of file gco.hxx.

template<class GM>
EnergyTermType* opengm::external::GCOLIB< GM >::hCue_
protected

Definition at line 92 of file gco.hxx.

template<class GM>
std::vector<std::vector<IndexType> > opengm::external::GCOLIB< GM >::horizontalSecondOrderFactorLookupTable_
protected

Definition at line 105 of file gco.hxx.

template<class GM>
bool opengm::external::GCOLIB< GM >::isGrid_
protected

Definition at line 79 of file gco.hxx.

template<class GM>
GCOLIB< GM > * opengm::external::GCOLIB< GM >::mySelfTables_ = NULL
staticprotected

Definition at line 119 of file gco.hxx.

template<class GM>
GCOLIB< GM > * opengm::external::GCOLIB< GM >::mySelfView_ = NULL
staticprotected

Definition at line 103 of file gco.hxx.

template<class GM>
const LabelType opengm::external::GCOLIB< GM >::numLabels_
protected

Definition at line 83 of file gco.hxx.

template<class GM>
const IndexType opengm::external::GCOLIB< GM >::numNodes_
protected

Definition at line 82 of file gco.hxx.

template<class GM>
opengm::external::GCOLIB< GM >::OPENGM_GM_TYPE_TYPEDEFS

Definition at line 33 of file gco.hxx.

template<class GM>
Parameter opengm::external::GCOLIB< GM >::parameter_
protected

Definition at line 78 of file gco.hxx.

template<class GM>
const IndexType opengm::external::GCOLIB< GM >::right_ = 0
staticprotected

Definition at line 122 of file gco.hxx.

template<class GM>
std::vector<EnergyTermType> opengm::external::GCOLIB< GM >::secondOrderFactorGridValues
protected

Definition at line 121 of file gco.hxx.

template<class GM>
IndexType opengm::external::GCOLIB< GM >::sizeX_
protected

Definition at line 80 of file gco.hxx.

template<class GM>
IndexType opengm::external::GCOLIB< GM >::sizeY_
protected

Definition at line 81 of file gco.hxx.

template<class GM>
EnergyTermType* opengm::external::GCOLIB< GM >::V_
protected

Definition at line 91 of file gco.hxx.

template<class GM>
EnergyTermType* opengm::external::GCOLIB< GM >::vCue_
protected

Definition at line 93 of file gco.hxx.

template<class GM>
std::vector<std::vector<IndexType> > opengm::external::GCOLIB< GM >::verticalSecondOrderFactorLookupTable_
protected

Definition at line 106 of file gco.hxx.