HyperspaceExplorer 0.7.1
|
Specialization of NestedVector<T, D> for D
= 1.
More...
#include <MultiDimensionalVector.h>
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 <<(). |
Specialization of NestedVector<T, D> for D
= 1.
MultiDimensionalVector< T, 1 >::iterator VecMath::MultiDimensionalVector< T, 1 >::erase | ( | iterator | position | ) |
See MultiDimensionalVector<T, D>::erase()
position | Iterator pointing to element to be erased |
References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::erase().
MultiDimensionalVector< T, 1 >::iterator VecMath::MultiDimensionalVector< T, 1 >::erase | ( | iterator | first, |
iterator | last | ||
) |
Remove elements at given range.
first | Iterator pointing to first element to be erased |
last | Iterator pointing to one past the last element to be erased. |
References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::erase().
bool VecMath::MultiDimensionalVector< T, 1 >::operator!= | ( | const MultiDimensionalVector< T, 1 > & | other | ) | const |
See MultiDimensionalVector<T, D>::operator !=()
other | NestedVector<T, 1> to compare to |
References data(), and VecMath::MultiDimensionalVector< T, D >::data().
bool VecMath::MultiDimensionalVector< T, 1 >::operator== | ( | const MultiDimensionalVector< T, 1 > & | other | ) | const |
See MultiDimensionalVector<T, D>::operator ==()
other | NestedVector<T, 1> to compare to |
References data(), and VecMath::MultiDimensionalVector< T, D >::data().
const T & VecMath::MultiDimensionalVector< T, 1 >::operator[] | ( | unsigned | i | ) | const |
See MultiDimensionalVector<T, D>::operator []()
i | The index of the element for which data should be accessed |
References VecMath::MultiDimensionalVector< T, D >::data().
T & VecMath::MultiDimensionalVector< T, 1 >::operator[] | ( | unsigned | i | ) |
See MultiDimensionalVector<T, D>::operator []()
i | The index of the element for which data should be accessed |
References VecMath::MultiDimensionalVector< T, D >::data().
void VecMath::MultiDimensionalVector< T, 1 >::push_back | ( | const T & | x | ) |
See MultiDimensionalVector<T, D>::push_back()
x | Data to be added |
References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::push_back().
void VecMath::MultiDimensionalVector< T, 1 >::reserve | ( | unsigned | new_size | ) |
Attempt to preallocate enough memory for specified number of elements.
new_size | Number of elements the vector should contain |
References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::reserve().
void VecMath::MultiDimensionalVector< T, 1 >::resize | ( | unsigned | new_size, |
T | x | ||
) |
Resizes the vector to the specified number of elements.
new_size | Number of elements the vector should contain |
x | Data with which new elements should be populated |
References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::resize().
void VecMath::MultiDimensionalVector< T, 1 >::resize | ( | unsigned | new_size | ) |
See MultiDimensionalVector<T, D>::resize()
new_size | Number of elements the vector should contain |
References VecMath::MultiDimensionalVector< T, D >::data(), and std::vector< _Tp, _Alloc >::resize().