OpenGM  2.3.x
Discrete Graphical Model Library
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE > Class Template Reference

GraphicalModel. More...

#include <graphicalmodel.hxx>

+ Inheritance diagram for opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >:
+ Collaboration diagram for opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >:

Public Types

enum  FunctionInformation { NrOfFunctionTypes = meta::LengthOfTypeList<FunctionTypeList>::value }
 
typedef GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE > GraphicalModelType
 
typedef SPACE SpaceType
 
typedef SpaceType::IndexType IndexType
 
typedef SpaceType::LabelType LabelType
 
typedef T ValueType
 
typedef meta::GenerateFunctionTypeList< FUNCTION_TYPE_LIST, ExplicitFunction< T, IndexType, LabelType >, false >::type FunctionTypeList
 
typedef FunctionIdentification< IndexType, UInt8TypeFunctionIdentifier
 
typedef IndependentFactor< ValueType, IndexType, LabelTypeIndependentFactorType
 
typedef Factor< GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE > > FactorType
 
typedef OPERATOR OperatorType
 
- Public Types inherited from opengm::FactorGraph< GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >, SPACE::IndexType >
typedef GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE > SpecialType
 
typedef AccessorIterator< VariableAccessor, true > ConstVariableIterator
 
typedef AccessorIterator< FactorAccessor, true > ConstFactorIterator
 

Public Member Functions

 GraphicalModel ()
 
 GraphicalModel (const GraphicalModel &)
 
 GraphicalModel (const SpaceType &, const size_t reserveFactorsPerVariable=0)
 construct a graphical model based on a label space More...
 
GraphicalModeloperator= (const GraphicalModel &)
 
const SpaceTypespace () const
 return the label space underlying the graphical model More...
 
IndexType numberOfVariables () const
 
IndexType numberOfVariables (const IndexType) const
 return the order (number of variables) of a specific factor More...
 
IndexType numberOfLabels (const IndexType) const
 return the number of labels of an indicated variable More...
 
IndexType numberOfFunctions (const size_t) const
 return the number of functions of a specific type More...
 
IndexType numberOfFactors () const
 
IndexType numberOfFactors (const IndexType) const
 return the order (number of factors) connected to a specific variable More...
 
IndexType variableOfFactor (const IndexType, const IndexType) const
 return the k-th variable of the j-th factor More...
 
IndexType factorOfVariable (const IndexType, const IndexType) const
 return the k-th factor connected to the j-th variable More...
 
const FactorTypeoperator[] (const IndexType) const
 access a factor of the graphical model More...
 
template<class ITERATOR >
ValueType evaluate (ITERATOR) const
 evaluate the modeled function for a given labeling More...
 
size_t factorOrder () const
 return the maximum of the orders of all factors More...
 
void assign (const SpaceType &)
 clear the graphical model and construct a new one based on a label space More...
 
IndexType addVariable (const IndexType)
 add a new variable to the graphical model and underlying label space More...
 
template<class FUNCTION_TYPE >
FunctionIdentifier addFunction (const FUNCTION_TYPE &)
 add a function to the graphical model More...
 
template<class FUNCTION_TYPE >
std::pair< FunctionIdentifier, FUNCTION_TYPE & > addFunctionWithRefReturn (const FUNCTION_TYPE &)
 
template<class FUNCTION_TYPE >
FunctionIdentifier addSharedFunction (const FUNCTION_TYPE &)
 add a function to the graphical model avoiding duplicates (requires search) More...
 
template<class FUNCTION_TYPE >
FUNCTION_TYPE & getFunction (const FunctionIdentifier &)
 access functions More...
 
template<class ITERATOR >
IndexType addFactor (const FunctionIdentifier &, ITERATOR, ITERATOR)
 add a factor to the graphical model More...
 
template<class ITERATOR >
IndexType addFactorNonFinalized (const FunctionIdentifier &, ITERATOR, ITERATOR)
 add a factor to the graphical model More...
 
void finalize ()
 
template<class FUNCTION_TYPE >
void reserveFunctions (const size_t numF)
 
void reserveFactors (const size_t numF)
 
void reserveFactorsVarialbeIndices (const size_t size)
 
LabelType maxNumberOfLabels () const
 
template<class FUNCTION_TYPE >
std::pair< typename GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FunctionIdentifier, FUNCTION_TYPE & > addFunctionWithRefReturn (const FUNCTION_TYPE &function)
 
template<size_t FUNCTION_INDEX>
const std::vector< typename meta::TypeAtTypeList< typename GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FunctionTypeList, FUNCTION_INDEX >::type > & functions () const
 
template<size_t FUNCTION_INDEX>
std::vector< typename meta::TypeAtTypeList< typename GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FunctionTypeList, FUNCTION_INDEX >::type > & functions ()
 
- Public Member Functions inherited from opengm::FactorGraph< GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >, SPACE::IndexType >
size_t numberOfVariables () const
 total number of variable nodes in the factor graph More...
 
size_t numberOfVariables (const size_t) const
 number of variable nodes connected to a factor node More...
 
size_t numberOfFactors () const
 total number of factor nodes in the factor graph More...
 
size_t numberOfFactors (const size_t) const
 number of factor nodes connected to a variable node More...
 
size_t variableOfFactor (const size_t, const size_t) const
 j-th variable node connected to a factor node More...
 
size_t factorOfVariable (const size_t, const size_t) const
 j-th factor node connected to a variable node More...
 
ConstVariableIterator variablesOfFactorBegin (const size_t) const
 constant iterator to the beginning of the squence of variables connected to a factor More...
 
ConstVariableIterator variablesOfFactorEnd (const size_t) const
 constant iterator to the end of the squence of variables connected to a factor More...
 
ConstFactorIterator factorsOfVariableBegin (const size_t) const
 constant iterator to the beginning of the squence of factors connected to a variable More...
 
ConstFactorIterator factorsOfVariableEnd (const size_t) const
 constant iterator to the end of the squence of factors connected to a variable More...
 
bool variableFactorConnection (const size_t, const size_t) const
 return true if a factor is connected to a variable More...
 
bool factorVariableConnection (const size_t, const size_t) const
 return true if a variable is connected to a factor More...
 
bool variableVariableConnection (const size_t, const size_t) const
 return true if a variable is connected to a variable More...
 
bool factorFactorConnection (const size_t, const size_t) const
 return true if a factor is connected to a factor More...
 
bool isAcyclic () const
 return true if the factor graph (!) is acyclic More...
 
bool isConnected (marray::Vector< size_t > &representatives) const
 return true if the factor graph (!) is connected More...
 
bool isChain (marray::Vector< size_t > &) const
 return true if the factor graph (!) is a chain More...
 
bool isGrid (marray::Matrix< size_t > &) const
 return true if the factor graph (!) is a grid More...
 
size_t maxFactorOrder () const
 return maximum factor order More...
 
bool maxFactorOrder (const size_t maxOrder) const
 return true if the maximum factor order is less or equal to maxOrder More...
 
size_t numberOfNthOrderFactorsOfVariable (const size_t, const size_t) const
 return number of factors with order n which are connected to variable More...
 
size_t numberOfNthOrderFactorsOfVariable (const size_t, const size_t, marray::Vector< size_t > &) const
 return number of factors with order n which are connected to variable and stores the corresponding factorIDs More...
 
size_t secondVariableOfSecondOrderFactor (const size_t, const size_t) const
 return returns the id of the second variable which is connected to a given variable via a second order factor More...
 
void variableAdjacencyMatrix (marray::Matrix< bool > &) const
 outputs the factor graph as a variable adjacency matrix More...
 
void variableAdjacencyList (std::vector< std::set< IndexType > > &) const
 outputs the factor graph as variable adjacency lists More...
 
void variableAdjacencyList (std::vector< RandomAccessSet< IndexType > > &) const
 outputs the factor graph as variable adjacency lists More...
 
void factorAdjacencyList (std::vector< std::set< IndexType > > &) const
 
void factorAdjacencyList (std::vector< RandomAccessSet< IndexType > > &) const
 

Protected Member Functions

template<size_t FUNCTION_INDEX>
const std::vector< typename meta::TypeAtTypeList< FunctionTypeList, FUNCTION_INDEX >::type > & functions () const
 
template<size_t FUNCTION_INDEX>
std::vector< typename meta::TypeAtTypeList< FunctionTypeList, FUNCTION_INDEX >::type > & functions ()
 
- Protected Member Functions inherited from opengm::FactorGraph< GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >, SPACE::IndexType >
 operator GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE > & ()
 
 operator GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >const & () const
 
bool shortestPath (const size_t, const size_t, LIST &, const LIST &=LIST()) const
 computes the shortest path from s to t using Dijkstra's algorithm with uniform distances More...
 
bool twoHopConnected (const size_t, const size_t, LIST &) const
 checks if variabel1 is connected to variable2 via two hops More...
 

Friends

template<typename GM >
void opengm::hdf5::save (const GM &, const std::string &, const std::string &)
 
