|
OpenGM
2.3.x
Discrete Graphical Model Library
|
Generalized Potts Function. More...
#include <pottsg.hxx>
Inheritance diagram for opengm::PottsGFunction< T, I, L >:
Collaboration diagram for opengm::PottsGFunction< T, I, L >:Public Types | |
| typedef T | ValueType |
| typedef I | IndexType |
| typedef L | LabelType |
Public Types inherited from opengm::FunctionBase< PottsGFunction< T, I, L >, T, I, L > | |
| typedef AccessorIterator< FunctionShapeAccessorType, true > | FunctionShapeIteratorType |
Public Member Functions | |
| PottsGFunction () | |
| template<class ITERATOR > | |
| PottsGFunction (ITERATOR, ITERATOR) | |
| template<class ITERATOR , class ITERATOR2 > | |
| PottsGFunction (ITERATOR, ITERATOR, ITERATOR2) | |
| LabelType | shape (const size_t) const |
| size_t | size () const |
| size_t | dimension () const |
| template<class ITERATOR > | |
| ValueType | operator() (ITERATOR) const |
| bool | isPotts () const |
| bool | isGeneralizedPotts () const |
| template<class LABELITERATOR > | |
| void | setByLabel (LABELITERATOR, T) |
| void | setByPartition (size_t, T) |
| template<class ITERATOR > | |
| T | operator() (ITERATOR begin) const |
Public Member Functions inherited from opengm::FunctionBase< PottsGFunction< T, I, L >, T, I, L > | |
| bool | isPotts () const |
| bool | isGeneralizedPotts () const |
| bool | isSubmodular () const |
| bool | isSquaredDifference () const |
| bool | isTruncatedSquaredDifference () const |
| bool | isAbsoluteDifference () const |
| bool | isTruncatedAbsoluteDifference () const |
| bool | isLinearConstraint () const |
| MinMaxFunctor< T > | minMax () const |
| find minimum and maximum of the function in a single sweep More... | |
| ReturnType | min () const |
| ReturnType | max () const |
| ReturnType | sum () const |
| ReturnType | product () const |
| ReturnType | accumulate () const |
| accumulate all values of the function More... | |
| void | forAllValuesInOrder (FUNCTOR &functor) const |
| call a functor for each value of the function (in lexicographical order of the variable indices) More... | |
| void | forAllValuesInSwitchedOrder (FUNCTOR &functor) const |
| void | forAllValuesInAnyOrder (FUNCTOR &functor) const |
| call a functor for each value of the function (in un-specified order) More... | |
| void | forAtLeastAllUniqueValues (FUNCTOR &functor) const |
| call a functor for at least all unique values of the function More... | |
| void | forAllValuesInOrderWithCoordinate (COORDINATE_FUNCTOR &functor) const |
| void | forAllValuesInAnyOrderWithCoordinate (COORDINATE_FUNCTOR &functor) const |
| void | forAtLeastAllUniqueValuesWithCoordinate (COORDINATE_FUNCTOR &functor) const |
| bool | operator== (const PottsGFunction< T, I, L > &) const |
| FunctionShapeIteratorType | functionShapeBegin () const |
| FunctionShapeIteratorType | functionShapeEnd () const |
| size_t | numberOfParameters () const |
| I | parameterIndex (const size_t paramNumber) const |
Static Public Attributes | |
| static const size_t | BellNumbers_ [16] = {1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, 678570, 4213597, 27644437, 190899322, 1382958545} |
| static const size_t | MaximalOrder_ = 11 |
Generalized Potts Function.
A generalized Potts function is a function that is invariant under all permutations of labels, e.g. f(1, 1, 3, 4) = f(3, 3, 4, 1).
Its purpose is to assign different values to different partitions of the set of input variables, regardless of which labels are used to describe this partition.
It generalizes the Potts function that distinguishes only between equal and unequal labels.
The memory required to store a generalized Potts function depends only on the order of the function, not on the number of labels. Due to the trasitivity of the equality relation, the number of all partitions of a set of D elements is smaller than 2^(D*(D+1)/2). The exact number is given by the Bell numbers B_D, e.g. B_1=1, B_2=2, B_3=5, B_4=15, B_5=52, B_6=203
Definition at line 36 of file pottsg.hxx.
| typedef I opengm::PottsGFunction< T, I, L >::IndexType |
Definition at line 41 of file pottsg.hxx.
| typedef L opengm::PottsGFunction< T, I, L >::LabelType |
Definition at line 42 of file pottsg.hxx.
| typedef T opengm::PottsGFunction< T, I, L >::ValueType |
Definition at line 40 of file pottsg.hxx.
|
inline |
Definition at line 146 of file pottsg.hxx.
|
inline |
Definition at line 99 of file pottsg.hxx.
|
inline |
Definition at line 121 of file pottsg.hxx.
|
inline |
Definition at line 273 of file pottsg.hxx.
|
inline |
Definition at line 296 of file pottsg.hxx.
|
inline |
Definition at line 286 of file pottsg.hxx.
| ValueType opengm::PottsGFunction< T, I, L >::operator() | ( | ITERATOR | ) | const |
|
inline |
Definition at line 154 of file pottsg.hxx.
| void opengm::PottsGFunction< T, I, L >::setByLabel | ( | LABELITERATOR | it, |
| T | value | ||
| ) |
Definition at line 209 of file pottsg.hxx.
| void opengm::PottsGFunction< T, I, L >::setByPartition | ( | size_t | partition, |
| T | value | ||
| ) |
Definition at line 229 of file pottsg.hxx.
|
inline |
Definition at line 263 of file pottsg.hxx.
|
inline |
Definition at line 280 of file pottsg.hxx.
|
static |
Definition at line 56 of file pottsg.hxx.
|
static |
Definition at line 57 of file pottsg.hxx.
1.8.9.1