opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL > Class Template Reference

Fallback implementation of member functions of OpenGM functions. More...

#include <function_properties_base.hxx>

Inheritance diagram for opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef AccessorIterator
< FunctionShapeAccessorType,
true > 
FunctionShapeIteratorType

Public Member Functions

bool isPotts () const
bool isGeneralizedPotts () const
bool isSubmodular () const
bool isSquaredDifference () const
bool isTruncatedSquaredDifference () const
bool isAbsoluteDifference () const
bool isTruncatedAbsoluteDifference () const
MinMaxFunctor< VALUE > minMax () const
 find minimum and maximum of the function in a single sweep
ReturnType min () const
ReturnType max () const
ReturnType sum () const
ReturnType product () const
template<class ACC >
ReturnType accumulate () const
 accumulate all values of the function
template<class FUNCTOR >
void forAllValuesInOrder (FUNCTOR &functor) const
 call a functor for each value of the function (in lexicographical order of the variable indices)
template<class FUNCTOR >
void forAllValuesInSwitchedOrder (FUNCTOR &functor) const
template<class FUNCTOR >
void forAllValuesInAnyOrder (FUNCTOR &functor) const
 call a functor for each value of the function (in un-specified order)
template<class FUNCTOR >
void forAtLeastAllUniqueValues (FUNCTOR &functor) const
 call a functor for at least all unique values of the function
template<class COORDINATE_FUNCTOR >
void forAllValuesInOrderWithCoordinate (COORDINATE_FUNCTOR &functor) const
template<class COORDINATE_FUNCTOR >
void forAllValuesInAnyOrderWithCoordinate (COORDINATE_FUNCTOR &functor) const
template<class COORDINATE_FUNCTOR >
void forAtLeastAllUniqueValuesWithCoordinate (COORDINATE_FUNCTOR &functor) const
bool operator== (const FUNCTION &) const
FunctionShapeIteratorType functionShapeBegin () const
FunctionShapeIteratorType functionShapeEnd () const

Detailed Description

template<class FUNCTION, class VALUE, class INDEX = size_t, class LABEL = size_t>
class opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >

Fallback implementation of member functions of OpenGM functions.

Definition at line 43 of file function_properties_base.hxx.


Member Typedef Documentation

template<class FUNCTION, class VALUE, class INDEX = size_t, class LABEL = size_t>
typedef AccessorIterator<FunctionShapeAccessorType, true> opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::FunctionShapeIteratorType

Definition at line 123 of file function_properties_base.hxx.


Member Function Documentation

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
template<class ACC >
FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::ReturnType opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::accumulate (  )  const [inline]

accumulate all values of the function

Template Parameters:
ACC Accumulator (e.g. Minimizer, Maximizer, ...)
Returns:
accumulated value

Definition at line 556 of file function_properties_base.hxx.

Here is the call graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
template<class FUNCTOR >
void opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::forAllValuesInAnyOrder ( FUNCTOR &  functor  )  const [inline]

call a functor for each value of the function (in un-specified order)

See also:
forAllValuesInOrder, forAtLeastAllUniqueValues

Definition at line 229 of file function_properties_base.hxx.

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
template<class COORDINATE_FUNCTOR >
void opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::forAllValuesInAnyOrderWithCoordinate ( COORDINATE_FUNCTOR &  functor  )  const [inline]

Definition at line 180 of file function_properties_base.hxx.

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
template<class FUNCTOR >
void opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::forAllValuesInOrder ( FUNCTOR &  functor  )  const [inline]

call a functor for each value of the function (in lexicographical order of the variable indices)

Example:

    template<class T>
    struct MaxFunctor {
       void operator()(const T v) {
          if(v > max_)
             max_ = v;
       }
       T max_;
    };
    MaxFunctor<float> maxFunctor;
    maxFunctor.max_ = 0.0;
    function.forAllValuesInOrder(maxFunctor);
See also:
forAllValuesInAnyOrder, forAtLeastAllUniqueValues

Definition at line 201 of file function_properties_base.hxx.

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
template<class COORDINATE_FUNCTOR >
void opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::forAllValuesInOrderWithCoordinate ( COORDINATE_FUNCTOR &  functor  )  const [inline]

Definition at line 166 of file function_properties_base.hxx.

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
template<class FUNCTOR >
void opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::forAllValuesInSwitchedOrder ( FUNCTOR &  functor  )  const [inline]

Definition at line 215 of file function_properties_base.hxx.

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
template<class FUNCTOR >
void opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::forAtLeastAllUniqueValues ( FUNCTOR &  functor  )  const [inline]

call a functor for at least all unique values of the function

See also:
forAllValuesInOrder, forAllValuesInAnyOrder

Definition at line 239 of file function_properties_base.hxx.

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
template<class COORDINATE_FUNCTOR >
void opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::forAtLeastAllUniqueValuesWithCoordinate ( COORDINATE_FUNCTOR &  functor  )  const [inline]

Definition at line 190 of file function_properties_base.hxx.

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::FunctionShapeIteratorType opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::functionShapeBegin (  )  const [inline]

Definition at line 247 of file function_properties_base.hxx.

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::FunctionShapeIteratorType opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::functionShapeEnd (  )  const [inline]

Definition at line 254 of file function_properties_base.hxx.

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
bool opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::isAbsoluteDifference (  )  const [inline]

Definition at line 311 of file function_properties_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
bool opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::isGeneralizedPotts (  )  const [inline]
template<class FUNCTION , class VALUE , class INDEX , class LABEL >
bool opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::isPotts (  )  const [inline]
template<class FUNCTION , class VALUE , class INDEX , class LABEL >
bool opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::isSquaredDifference (  )  const [inline]

Definition at line 261 of file function_properties_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
bool opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::isSubmodular (  )  const [inline]

Definition at line 490 of file function_properties_base.hxx.

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
bool opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::isTruncatedAbsoluteDifference (  )  const [inline]

Definition at line 332 of file function_properties_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
bool opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::isTruncatedSquaredDifference (  )  const [inline]

Definition at line 283 of file function_properties_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::ReturnType opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::max (  )  const [inline]

Reimplemented in opengm::ConstantFunction< T, I, L >, and opengm::PottsFunction< T, I, L >.

Definition at line 529 of file function_properties_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::ReturnType opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::min (  )  const [inline]

Reimplemented in opengm::ConstantFunction< T, I, L >, and opengm::PottsFunction< T, I, L >.

Definition at line 519 of file function_properties_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
MinMaxFunctor< VALUE > opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::minMax (  )  const [inline]

find minimum and maximum of the function in a single sweep

Returns:
class holding the minimum and the maximum

Reimplemented in opengm::ConstantFunction< T, I, L >, and opengm::PottsFunction< T, I, L >.

Definition at line 508 of file function_properties_base.hxx.

Here is the call graph for this function:

template<class FUNCTION, class VALUE , class INDEX , class LABEL >
bool opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::operator== ( const FUNCTION &  fb  )  const [inline]

Reimplemented in opengm::PottsFunction< T, I, L >.

Definition at line 135 of file function_properties_base.hxx.

Here is the call graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::ReturnType opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::product (  )  const [inline]

Reimplemented in opengm::ConstantFunction< T, I, L >, and opengm::PottsFunction< T, I, L >.

Definition at line 547 of file function_properties_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class FUNCTION , class VALUE , class INDEX , class LABEL >
FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::ReturnType opengm::FunctionBase< FUNCTION, VALUE, INDEX, LABEL >::sum (  )  const [inline]

Reimplemented in opengm::ConstantFunction< T, I, L >, and opengm::PottsFunction< T, I, L >.

Definition at line 539 of file function_properties_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Jun 17 16:31:10 2013 for OpenGM by  doxygen 1.6.3