template<typename GM >
void opengm::hdf5::load (GM &, const std::string &, const std::string &)
 

Detailed Description

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
class opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >

GraphicalModel.

Implements the graphical model interface see also for factorgraph_view

Examples:
gibbs.cxx, grid_potts.cxx, inference_types.cxx, interpixel_boundary_segmentation.cxx, io_graphical_model.cxx, markov-chain.cxx, one_to_one_matching.cxx, opengmBuild.cxx, quick_start.cxx, space_types.cxx, and swendsenwang.cxx.

Definition at line 63 of file graphicalmodel.hxx.

Member Typedef Documentation

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef Factor<GraphicalModel<T, OPERATOR, FUNCTION_TYPE_LIST, SPACE> > opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FactorType

Definition at line 87 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef FunctionIdentification<IndexType, UInt8Type> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FunctionIdentifier

Definition at line 85 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef meta::GenerateFunctionTypeList< FUNCTION_TYPE_LIST, ExplicitFunction<T,IndexType,LabelType>,false >::type opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FunctionTypeList

Definition at line 79 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef GraphicalModel<T, OPERATOR, FUNCTION_TYPE_LIST, SPACE> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::GraphicalModelType

Definition at line 70 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef IndependentFactor<ValueType, IndexType, LabelType> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndependentFactorType

Definition at line 86 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef SpaceType::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType

Definition at line 72 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef SpaceType::LabelType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::LabelType

Definition at line 73 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef OPERATOR opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::OperatorType

Definition at line 88 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef SPACE opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::SpaceType

Definition at line 71 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
typedef T opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::ValueType

Definition at line 74 of file graphicalmodel.hxx.

Constructor & Destructor Documentation

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::GraphicalModel ( )
inline

Definition at line 305 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::GraphicalModel ( const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE > &  gm)
inline

Definition at line 318 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::GraphicalModel ( const SpaceType space,
const size_t  reserveFactorsPerVariable = 0 
)
inline

construct a graphical model based on a label space

Definition at line 347 of file graphicalmodel.hxx.

+ Here is the call graph for this function:

Member Function Documentation

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
template<class ITERATOR >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::addFactor ( const FunctionIdentifier functionIdentifier,
ITERATOR  begin,
ITERATOR  end 
)
inline

add a factor to the graphical model

Parameters
functionIdentifieridentifier of the underlying function, cf. addFunction
beginiterator to the beginning of a sequence of variable indices
enditerator to the end of a sequence of variable indices
See also
addFunction

Definition at line 656 of file graphicalmodel.hxx.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
template<class ITERATOR >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::addFactorNonFinalized ( const FunctionIdentifier functionIdentifier,
ITERATOR  begin,
ITERATOR  end 
)
inline

add a factor to the graphical model

Parameters
functionIdentifieridentifier of the underlying function, cf. addFunction
beginiterator to the beginning of a sequence of variable indices
enditerator to the end of a sequence of variable indices
See also
addFunction

IF FACTORS ARE ADDED WITH THIS FUNCTION , gm.finalize() needs to be called

Definition at line 707 of file graphicalmodel.hxx.

+ Here is the call graph for this function:

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
template<class FUNCTION_TYPE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FunctionIdentifier opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::addFunction ( const FUNCTION_TYPE &  function)
inline

add a function to the graphical model

Parameters
functiona copy of function is stored in the model
Returns
the identifier of the new function that can be used e.g. with the function addFactor
See also
addFactor
getFunction

Definition at line 523 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<class FUNCTION_TYPE >
std::pair<FunctionIdentifier,FUNCTION_TYPE &> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::addFunctionWithRefReturn ( const FUNCTION_TYPE &  )
template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<class FUNCTION_TYPE >
std::pair<typename GraphicalModel<T, OPERATOR, FUNCTION_TYPE_LIST, SPACE>::FunctionIdentifier,FUNCTION_TYPE &> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::addFunctionWithRefReturn ( const FUNCTION_TYPE &  function)
inline

Definition at line 551 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
template<class FUNCTION_TYPE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FunctionIdentifier opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::addSharedFunction ( const FUNCTION_TYPE &  function)
inline

add a function to the graphical model avoiding duplicates (requires search)

Returns
the identifier of the function that can be used e.g. with the function addFactor
See also
addFactor

Definition at line 582 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::addVariable ( const IndexType  nLabels)
inline

add a new variable to the graphical model and underlying label space

Returns
index of the newly added variable

Definition at line 372 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::assign ( const SpaceType space)
inline

clear the graphical model and construct a new one based on a label space

Definition at line 385 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
template<class ITERATOR >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::ValueType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::evaluate ( ITERATOR  labels) const
inline

evaluate the modeled function for a given labeling

Parameters
labelsiterator to the beginning of a sequence of label indices

Definition at line 445 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::factorOfVariable ( const IndexType  variableIndex,
const IndexType  factorNumber 
) const
inline

return the k-th factor connected to the j-th variable

See also
FactorGraph

Definition at line 294 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
size_t opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::factorOrder ( ) const
inline

return the maximum of the orders of all factors

Definition at line 498 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::finalize ( )

Definition at line 749 of file graphicalmodel.hxx.

+ Here is the call graph for this function:

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<size_t FUNCTION_INDEX>
const std::vector<typename meta::TypeAtTypeList<FunctionTypeList, FUNCTION_INDEX>::type>& opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::functions ( ) const
protected
template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<size_t FUNCTION_INDEX>
std::vector<typename meta::TypeAtTypeList<FunctionTypeList, FUNCTION_INDEX>::type>& opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::functions ( )
protected
template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<size_t FUNCTION_INDEX>
const std::vector< typename meta::TypeAtTypeList< typename GraphicalModel<T, OPERATOR, FUNCTION_TYPE_LIST, SPACE>::FunctionTypeList, FUNCTION_INDEX >::type >& opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::functions ( ) const

Definition at line 802 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<size_t FUNCTION_INDEX>
std::vector< typename meta::TypeAtTypeList< typename GraphicalModel<T, OPERATOR, FUNCTION_TYPE_LIST, SPACE>::FunctionTypeList, FUNCTION_INDEX >::type >& opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::functions ( )

Definition at line 816 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
template<class FUNCTION_TYPE >
FUNCTION_TYPE & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::getFunction ( const FunctionIdentifier fid)

access functions

For example:

If your function and graphical model type both depend on one or more common template parameters, you may have to add the .template keyword for some compilers:

opengm::ExplicitFunction<double> f = gm.template getFunction< FunctionType >(fid);
Parameters
functionIdentifieridentifier of the underlying function, cf. addFunction
See also
addFunction

Definition at line 632 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
LabelType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::maxNumberOfLabels ( ) const
inline

Definition at line 153 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::numberOfFactors ( ) const
inline

Definition at line 426 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::numberOfFactors ( const IndexType  variableIndex) const
inline

return the order (number of factors) connected to a specific variable

See also
FactorGraph

Definition at line 242 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::numberOfFunctions ( const size_t  functionTypeIndex) const
inline

return the number of functions of a specific type

Definition at line 266 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::numberOfLabels ( const IndexType  index) const
inline

return the number of labels of an indicated variable

Definition at line 404 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::numberOfVariables ( ) const
inline

Definition at line 395 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::numberOfVariables ( const IndexType  factorIndex) const
inline

return the order (number of variables) of a specific factor

See also
FactorGraph

Definition at line 254 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE > & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::operator= ( const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE > &  gm)
inline

Definition at line 771 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FactorType & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::operator[] ( const IndexType  index) const
inline

access a factor of the graphical model

Definition at line 416 of file graphicalmodel.hxx.

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::reserveFactors ( const size_t  numF)
inline

Definition at line 144 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::reserveFactorsVarialbeIndices ( const size_t  size)
inline

Definition at line 148 of file graphicalmodel.hxx.

+ Here is the caller graph for this function:

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<class FUNCTION_TYPE >
void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::reserveFunctions ( const size_t  numF)
inline

Definition at line 134 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
const SPACE & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::space ( ) const
inline

return the label space underlying the graphical model

Definition at line 434 of file graphicalmodel.hxx.

template<class T , class OPERATOR , class FUNCTION_TYPE_LIST , class SPACE >
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::variableOfFactor ( const IndexType  factorIndex,
const IndexType  variableNumber 
) const
inline

return the k-th variable of the j-th factor

See also
FactorGraph

Definition at line 279 of file graphicalmodel.hxx.

Friends And Related Function Documentation

template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<typename GM >
void opengm::hdf5::load ( GM &  ,
const std::string &  ,
const std::string &   
)
friend
template<class T, class OPERATOR, class FUNCTION_TYPE_LIST = meta::TypeList<ExplicitFunction<T>, meta::ListEnd>, class SPACE = opengm::DiscreteSpace<size_t, size_t>>
template<typename GM >
void opengm::hdf5::save ( const GM &  ,
const std::string &  ,
const std::string &   
)
friend