opengm::DiscreteSpace< I, L > Class Template Reference
[Space Types]

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

#include <discretespace.hxx>

Inheritance diagram for opengm::DiscreteSpace< I, L >:
Inheritance graph
[legend]
Collaboration diagram for opengm::DiscreteSpace< I, L >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef I IndexType
typedef L LabelType

Public Member Functions

 DiscreteSpace ()
 construct an empty label space (with zero variables)
template<class Iterator >
 DiscreteSpace (Iterator, Iterator)
 construct a label space in which each variable can attain a different number of labels
template<class Iterator >
void assign (Iterator, Iterator)
 assign a new sequence of numbers of labels to an existing space
template<class Iterator >
void assignDense (Iterator, Iterator)
IndexType addVariable (const LabelType)
 add one more variable
IndexType numberOfVariables () const
LabelType numberOfLabels (const IndexType) const
void reserve (const IndexType)
 allocate memory for a fixed number of variables

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, opengmBuildGrid.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

Reimplemented from opengm::SpaceBase< DiscreteSpace< I, L >, I, L >.

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

Reimplemented from opengm::SpaceBase< DiscreteSpace< I, L >, I, L >.

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:
begin iterator to the beginning of a sequence of numbers of labels
end iterator 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

Reimplemented from opengm::SpaceBase< DiscreteSpace< I, L >, I, L >.

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:
begin iterator to the beginning of a sequence of numbers of labels
end iterator 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]

Reimplemented from opengm::SpaceBase< DiscreteSpace< I, L >, I, L >.

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]

Reimplemented from opengm::SpaceBase< DiscreteSpace< I, L >, I, L >.

Definition at line 124 of file discretespace.hxx.

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

Reimplemented from opengm::SpaceBase< DiscreteSpace< I, L >, I, L >.

Definition at line 116 of file discretespace.hxx.

template<class I , class L >
void opengm::DiscreteSpace< I, L >::reserve ( const  IndexType  )  [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:

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