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

Constant function. More...

#include <constant.hxx>

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

Public Types

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

Public Member Functions

 ConstantFunction ()
 
template<class ITERATOR >
 ConstantFunction (ITERATOR, ITERATOR, const T)
 
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
 
template<class ITERATOR >
ValueType operator() (ITERATOR) const
 
bool isPotts () const
 
bool isGeneralizedPotts () const
 
ValueType min () const
 
ValueType max () const
 
ValueType sum () const
 
ValueType product () const
 
MinMaxFunctor< ValueTypeminMax () const
 
- Public Member Functions inherited from opengm::FunctionBase< ConstantFunction< 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 ConstantFunction< T, I, L > &) const
 
FunctionShapeIteratorType functionShapeBegin () const
 
FunctionShapeIteratorType functionShapeEnd () const
 
size_t numberOfWeights () const
 
weightIndex (const size_t weightNumber) const
 
void setWeights (const opengm::learning::Weights< T > &) const
 
weightGradient (size_t, ITERATOR) const
 

Detailed Description

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

Constant function.

Definition at line 20 of file constant.hxx.

Member Typedef Documentation

§ IndexType

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

Definition at line 25 of file constant.hxx.

§ LabelType

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

Definition at line 26 of file constant.hxx.

§ ValueType

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

Definition at line 24 of file constant.hxx.

Constructor & Destructor Documentation

§ ConstantFunction() [1/2]

template<class T , class I , class L >
opengm::ConstantFunction< T, I, L >::ConstantFunction ( )
inline

Definition at line 99 of file constant.hxx.

§ ConstantFunction() [2/2]

template<class T, class I , class L >
template<class ITERATOR >
opengm::ConstantFunction< T, I, L >::ConstantFunction ( ITERATOR  shapeBegin,
ITERATOR  shapeEnd,
const T  value 
)
inline

Definition at line 87 of file constant.hxx.

Member Function Documentation

§ dimension()

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

Definition at line 128 of file constant.hxx.

+ Here is the caller graph for this function:

§ isGeneralizedPotts()

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

Definition at line 39 of file constant.hxx.

§ isPotts()

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

Definition at line 38 of file constant.hxx.

§ max()

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

Definition at line 41 of file constant.hxx.

§ min()

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

Definition at line 40 of file constant.hxx.

§ minMax()

template<class T, class I = size_t, class L = size_t>
MinMaxFunctor<ValueType> opengm::ConstantFunction< T, I, L >::minMax ( ) const
inline

Definition at line 49 of file constant.hxx.

§ operator()()

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

Definition at line 107 of file constant.hxx.

§ product()

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

Definition at line 43 of file constant.hxx.

§ shape()

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

extension a value table encoding this function would have

Parameters
idimension

Definition at line 118 of file constant.hxx.

+ Here is the caller graph for this function:

§ size()

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

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

Definition at line 135 of file constant.hxx.

+ Here is the call graph for this function:

§ sum()

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

Definition at line 42 of file constant.hxx.