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

#include <pythonfunction.hxx>

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

Public Types

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

Public Member Functions

 PythonFunction ()
 
 PythonFunction (const PythonFunction &other)
 
 PythonFunction (boost::python::object functionObj, boost::python::object shapeObj, const bool gilEnsure=true)
 
PythonFunctionoperator= (const PythonFunction &other)
 
 ~PythonFunction ()
 
LabelType shape (const size_t i) const
 
size_t size () const
 
size_t dimension () const
 
template<class ITERATOR >
ValueType operator() (ITERATOR labeling) const
 
- Public Member Functions inherited from opengm::FunctionBase< PythonFunction< 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 PythonFunction< 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, class L>
class opengm::python::PythonFunction< T, I, L >

Definition at line 25 of file pythonfunction.hxx.

Member Typedef Documentation

template<class T, class I, class L>
typedef I opengm::python::PythonFunction< T, I, L >::IndexType

Definition at line 31 of file pythonfunction.hxx.

template<class T, class I, class L>
typedef L opengm::python::PythonFunction< T, I, L >::LabelType

Definition at line 30 of file pythonfunction.hxx.

template<class T, class I, class L>
typedef T opengm::python::PythonFunction< T, I, L >::ValueType

Definition at line 29 of file pythonfunction.hxx.

Constructor & Destructor Documentation

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

Definition at line 34 of file pythonfunction.hxx.

template<class T, class I, class L>
opengm::python::PythonFunction< T, I, L >::PythonFunction ( const PythonFunction< T, I, L > &  other)
inline

Definition at line 39 of file pythonfunction.hxx.

template<class T, class I, class L>
opengm::python::PythonFunction< T, I, L >::PythonFunction ( boost::python::object  functionObj,
boost::python::object  shapeObj,
const bool  gilEnsure = true 
)
inline

Definition at line 51 of file pythonfunction.hxx.

template<class T, class I, class L>
opengm::python::PythonFunction< T, I, L >::~PythonFunction ( )
inline

Definition at line 82 of file pythonfunction.hxx.

Member Function Documentation

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

Definition at line 95 of file pythonfunction.hxx.

template<class T, class I, class L>
template<class ITERATOR >
ValueType opengm::python::PythonFunction< T, I, L >::operator() ( ITERATOR  labeling) const
inline

Definition at line 100 of file pythonfunction.hxx.

template<class T, class I, class L>
PythonFunction& opengm::python::PythonFunction< T, I, L >::operator= ( const PythonFunction< T, I, L > &  other)
inline

Definition at line 69 of file pythonfunction.hxx.

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

Definition at line 89 of file pythonfunction.hxx.

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

Definition at line 92 of file pythonfunction.hxx.