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

squared difference of the labels of two variables More...

#include <squared_difference.hxx>

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

Public Types

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

Public Member Functions

 SquaredDifferenceFunction (const LabelType=2, const LabelType=2, const ValueType=1)
 constructor More...
 
size_t shape (const IndexType) const
 extension a value table encoding this function would have More...
 
size_t size () const
 number of entries a value table encoding this function would have (used for I/O) More...
 
size_t dimension () const
 
weight () const
 
template<class ITERATOR >
operator() (ITERATOR) const
 
- Public Member Functions inherited from opengm::FunctionBase< SquaredDifferenceFunction< 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 SquaredDifferenceFunction< T, I, L > &) const
 
FunctionShapeIteratorType functionShapeBegin () const
 
FunctionShapeIteratorType functionShapeEnd () const
 
size_t numberOfParameters () const
 
parameterIndex (const size_t paramNumber) const
 

Detailed Description

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

squared difference of the labels of two variables

Definition at line 15 of file squared_difference.hxx.

Member Typedef Documentation

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

Definition at line 20 of file squared_difference.hxx.

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

Definition at line 21 of file squared_difference.hxx.

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

Definition at line 19 of file squared_difference.hxx.

Constructor & Destructor Documentation

template<class T , class I , class L >
opengm::SquaredDifferenceFunction< T, I, L >::SquaredDifferenceFunction ( const LabelType  numberOfStates1 = 2,
const LabelType  numberOfStates2 = 2,
const ValueType  weight = 1 
)
inline

constructor

Parameters
numberOfLabels1number of labels of the first variable
numberOfLabels2number of labels of the second variable
weightweight

Definition at line 66 of file squared_difference.hxx.

Member Function Documentation

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

Definition at line 109 of file squared_difference.hxx.

template<class T , class I , class L >
template<class ITERATOR >
T opengm::SquaredDifferenceFunction< T, I, L >::operator() ( ITERATOR  begin) const
inline

Definition at line 80 of file squared_difference.hxx.

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

extension a value table encoding this function would have

Parameters
idimension

Definition at line 93 of file squared_difference.hxx.

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

number of entries a value table encoding this function would have (used for I/O)

Definition at line 116 of file squared_difference.hxx.

template<class T , class I , class L >
T opengm::SquaredDifferenceFunction< T, I, L >::weight ( ) const
inline

Definition at line 102 of file squared_difference.hxx.