OpenGM  2.3.x
Discrete Graphical Model Library
Public Types | Public Member Functions | List of all members
opengm::PottsFunction< T, I, L > Class Template Reference

Potts function for two variables. More...

#include <potts.hxx>

+ Inheritance diagram for opengm::PottsFunction< T, I, L >:
+ Collaboration diagram for opengm::PottsFunction< T, I, L >:

Public Types

typedef T ValueType
 
typedef L LabelType
 
typedef I IndexType
 
- Public Types inherited from opengm::FunctionBase< PottsFunction< T, I, L >, T, size_t, size_t >
typedef AccessorIterator< FunctionShapeAccessorType, true > FunctionShapeIteratorType
 

Public Member Functions

 PottsFunction (const LabelType=2, const LabelType=2, const ValueType=ValueType(), const ValueType=ValueType())
 constructor More...
 
LabelType shape (const size_t) const
 
size_t size () const
 
size_t dimension () const
 
template<class ITERATOR >
ValueType operator() (ITERATOR) const
 
bool operator== (const PottsFunction &) const
 
ValueType valueEqual () const
 
ValueType valueNotEqual () const
 
IndexType numberOfParameters () const
 
ValueType parameter (const size_t index) const
 
ValueTypeparameter (const size_t index)
 
bool isPotts () const
 
bool isGeneralizedPotts () const
 
ValueType min () const
 
ValueType max () const
 
ValueType sum () const
 
ValueType product () const
 
MinMaxFunctor< ValueTypeminMax () const
 
template<class ITERATOR >
operator() (ITERATOR begin) const
 
- Public Member Functions inherited from opengm::FunctionBase< PottsFunction< T, I, L >, T, size_t, size_t >
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 PottsFunction< T, I, L > &) const
 
FunctionShapeIteratorType functionShapeBegin () const
 
FunctionShapeIteratorType functionShapeEnd () const
 
size_t numberOfParameters () const
 
size_t parameterIndex (const size_t paramNumber) const
 

Detailed Description

template<class T, class I = size_t, class L = size_t>
class opengm::PottsFunction< T, I, L >

Potts function for two variables.

Examples:
gibbs.cxx, grid_potts.cxx, markov-chain.cxx, one_to_one_matching.cxx, and swendsenwang.cxx.

Definition at line 19 of file potts.hxx.

Member Typedef Documentation

template<class T, class I = size_t, class L = size_t>
typedef I opengm::PottsFunction< T, I, L >::IndexType

Definition at line 25 of file potts.hxx.

template<class T, class I = size_t, class L = size_t>
typedef L opengm::PottsFunction< T, I, L >::LabelType

Definition at line 24 of file potts.hxx.

template<class T, class I = size_t, class L = size_t>
typedef T opengm::PottsFunction< T, I, L >::ValueType

Definition at line 23 of file potts.hxx.

Constructor & Destructor Documentation

template<class T , class I , class L >
opengm::PottsFunction< T, I, L >::PottsFunction ( const LabelType  numberOfLabels1 = 2,
const LabelType  numberOfLabels2 = 2,
const ValueType  valueEqual = ValueType(),
const ValueType  valueNotEqual = ValueType() 
)
inline

constructor

Parameters
numberOfLabels1number of labels of the first variable
numberOfLabels2number of labels of the second variable
valueEqualvalue if the labels of the two variables are equal
valueNotEqualvalue if the labels of the two variables are not equal

Definition at line 90 of file potts.hxx.

Member Function Documentation

template<class T , class I , class L >
size_t opengm::PottsFunction< T, I, L >::dimension ( ) const
inline

Definition at line 136 of file potts.hxx.

template<class T , class I , class L >
bool opengm::PottsFunction< T, I, L >::isGeneralizedPotts ( ) const
inline

Definition at line 248 of file potts.hxx.

template<class T , class I , class L >
bool opengm::PottsFunction< T, I, L >::isPotts ( ) const
inline

Definition at line 241 of file potts.hxx.

template<class T , class I , class L >
PottsFunction< T, I, L >::ValueType opengm::PottsFunction< T, I, L >::max ( ) const
inline

Definition at line 262 of file potts.hxx.

template<class T , class I , class L >
PottsFunction< T, I, L >::ValueType opengm::PottsFunction< T, I, L >::min ( ) const
inline

Definition at line 255 of file potts.hxx.

template<class T , class I , class L >
MinMaxFunctor< typename PottsFunction< T, I, L >::ValueType > opengm::PottsFunction< T, I, L >::minMax ( ) const
inline

Definition at line 293 of file potts.hxx.

template<class T , class I , class L >
PottsFunction< T, I, L >::IndexType opengm::PottsFunction< T, I, L >::numberOfParameters ( ) const
inline

Definition at line 214 of file potts.hxx.

template<class T, class I = size_t, class L = size_t>
template<class ITERATOR >
ValueType opengm::PottsFunction< T, I, L >::operator() ( ITERATOR  ) const
template<class T, class I = size_t, class L = size_t>
template<class ITERATOR >
T opengm::PottsFunction< T, I, L >::operator() ( ITERATOR  begin) const
inline

Definition at line 106 of file potts.hxx.

template<class T , class I , class L >
bool opengm::PottsFunction< T, I, L >::operator== ( const PottsFunction< T, I, L > &  fb) const
inline

Definition at line 203 of file potts.hxx.

template<class T , class I , class L >
PottsFunction< T, I, L >::ValueType opengm::PottsFunction< T, I, L >::parameter ( const size_t  index) const
inline

Definition at line 221 of file potts.hxx.

template<class T , class I , class L >
PottsFunction< T, I, L >::ValueType & opengm::PottsFunction< T, I, L >::parameter ( const size_t  index)
inline

Definition at line 231 of file potts.hxx.

template<class T , class I , class L >
PottsFunction< T, I, L >::ValueType opengm::PottsFunction< T, I, L >::product ( ) const
inline

Definition at line 278 of file potts.hxx.

template<class T , class I , class L >
L opengm::PottsFunction< T, I, L >::shape ( const size_t  i) const
inline

Definition at line 127 of file potts.hxx.

template<class T , class I , class L >
size_t opengm::PottsFunction< T, I, L >::size ( ) const
inline

Definition at line 142 of file potts.hxx.

template<class T , class I , class L >
PottsFunction< T, I, L >::ValueType opengm::PottsFunction< T, I, L >::sum ( ) const
inline

Definition at line 269 of file potts.hxx.

template<class T , class I , class L >
T opengm::PottsFunction< T, I, L >::valueEqual ( ) const
inline

Definition at line 114 of file potts.hxx.

template<class T , class I , class L >
T opengm::PottsFunction< T, I, L >::valueNotEqual ( ) const
inline

Definition at line 120 of file potts.hxx.