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

Vector that stores values on the stack if size is smaller than MAX_STACK. More...

#include <fast_sequence.hxx>

+ Inheritance diagram for opengm::FastSequence< T, MAX_STACK >:
+ Collaboration diagram for opengm::FastSequence< T, MAX_STACK >:

Public Types

typedef T ValueType
 
typedef T value_type
 
typedef T const * ConstIteratorType
 
typedef T const * const_iterator
 
typedef T * IteratorType
 
typedef T * iterator
 

Public Member Functions

 FastSequence ()
 constructor More...
 
 FastSequence (const size_t)
 constructor More...
 
 FastSequence (const size_t, const T &)
 constructor More...
 
 FastSequence (const FastSequence< T, MAX_STACK > &)
 copy constructor More...
 
 ~FastSequence ()
 destructor More...
 
FastSequence< T, MAX_STACK > & operator= (const FastSequence< T, MAX_STACK > &)
 assignment operator More...
 
template<class ITERATOR >
void assign (ITERATOR, ITERATOR)
 assign values More...
 
size_t size () const
 size More...
 
T const * begin () const
 begin iterator More...
 
T const * end () const
 end iterator More...
 
T *const begin ()
 begin iterator More...
 
T *const end ()
 end iterator More...
 
T const & operator[] (const size_t) const
 access entries More...
 
T & operator[] (const size_t)
 access entries More...
 
void push_back (const T &)
 append a value More...
 
void resize (const size_t)
 resize the sequence More...
 
void reserve (const size_t)
 reserve memory More...
 
void clear ()
 clear the sequence More...
 
bool empty () const
 query if the sequence is empty More...
 
const T & front () const
 reference to the first entry More...
 
const T & back () const
 reference to the last entry More...
 
T & front ()
 reference to the first entry More...
 
T & back ()
 reference to the last entry More...
 

Detailed Description

template<class T, size_t MAX_STACK = opengm::USUAL_MAX_FACTOR_ORDER>
class opengm::FastSequence< T, MAX_STACK >

Vector that stores values on the stack if size is smaller than MAX_STACK.

Template Parameters
Tvalue type
MAX_STACKmaximum number of elements kept on the stack

The member functions resize and clear reduce the size but not the capacity of the vector.

Definition at line 21 of file fast_sequence.hxx.

Member Typedef Documentation

template<class T, size_t MAX_STACK = opengm::USUAL_MAX_FACTOR_ORDER>
typedef T const* opengm::FastSequence< T, MAX_STACK >::const_iterator

Definition at line 26 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK = opengm::USUAL_MAX_FACTOR_ORDER>
typedef T const* opengm::FastSequence< T, MAX_STACK >::ConstIteratorType

Definition at line 25 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK = opengm::USUAL_MAX_FACTOR_ORDER>
typedef T* opengm::FastSequence< T, MAX_STACK >::iterator

Definition at line 28 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK = opengm::USUAL_MAX_FACTOR_ORDER>
typedef T* opengm::FastSequence< T, MAX_STACK >::IteratorType

Definition at line 27 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK = opengm::USUAL_MAX_FACTOR_ORDER>
typedef T opengm::FastSequence< T, MAX_STACK >::value_type

Definition at line 24 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK = opengm::USUAL_MAX_FACTOR_ORDER>
typedef T opengm::FastSequence< T, MAX_STACK >::ValueType

Definition at line 23 of file fast_sequence.hxx.

Constructor & Destructor Documentation

template<class T , size_t MAX_STACK>
opengm::FastSequence< T, MAX_STACK >::FastSequence ( )

constructor

Definition at line 64 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
opengm::FastSequence< T, MAX_STACK >::FastSequence ( const size_t  size)

constructor

Parameters
sizelength of the sequence

Definition at line 75 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK>
opengm::FastSequence< T, MAX_STACK >::FastSequence ( const size_t  size,
const T &  value 
)

constructor

Parameters
sizelenght of the sequence
valueinitial value

Definition at line 95 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK>
opengm::FastSequence< T, MAX_STACK >::FastSequence ( const FastSequence< T, MAX_STACK > &  other)

copy constructor

Parameters
othercontainer to copy

Definition at line 116 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
opengm::FastSequence< T, MAX_STACK >::~FastSequence ( )

destructor

Definition at line 135 of file fast_sequence.hxx.

Member Function Documentation

template<class T , size_t MAX_STACK>
template<class ITERATOR >
void opengm::FastSequence< T, MAX_STACK >::assign ( ITERATOR  begin,
ITERATOR  end 
)
inline

assign values

Parameters
beginbegin iterator
endend iterator

Definition at line 342 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
const T & opengm::FastSequence< T, MAX_STACK >::back ( ) const
inline

reference to the last entry

Definition at line 350 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
T & opengm::FastSequence< T, MAX_STACK >::back ( )
inline

reference to the last entry

Definition at line 357 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
T const * opengm::FastSequence< T, MAX_STACK >::begin ( ) const
inline

begin iterator

Definition at line 188 of file fast_sequence.hxx.

+ Here is the caller graph for this function:

template<class T , size_t MAX_STACK>
T *const opengm::FastSequence< T, MAX_STACK >::begin ( )
inline

begin iterator

Definition at line 204 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
void opengm::FastSequence< T, MAX_STACK >::clear ( )
inline

clear the sequence

Definition at line 316 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
bool opengm::FastSequence< T, MAX_STACK >::empty ( ) const
inline

query if the sequence is empty

Definition at line 332 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
T const * opengm::FastSequence< T, MAX_STACK >::end ( ) const
inline

end iterator

Definition at line 196 of file fast_sequence.hxx.

+ Here is the caller graph for this function:

template<class T , size_t MAX_STACK>
T *const opengm::FastSequence< T, MAX_STACK >::end ( )
inline

end iterator

Definition at line 212 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
const T & opengm::FastSequence< T, MAX_STACK >::front ( ) const
inline

reference to the first entry

Definition at line 364 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
T & opengm::FastSequence< T, MAX_STACK >::front ( )
inline

reference to the first entry

Definition at line 371 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK>
FastSequence< T, MAX_STACK > & opengm::FastSequence< T, MAX_STACK >::operator= ( const FastSequence< T, MAX_STACK > &  other)

assignment operator

Parameters
othercontainer to copy

Definition at line 146 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
T const & opengm::FastSequence< T, MAX_STACK >::operator[] ( const size_t  index) const
inline

access entries

Definition at line 221 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
T & opengm::FastSequence< T, MAX_STACK >::operator[] ( const size_t  index)
inline

access entries

Definition at line 233 of file fast_sequence.hxx.

template<class T, size_t MAX_STACK>
void opengm::FastSequence< T, MAX_STACK >::push_back ( const T &  value)
inline

append a value

Parameters
valuevalue to append

Definition at line 245 of file fast_sequence.hxx.

+ Here is the caller graph for this function:

template<class T , size_t MAX_STACK>
void opengm::FastSequence< T, MAX_STACK >::reserve ( const size_t  size)
inline

reserve memory

Parameters
sizenew size of the container

Definition at line 294 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
void opengm::FastSequence< T, MAX_STACK >::resize ( const size_t  size)
inline

resize the sequence

Parameters
sizenew size of the container

Definition at line 270 of file fast_sequence.hxx.

template<class T , size_t MAX_STACK>
size_t opengm::FastSequence< T, MAX_STACK >::size ( ) const
inline

size

Definition at line 180 of file fast_sequence.hxx.

+ Here is the caller graph for this function: