|
OpenGM
2.3.x
Discrete Graphical Model Library
|
#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, UInt8Type > | FunctionIdentifier |
| typedef IndependentFactor< ValueType, IndexType, LabelType > | IndependentFactorType |
| 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... | |
| GraphicalModel & | operator= (const GraphicalModel &) |
| const SpaceType & | space () 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 FactorType & | operator[] (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 &) |
Implements the graphical model interface see also for factorgraph_view
Definition at line 63 of file graphicalmodel.hxx.
| 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.
| typedef FunctionIdentification<IndexType, UInt8Type> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::FunctionIdentifier |
Definition at line 85 of file graphicalmodel.hxx.
| 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.
| 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.
| typedef IndependentFactor<ValueType, IndexType, LabelType> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndependentFactorType |
Definition at line 86 of file graphicalmodel.hxx.
| typedef SpaceType::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::IndexType |
Definition at line 72 of file graphicalmodel.hxx.
| typedef SpaceType::LabelType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::LabelType |
Definition at line 73 of file graphicalmodel.hxx.
| typedef OPERATOR opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::OperatorType |
Definition at line 88 of file graphicalmodel.hxx.
| typedef SPACE opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::SpaceType |
Definition at line 71 of file graphicalmodel.hxx.
| typedef T opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::ValueType |
Definition at line 74 of file graphicalmodel.hxx.
|
inline |
Definition at line 305 of file graphicalmodel.hxx.
|
inline |
Definition at line 318 of file graphicalmodel.hxx.
|
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:
|
inline |
add a factor to the graphical model
| functionIdentifier | identifier of the underlying function, cf. addFunction |
| begin | iterator to the beginning of a sequence of variable indices |
| end | iterator to the end of a sequence of variable indices |
Definition at line 656 of file graphicalmodel.hxx.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
add a factor to the graphical model
| functionIdentifier | identifier of the underlying function, cf. addFunction |
| begin | iterator to the beginning of a sequence of variable indices |
| end | iterator to the end of a sequence of variable indices |
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:
|
inline |
add a function to the graphical model
| function | a copy of function is stored in the model |
Definition at line 523 of file graphicalmodel.hxx.
Here is the caller graph for this function:| std::pair<FunctionIdentifier,FUNCTION_TYPE &> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::addFunctionWithRefReturn | ( | const FUNCTION_TYPE & | ) |
|
inline |
Definition at line 551 of file graphicalmodel.hxx.
|
inline |
add a function to the graphical model avoiding duplicates (requires search)
Definition at line 582 of file graphicalmodel.hxx.
|
inline |
add a new variable to the graphical model and underlying label space
Definition at line 372 of file graphicalmodel.hxx.
|
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:
|
inline |
evaluate the modeled function for a given labeling
| labels | iterator 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:
|
inline |
return the k-th factor connected to the j-th variable
Definition at line 294 of file graphicalmodel.hxx.
Here is the caller graph for this function:
|
inline |
return the maximum of the orders of all factors
Definition at line 498 of file graphicalmodel.hxx.
| void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE >::finalize | ( | ) |
|
protected |
|
protected |
| 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.
| 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.
| 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:
| functionIdentifier | identifier of the underlying function, cf. addFunction |
Definition at line 632 of file graphicalmodel.hxx.
|
inline |
Definition at line 153 of file graphicalmodel.hxx.
|
inline |
|
inline |
return the order (number of factors) connected to a specific variable
Definition at line 242 of file graphicalmodel.hxx.
|
inline |
return the number of functions of a specific type
Definition at line 266 of file graphicalmodel.hxx.
|
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:
|
inline |
|
inline |
return the order (number of variables) of a specific factor
Definition at line 254 of file graphicalmodel.hxx.
|
inline |
Definition at line 771 of file graphicalmodel.hxx.
|
inline |
access a factor of the graphical model
Definition at line 416 of file graphicalmodel.hxx.
|
inline |
|
inline |
|
inline |
Definition at line 134 of file graphicalmodel.hxx.
|
inline |
return the label space underlying the graphical model
Definition at line 434 of file graphicalmodel.hxx.
|
inline |
return the k-th variable of the j-th factor
Definition at line 279 of file graphicalmodel.hxx.
|
friend |
|
friend |
1.8.9.1