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

Discrete space in which variables can have differently many labels. More...

#include <discretespace.hxx>

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

Public Types

typedef I IndexType
 
typedef L LabelType
 
- Public Types inherited from opengm::SpaceBase< DiscreteSpace< I, L >, I, L >
typedef I IndexType
 
typedef L LabelType
 

Public Member Functions

 DiscreteSpace ()
 construct an empty label space (with zero variables) More...
 
template<class Iterator >
 DiscreteSpace (Iterator, Iterator)
 construct a label space in which each variable can attain a different number of labels More...
 
template<class Iterator >
void assign (Iterator, Iterator)
 assign a new sequence of numbers of labels to an existing space More...
 
template<class Iterator >
void assignDense (Iterator, Iterator)
 
IndexType addVariable (const LabelType)
 add one more variable More...
 
IndexType numberOfVariables () const
 
LabelType numberOfLabels (const IndexType) const
 
void reserve (const IndexType)
 allocate memory for a fixed number of variables More...
 
- Public Member Functions inherited from opengm::SpaceBase< DiscreteSpace< I, L >, I, L >
IndexType numberOfVariables () const
 
LabelType numberOfLabels (const IndexType) const
 
void assignDense (Iterator, Iterator)
 
IndexType addVariable (const LabelType)
 
bool isSimpleSpace () const
 

Detailed Description

template<class I = std::size_t, class L = std::size_t>
class opengm::DiscreteSpace< I, L >

Discrete space in which variables can have differently many labels.

Examples:
io_graphical_model.cxx, opengmBuild.cxx, quick_start.cxx, and space_types.cxx.

Definition at line 17 of file discretespace.hxx.

Member Typedef Documentation

template<class I = std::size_t, class L = std::size_t>
typedef I opengm::DiscreteSpace< I, L >::IndexType

Definition at line 20 of file discretespace.hxx.

template<class I = std::size_t, class L = std::size_t>
typedef L opengm::DiscreteSpace< I, L >::LabelType

Definition at line 21 of file discretespace.hxx.

Constructor & Destructor Documentation

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

construct an empty label space (with zero variables)

Definition at line 39 of file discretespace.hxx.

template<class I , class L >
template<class Iterator >
opengm::DiscreteSpace< I, L >::DiscreteSpace ( Iterator  begin,
Iterator  end 
)
inline

construct a label space in which each variable can attain a different number of labels

Parameters
beginiterator to the beginning of a sequence of numbers of labels
enditerator to the end of a sequence of numbers of labels

Example:

size_t numbersOfLabels[] = {4, 2, 3};
opengm::DiscreteSpace<> space(numbersOfLabels, numbersOfLabels + 3);

Definition at line 57 of file discretespace.hxx.

Member Function Documentation

template<class I , class L >
DiscreteSpace< I, L >::IndexType opengm::DiscreteSpace< I, L >::addVariable ( const LabelType  numberOfLabels)
inline

add one more variable

Definition at line 106 of file discretespace.hxx.

+ Here is the caller graph for this function:

template<class I , class L >
template<class Iterator >
void opengm::DiscreteSpace< I, L >::assign ( Iterator  begin,
Iterator  end 
)
inline

assign a new sequence of numbers of labels to an existing space

Parameters
beginiterator to the beginning of a sequence of numbers of labels
enditerator to the end of a sequence of numbers of labels

Definition at line 73 of file discretespace.hxx.

template<class I , class L >
template<class Iterator >
void opengm::DiscreteSpace< I, L >::assignDense ( Iterator  begin,
Iterator  end 
)
inline

Definition at line 95 of file discretespace.hxx.

template<class I , class L >
DiscreteSpace< I, L >::LabelType opengm::DiscreteSpace< I, L >::numberOfLabels ( const IndexType  dimension) const
inline

Definition at line 124 of file discretespace.hxx.

+ Here is the caller graph for this function:

template<class I , class L >
DiscreteSpace< I, L >::IndexType opengm::DiscreteSpace< I, L >::numberOfVariables ( ) const
inline

Definition at line 116 of file discretespace.hxx.

template<class I , class L >
void opengm::DiscreteSpace< I, L >::reserve ( const IndexType  numberOfVariables)
inline

allocate memory for a fixed number of variables

Definition at line 85 of file discretespace.hxx.

+ Here is the caller graph for this function: