#include <graphicalmodel.hxx>
Public Types | |
enum | FunctionInformation { NrOfFunctionTypes = meta::LengthOfTypeList<FunctionTypeList>::value } |
typedef GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE > | 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 >, EDITABLE >::type | FunctionTypeList |
typedef FunctionIdentification < IndexType, UInt8Type > | FunctionIdentifier |
typedef IndependentFactor < ValueType, IndexType, LabelType > | IndependentFactorType |
typedef Factor< GraphicalModel < T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE > > | FactorType |
typedef OPERATOR | OperatorType |
Public Member Functions | |
GraphicalModel () | |
GraphicalModel (const GraphicalModel &) | |
template<class FUNCTION_TYPE_LIST_OTHER , bool IS_EDITABLE> | |
GraphicalModel (const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST_OTHER, SPACE, IS_EDITABLE > &) | |
GraphicalModel (const SpaceType &, const size_t reserveFactorsPerVariable=0) | |
construct a graphical model based on a label space | |
GraphicalModel & | operator= (const GraphicalModel &) |
template<class FUNCTION_TYPE_LIST_OTHER , bool IS_EDITABLE> | |
GraphicalModel & | operator= (const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST_OTHER, SPACE, IS_EDITABLE > &) |
const SpaceType & | space () const |
return the label space underlying the graphical model | |
IndexType | numberOfVariables () const |
IndexType | numberOfVariables (const IndexType) const |
return the order (number of variables) of a specific factor | |
IndexType | numberOfLabels (const IndexType) const |
return the number of labels of an indicated variable | |
IndexType | numberOfFunctions (const size_t) const |
return the number of functions of a specific type | |
IndexType | numberOfFactors () const |
IndexType | numberOfFactors (const IndexType) const |
return the order (number of factors) connected to a specific variable | |
IndexType | variableOfFactor (const IndexType, const IndexType) const |
return the k-th variable of the j-th factor | |
IndexType | factorOfVariable (const IndexType, const IndexType) const |
return the k-th factor connected to the j-th variable | |
const FactorType & | operator[] (const IndexType) const |
access a factor of the graphical model | |
template<class ITERATOR > | |
ValueType | evaluate (ITERATOR) const |
evaluate the modeled function for a given labeling | |
size_t | factorOrder () const |
return the maximum of the orders of all factors | |
void | assign (const SpaceType &) |
clear the graphical model and construct a new one based on a label space | |
IndexType | addVariable (const IndexType) |
add a new variable to the graphical model and underlying label space | |
template<class FUNCTION_TYPE > | |
FunctionIdentifier | addFunction (const FUNCTION_TYPE &) |
add a function to the graphical model | |
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) | |
template<class FUNCTION_TYPE > | |
FUNCTION_TYPE & | getFunction (const FunctionIdentifier &) |
access functions | |
template<class ITERATOR > | |
IndexType | addFactor (const FunctionIdentifier &, ITERATOR, ITERATOR) |
add a factor to the graphical model | |
template<class FUNCTION_TYPE > | |
void | reserveFunctions (const size_t numF) |
void | reserveFactors (const size_t numF) |
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 () |
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 &) |
grid_potts.cxx, inference_types.cxx, interpixel_boundary_segmentation.cxx, io_graphical_model.cxx, markov-chain.cxx, one_to_one_matching.cxx, opengmBuildGrid.cxx, quick_start.cxx, and space_types.cxx.
Definition at line 66 of file graphicalmodel.hxx.
typedef Factor<GraphicalModel<T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE> > opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FactorType |
Definition at line 92 of file graphicalmodel.hxx.
typedef FunctionIdentification<IndexType, UInt8Type> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FunctionIdentifier |
Definition at line 90 of file graphicalmodel.hxx.
typedef meta::GenerateFunctionTypeList< FUNCTION_TYPE_LIST, ExplicitFunction<T,IndexType,LabelType>, EDITABLE >::type opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FunctionTypeList |
Definition at line 84 of file graphicalmodel.hxx.
typedef GraphicalModel<T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::GraphicalModelType |
Definition at line 74 of file graphicalmodel.hxx.
typedef IndependentFactor<ValueType, IndexType, LabelType> opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndependentFactorType |
Definition at line 91 of file graphicalmodel.hxx.
typedef SpaceType::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType |
Reimplemented from opengm::FactorGraph< GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >, SPACE::IndexType >.
Definition at line 76 of file graphicalmodel.hxx.
typedef SpaceType::LabelType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::LabelType |
Definition at line 77 of file graphicalmodel.hxx.
typedef OPERATOR opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::OperatorType |
Definition at line 93 of file graphicalmodel.hxx.
typedef SPACE opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::SpaceType |
Definition at line 75 of file graphicalmodel.hxx.
typedef T opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::ValueType |
Definition at line 78 of file graphicalmodel.hxx.
enum opengm::GraphicalModel::FunctionInformation |
Definition at line 86 of file graphicalmodel.hxx.
opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::GraphicalModel | ( | ) |
opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::GraphicalModel | ( | const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE > & | gm | ) | [inline] |
Definition at line 373 of file graphicalmodel.hxx.
opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::GraphicalModel | ( | const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST_OTHER, SPACE, IS_EDITABLE > & | gm | ) | [inline] |
Definition at line 395 of file graphicalmodel.hxx.
opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::GraphicalModel | ( | const SpaceType & | space, | |
const size_t | reserveFactorsPerVariable = 0 | |||
) | [inline] |
construct a graphical model based on a label space
Definition at line 457 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::addFactor | ( | const FunctionIdentifier & | functionIdentifier, | |
ITERATOR | begin, | |||
ITERATOR | end | |||
) | [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 757 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FunctionIdentifier opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::addFunction | ( | const FUNCTION_TYPE & | function | ) | [inline] |
add a function to the graphical model
function | a copy of function is stored in the model |
Definition at line 624 of file graphicalmodel.hxx.
std::pair< typename GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FunctionIdentifier, FUNCTION_TYPE & > opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::addFunctionWithRefReturn | ( | const FUNCTION_TYPE & | function | ) | [inline] |
Definition at line 652 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FunctionIdentifier opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::addSharedFunction | ( | const FUNCTION_TYPE & | function | ) | [inline] |
add a function to the graphical model avoiding duplicates (requires search)
Definition at line 683 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::addVariable | ( | const IndexType | nLabels | ) | [inline] |
add a new variable to the graphical model and underlying label space
Definition at line 482 of file graphicalmodel.hxx.
void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::assign | ( | const SpaceType & | space | ) | [inline] |
clear the graphical model and construct a new one based on a label space
Definition at line 495 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::ValueType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::evaluate | ( | ITERATOR | labelIndices | ) | const [inline] |
evaluate the modeled function for a given labeling
labelIndices | iterator to the beginning of a sequence of label indices |
Definition at line 555 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::factorOfVariable | ( | const IndexType | variableIndex, | |
const IndexType | factorNumber | |||
) | const [inline] |
return the k-th factor connected to the j-th variable
Definition at line 350 of file graphicalmodel.hxx.
size_t opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::factorOrder | ( | ) | const [inline] |
return the maximum of the orders of all factors
Definition at line 605 of file graphicalmodel.hxx.
std::vector< typename meta::TypeAtTypeList< typename GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FunctionTypeList, FUNCTION_INDEX >::type > & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::functions | ( | ) | [inline, protected] |
Definition at line 889 of file graphicalmodel.hxx.
const std::vector< typename meta::TypeAtTypeList< typename GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FunctionTypeList, FUNCTION_INDEX >::type > & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::functions | ( | ) | const [inline, protected] |
Definition at line 875 of file graphicalmodel.hxx.
FUNCTION_TYPE & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::getFunction | ( | const FunctionIdentifier & | fid | ) | [inline] |
access functions
For example:
opengm::ExplicitFunction<double> f = gm.getFunction<opengm::ExplicitFunction<double> >(fid);
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);
functionIdentifier | identifier of the underlying function, cf. addFunction |
Definition at line 733 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::numberOfFactors | ( | const IndexType | variableIndex | ) | const [inline] |
return the order (number of factors) connected to a specific variable
Definition at line 298 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::numberOfFactors | ( | ) | const [inline] |
Reimplemented from opengm::FactorGraph< GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >, SPACE::IndexType >.
Definition at line 536 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::numberOfFunctions | ( | const size_t | functionTypeIndex | ) | const [inline] |
return the number of functions of a specific type
Definition at line 322 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::numberOfLabels | ( | const IndexType | index | ) | const [inline] |
return the number of labels of an indicated variable
Definition at line 514 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::numberOfVariables | ( | const IndexType | factorIndex | ) | const [inline] |
return the order (number of variables) of a specific factor
Definition at line 310 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::numberOfVariables | ( | ) | const [inline] |
Reimplemented from opengm::FactorGraph< GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >, SPACE::IndexType >.
Definition at line 505 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE > & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::operator= | ( | const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST_OTHER, SPACE, IS_EDITABLE > & | gm | ) | [inline] |
Definition at line 810 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE > & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::operator= | ( | const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE > & | gm | ) | [inline] |
Definition at line 786 of file graphicalmodel.hxx.
const GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::FactorType & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::operator[] | ( | const IndexType | index | ) | const [inline] |
access a factor of the graphical model
Definition at line 526 of file graphicalmodel.hxx.
void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::reserveFactors | ( | const size_t | numF | ) | [inline] |
Definition at line 154 of file graphicalmodel.hxx.
void opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::reserveFunctions | ( | const size_t | numF | ) | [inline] |
Definition at line 144 of file graphicalmodel.hxx.
const SPACE & opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::space | ( | ) | const [inline] |
return the label space underlying the graphical model
Definition at line 544 of file graphicalmodel.hxx.
GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::IndexType opengm::GraphicalModel< T, OPERATOR, FUNCTION_TYPE_LIST, SPACE, EDITABLE >::variableOfFactor | ( | const IndexType | factorIndex, | |
const IndexType | variableNumber | |||
) | const [inline] |
return the k-th variable of the j-th factor
Definition at line 335 of file graphicalmodel.hxx.
void opengm::hdf5::load | ( | GM & | , | |
const std::string & | , | |||
const std::string & | ||||
) | [friend] |
void opengm::hdf5::save | ( | const GM & | , | |
const std::string & | , | |||
const std::string & | ||||
) | [friend] |