HyperspaceExplorer 0.7.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
VecMath::MultiDimensionalVector< T, 1 > Class Template Reference

Specialization of NestedVector<T, D> for D = 1. More...

#include <MultiDimensionalVector.h>

Collaboration diagram for VecMath::MultiDimensionalVector< T, 1 >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector< T >::iterator iterator
 See MultiDimensionalVector<T, D>::iterator.
typedef std::vector< T >
::const_iterator 
const_iterator
 See MultiDimensionalVector<T, D>::const_iterator.

Public Member Functions

 MultiDimensionalVector ()
 See MultiDimensionalVector<T, D>::MultiDimensionalVector()
 MultiDimensionalVector (unsigned n)
 See MultiDimensionalVector<T, D>::MultiDimensionalVector()
 MultiDimensionalVector (std::vector< T > data)
iterator begin ()
 See MultiDimensionalVector<T, D>::begin()
iterator end ()
 See MultiDimensionalVector<T, D>::end()
const_iterator begin () const
 See MultiDimensionalVector<T, D>::begin()
const_iterator end () const
 See MultiDimensionalVector<T, D>::end()
void push_back (const T &x)
 See MultiDimensionalVector<T, D>::push_back()
T & back ()
 Returns a read/write reference to the data at the last element of the vector.
const T & back () const
 Returns a read-only (constant) reference to the data at the last element of the vector.
iterator erase (iterator position)
 See MultiDimensionalVector<T, D>::erase()
iterator erase (iterator first, iterator last)
 Remove elements at given range.
T & operator[] (unsigned i)
 See MultiDimensionalVector<T, D>::operator []()
const T & operator[] (unsigned i) const
 See MultiDimensionalVector<T, D>::operator []()
unsigned size () const
 See MultiDimensionalVector<T, D>::size()
unsigned empty () const
 See MultiDimensionalVector<T, D>::empty()
void clear ()
 See MultiDimensionalVector<T, D>::clear()
void resize (unsigned new_size)
 See MultiDimensionalVector<T, D>::resize()
void resize (unsigned new_size, T x)
 Resizes the vector to the specified number of elements.
void reserve (unsigned new_size)
 Attempt to preallocate enough memory for specified number of elements.
bool operator== (const MultiDimensionalVector< T, 1 > &other) const
 See MultiDimensionalVector<T, D>::operator ==()
bool operator!= (const MultiDimensionalVector< T, 1 > &other) const
 See MultiDimensionalVector<T, D>::operator !=()
template<typename Function >
Function for_each (Function f)
 Apply a function or functor on every element of a MultiDimensionalVector.
template<typename Function >
Function for_each (Function f) const
 Apply a function or functor on every element of a MultiDimensionalVector.
std::string toString () const
 Convert MultiDimensionalVector to a std::string.
void print () const
 See MultiDimensionalVector<T, D>::print()

Static Public Member Functions

static bool print_num_elements ()
 Whether to print the number of elements with operator <<().
static unsigned max_dimension ()
 How deep to insert maximally with operator <<().

Protected Member Functions

std::vector< T > & data ()
 See MultiDimensionalVector<T, D>::data()
const std::vector< T > & data () const
 See MultiDimensionalVector<T, D>::data()

Private Attributes

std::vector< T > _data
 std::vector<T>. All operations are delegated to this vector.

Static Private Attributes

static const bool PRINT_NUM_ELEMENTS = false
 Compile-time configuration: Whether to print the number of elements with operator <<().
static const unsigned MAX_DIMENSION = 4
 Compile-time configuration: How deep to insert maximally with operator <<().

Detailed Description

template<typename T>
class VecMath::MultiDimensionalVector< T, 1 >

Specialization of NestedVector<T, D> for D = 1.


Member Function Documentation

template<typename T >
MultiDimensionalVector< T, 1 >::iterator VecMath::MultiDimensionalVector< T, 1 >::erase ( iterator  position)

See MultiDimensionalVector<T, D>::erase()

Parameters:
positionIterator pointing to element to be erased
Returns:
An iterator pointing to the next element (or end())

References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::erase().

Here is the call graph for this function:

template<typename T >
MultiDimensionalVector< T, 1 >::iterator VecMath::MultiDimensionalVector< T, 1 >::erase ( iterator  first,
iterator  last 
)

Remove elements at given range.

Parameters:
firstIterator pointing to first element to be erased
lastIterator pointing to one past the last element to be erased.
Returns:
An iterator pointing to the next element (or end())

References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::erase().

Here is the call graph for this function:

template<typename T >
bool VecMath::MultiDimensionalVector< T, 1 >::operator!= ( const MultiDimensionalVector< T, 1 > &  other) const

See MultiDimensionalVector<T, D>::operator !=()

Parameters:
otherNestedVector<T, 1> to compare to

References data(), and VecMath::MultiDimensionalVector< T, D >::data().

Here is the call graph for this function:

template<typename T >
bool VecMath::MultiDimensionalVector< T, 1 >::operator== ( const MultiDimensionalVector< T, 1 > &  other) const

See MultiDimensionalVector<T, D>::operator ==()

Parameters:
otherNestedVector<T, 1> to compare to

References data(), and VecMath::MultiDimensionalVector< T, D >::data().

Here is the call graph for this function:

template<typename T >
const T & VecMath::MultiDimensionalVector< T, 1 >::operator[] ( unsigned  i) const

See MultiDimensionalVector<T, D>::operator []()

Parameters:
iThe index of the element for which data should be accessed
Returns:
Read-only (constant) reference to data.

References VecMath::MultiDimensionalVector< T, D >::data().

Here is the call graph for this function:

template<typename T >
T & VecMath::MultiDimensionalVector< T, 1 >::operator[] ( unsigned  i)

See MultiDimensionalVector<T, D>::operator []()

Parameters:
iThe index of the element for which data should be accessed
Returns:
Read/write reference to data.

References VecMath::MultiDimensionalVector< T, D >::data().

Here is the call graph for this function:

template<typename T >
void VecMath::MultiDimensionalVector< T, 1 >::push_back ( const T &  x)

See MultiDimensionalVector<T, D>::push_back()

Parameters:
xData to be added

References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::push_back().

Here is the call graph for this function:

template<typename T >
void VecMath::MultiDimensionalVector< T, 1 >::reserve ( unsigned  new_size)

Attempt to preallocate enough memory for specified number of elements.

Parameters:
new_sizeNumber of elements the vector should contain

References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::reserve().

Here is the call graph for this function:

template<typename T >
void VecMath::MultiDimensionalVector< T, 1 >::resize ( unsigned  new_size,
x 
)

Resizes the vector to the specified number of elements.

Parameters:
new_sizeNumber of elements the vector should contain
xData with which new elements should be populated

References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::resize().

Here is the call graph for this function:

template<typename T >
void VecMath::MultiDimensionalVector< T, 1 >::resize ( unsigned  new_size)

See MultiDimensionalVector<T, D>::resize()

Parameters:
new_sizeNumber of elements the vector should contain

References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::resize().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:19 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo