Vector of vectors of vectors. More...
#include <Vector3.hxx>
Public Types | |
typedef T | value_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
Public Member Functions | |
Vector3 () | |
Default constructor. | |
Vector3 (int) | |
Constructor. | |
Vector3 (Vector< int > &length) | |
Constructor. | |
template<class Allocator > | |
Vector3 (Vector< Vector< int >, Vect_Full, Allocator > &length) | |
Constructor. | |
~Vector3 () | |
Destructor. | |
int | GetLength () const |
Returns size along dimension 1. | |
int | GetSize () const |
Returns size along dimension 1. | |
int | GetLength (int i) const |
Returns the size of the inner vector of vectors #i. | |
int | GetSize (int i) const |
Returns the size of the inner vector of vectors #i. | |
int | GetLength (int i, int j) const |
Returns the size of the inner vector #i #j. | |
int | GetSize (int i, int j) const |
Returns the size of the inner vector #i #j. | |
int | GetNelement () const |
Returns the total number of elements in the inner vectors. | |
int | GetNelement (int beg, int end) const |
Returns the total number of elements in a range of inner vectors. | |
void | Reallocate (int N) |
Reallocates the vector of vectors of vectors. | |
void | Reallocate (int i, int N) |
Reallocates the inner vector of vectors #i. | |
void | Reallocate (int i, int j, int N) |
Reallocates the inner vector #i #j. | |
template<class Td , class Allocatord > | |
void | Flatten (Vector< Td, VectFull, Allocatord > &data) const |
Returns all values in a vector. | |
template<class Td , class Allocatord > | |
void | Flatten (int beg, int end, Vector< Td, VectFull, Allocatord > &data) const |
Returns in a vector all values from a range of inner vectors of vectors. | |
void | PushBack (int i, int j, const T &x) |
Appends an element at the end of the inner vector #i #j. | |
void | PushBack (int i, const Vector< T, Vect_Full, Allocator0 > &X) |
Appends an inner vector at the end of the inner vector of vectors #i. | |
void | PushBack (const Vector< Vector< T, Vect_Full, Allocator0 >, Vect_Full, Allocator1 > &X) |
Appends an inner vector of vectors at the end of the vector. | |
void | PushBack (const Vector< Vector< Vector< T, Vect_Full, Allocator0 >, Vect_Full, Allocator1 >, Vect_Full, Allocator2 > &X) |
Appends a vector of vectors of vectors. | |
void | PushBack (const Vector3< T, Allocator0, Allocator1, Allocator2 > &X) |
Appends a vector of vectors of vectors. | |
void | Clear () |
Clears the vector. | |
void | Clear (int i) |
Clears a given inner vector of vectors. | |
void | Clear (int i, int j) |
Clears a given inner vector. | |
void | Fill (const T &x) |
Fills the vector with a given value. | |
Vector< Vector< Vector< T, Vect_Full, Allocator0 > , Vect_Full, Allocator1 > , Vect_Full, Allocator2 > & | GetVector () |
Returns the vector of vectors of vectors. | |
const Vector< Vector< Vector < T, Vect_Full, Allocator0 > , Vect_Full, Allocator1 > , Vect_Full, Allocator2 > & | GetVector () const |
Returns the vector of vectors of vectors. | |
Vector< Vector< T, Vect_Full, Allocator0 >, VectFull, Allocator1 > & | GetVector (int i) |
Returns a given inner vector of vectors. | |
const Vector< Vector< T, Vect_Full, Allocator0 > , VectFull, Allocator1 > & | GetVector (int i) const |
Returns a given inner vector of vectors. | |
Vector< T, Vect_Full, Allocator0 > & | GetVector (int i, int j) |
Returns a given inner vector. | |
const Vector< T, Vect_Full, Allocator0 > & | GetVector (int i, int j) const |
Returns a given inner vector. | |
const Vector< Vector< T, Vect_Full, Allocator0 > , VectFull, Allocator1 > & | operator() (int i) const |
Returns a given inner vector of vectors. | |
Vector< Vector< T, Vect_Full, Allocator0 >, VectFull, Allocator1 > & | operator() (int i) |
Returns a given inner vector of vectors. | |
const Vector< T, Vect_Full, Allocator0 > & | operator() (int i, int j) const |
Returns a given inner vector. | |
Vector< T, Vect_Full, Allocator0 > & | operator() (int i, int j) |
Returns a given inner vector. | |
const_reference | operator() (int i, int j, int k) const |
Returns an element of a given inner vector of a given vector of vectors. | |
reference | operator() (int i, int j, int k) |
Returns an element of a given inner vector of a given vector of vectors. | |
void | Print () const |
Displays the vector. | |
Protected Attributes | |
Vector< Vector< Vector< T, Vect_Full, Allocator0 > , Vect_Full, Allocator1 > , Vect_Full, Allocator2 > | data_ |
Vector of vectors of vectors.
Vector3 is a structure that acts like a vector of vectors of vectors. Both inner vectors and inner vectors of vectors can be of any dimension, so that this structure is more flexible than an Array3D.
T | numerical type of the inner vectors. | |
Allocator0 | allocator for the inner vectors. The default allocator is SELDON_DEFAULT_ALLOCATOR. | |
Allocator1 | allocator for the vector of vectors. It is recommended to choose NewAlloc or, for more efficient in reallocations, MallocObject (default allocator here): these allocators can manage an array of inner vectors. | |
Allocator2 | allocator for the vector of vectors of vectors. It is recommended to choose NewAlloc or, for more efficient in reallocations, MallocObject (default allocator here). |
Definition at line 72 of file Vector3.hxx.
Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Vector3 | ( | ) |
Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Vector3 | ( | int | length | ) |
Constructor.
The vector of vectors of vectors is allocated with length empty vectors of vectors.
[in] | length | the length of the vector of vectors of vectors. |
Definition at line 54 of file Vector3.cxx.
Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Vector3 | ( | Vector< int > & | length | ) |
Constructor.
The vector of vectors of vectors and the inner vectors of vectors are allocated.
[in] | length | the lengths of the inner vectors of vectors. The vector of vectors of vectors will obviously have as many elements as length has. |
Definition at line 69 of file Vector3.cxx.
Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Vector3 | ( | Vector< Vector< int >, Vect_Full, Allocator > & | length | ) |
Constructor.
The vector of vectors of vectors, the inner vectors of vectors and the inner vectors are allocated.
[in] | length | the lengths of the inner vectors of vectors and the inner vectors. The vector of vectors of vectors will obviously have as many elements as length has. |
Definition at line 92 of file Vector3.cxx.
Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::~Vector3 | ( | ) |
Destructor.
The vector of vectors of vectors, the inner vectors of vectors and the inner vectors are deallocated.
Definition at line 117 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Clear | ( | int | i | ) |
Clears a given inner vector of vectors.
[in] | i | index of the vector of vectors to be cleared. |
Definition at line 423 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Clear | ( | int | i, | |
int | j | |||
) |
Clears a given inner vector.
[in] | i | index of the vector to be cleared. |
[in] | j | index of the vector to be cleared. |
Definition at line 435 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Fill | ( | const T & | x | ) |
Fills the vector with a given value.
[in] | x | value to fill the vector with. |
Definition at line 446 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Flatten | ( | Vector< Td, VectFull, Allocatord > & | data | ) | const |
Returns all values in a vector.
The output vector data contains all inner vectors concatenated in the same order as they appear in the current Vector2 instance.
[out] | data | all values from the current Vector2 instance. |
Definition at line 294 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Flatten | ( | int | beg, | |
int | end, | |||
Vector< Td, VectFull, Allocatord > & | data | |||
) | const |
Returns in a vector all values from a range of inner vectors of vectors.
The output vector data contains all inner vectors, in the index range [beg, end[, concatenated in the same order as they appear in the current Vector3 instance.
[in] | beg | inclusive lower-bound for the indexes. |
[in] | end | exclusive upper-bound for the indexes. |
[out] | data | the values contained in the inner vectors [beg, end[. |
Definition at line 317 of file Vector3.cxx.
int Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetLength | ( | int | i, | |
int | j | |||
) | const |
Returns the size of the inner vector #i #j.
[in] | i | index. |
[in] | j | index. |
Definition at line 181 of file Vector3.cxx.
int Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetLength | ( | ) | const |
Returns size along dimension 1.
Definition at line 132 of file Vector3.cxx.
int Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetLength | ( | int | i | ) | const |
Returns the size of the inner vector of vectors #i.
[in] | i | index. |
Definition at line 155 of file Vector3.cxx.
int Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetNelement | ( | int | beg, | |
int | end | |||
) | const |
Returns the total number of elements in a range of inner vectors.
Returns the total number of elements in the range [beg, end[ of inner vectors of vectors.
[in] | beg | inclusive lower-bound for the indexes. |
[in] | end | exclusive upper-bound for the indexes. |
Definition at line 226 of file Vector3.cxx.
int Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetNelement | ( | ) | const |
Returns the total number of elements in the inner vectors.
Definition at line 206 of file Vector3.cxx.
int Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetSize | ( | int | i | ) | const |
Returns the size of the inner vector of vectors #i.
[in] | i | index. |
Definition at line 167 of file Vector3.cxx.
int Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetSize | ( | ) | const |
Returns size along dimension 1.
Definition at line 143 of file Vector3.cxx.
int Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetSize | ( | int | i, | |
int | j | |||
) | const |
Returns the size of the inner vector #i #j.
[in] | i | index. |
[in] | j | index. |
Definition at line 195 of file Vector3.cxx.
Vector< T, Vect_Full, Allocator0 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetVector | ( | int | i, | |
int | j | |||
) |
Returns a given inner vector.
[in] | i | index of the inner vector. |
[in] | j | index of the inner vector. |
Definition at line 514 of file Vector3.cxx.
Vector< Vector< Vector< T, Vect_Full, Allocator0 >, Vect_Full, Allocator1 >, Vect_Full, Allocator2 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetVector | ( | ) |
Returns the vector of vectors of vectors.
Definition at line 461 of file Vector3.cxx.
const Vector< Vector< Vector< T, Vect_Full, Allocator0 >, Vect_Full, Allocator1 >, Vect_Full, Allocator2 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetVector | ( | ) | const |
Returns the vector of vectors of vectors.
Definition at line 474 of file Vector3.cxx.
Vector< Vector< T, Vect_Full, Allocator0 >, VectFull, Allocator1 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetVector | ( | int | i | ) |
Returns a given inner vector of vectors.
[in] | i | index of the inner vector of vectors. |
Definition at line 487 of file Vector3.cxx.
const Vector< Vector< T, Vect_Full, Allocator0 >, VectFull, Allocator1 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetVector | ( | int | i | ) | const |
Returns a given inner vector of vectors.
[in] | i | index of the inner vector of vectors. |
Definition at line 500 of file Vector3.cxx.
const Vector< T, Vect_Full, Allocator0 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::GetVector | ( | int | i, | |
int | j | |||
) | const |
Returns a given inner vector.
[in] | i | index of the inner vector. |
[in] | j | index of the inner vector. |
Definition at line 528 of file Vector3.cxx.
const Vector< Vector< T, Vect_Full, Allocator0 >, VectFull, Allocator1 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::operator() | ( | int | i | ) | const |
Returns a given inner vector of vectors.
[in] | i | index of the inner vector of vectors. |
Definition at line 548 of file Vector3.cxx.
Vector< T, Vect_Full, Allocator0 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::operator() | ( | int | i, | |
int | j | |||
) |
Returns a given inner vector.
[in] | i | index of the inner vector. |
[in] | j | index of the inner vector. |
Definition at line 590 of file Vector3.cxx.
Vector3< T, Allocator0, Allocator1, Allocator2 >::reference Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::operator() | ( | int | i, | |
int | j, | |||
int | k | |||
) |
Returns an element of a given inner vector of a given vector of vectors.
[in] | i | index of the inner vector of vectors. |
[in] | j | index of the inner vector in the vector of vectors #i. |
[in] | k | index of the element in the inner vector #j. |
Definition at line 622 of file Vector3.cxx.
Vector3< T, Allocator0, Allocator1, Allocator2 >::const_reference Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::operator() | ( | int | i, | |
int | j, | |||
int | k | |||
) | const |
Returns an element of a given inner vector of a given vector of vectors.
[in] | i | index of the inner vector of vectors. |
[in] | j | index of the inner vector in the vector of vectors #i. |
[in] | k | index of the element in the inner vector #j. |
Definition at line 606 of file Vector3.cxx.
const Vector< T, Vect_Full, Allocator0 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::operator() | ( | int | i, | |
int | j | |||
) | const |
Returns a given inner vector.
[in] | i | index of the inner vector. |
[in] | j | index of the inner vector. |
Definition at line 576 of file Vector3.cxx.
Vector< Vector< T, Vect_Full, Allocator0 >, VectFull, Allocator1 > & Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::operator() | ( | int | i | ) |
Returns a given inner vector of vectors.
[in] | i | index of the inner vector of vectors. |
Definition at line 561 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::PushBack | ( | const Vector< Vector< T, Vect_Full, Allocator0 >, Vect_Full, Allocator1 > & | X | ) |
Appends an inner vector of vectors at the end of the vector.
[in] | X | inner vector of vectors to be appended. |
Definition at line 373 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::PushBack | ( | const Vector3< T, Allocator0, Allocator1, Allocator2 > & | X | ) |
Appends a vector of vectors of vectors.
The inner vectors of vectors of X are appended to the current instance, in the same order as they appear in X.
[in] | X | vector of vectors of vectors to be appended. |
Definition at line 402 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::PushBack | ( | int | i, | |
const Vector< T, Vect_Full, Allocator0 > & | X | |||
) |
Appends an inner vector at the end of the inner vector of vectors #i.
[in] | i | index of the inner vector of vectors. |
[in] | X | inner vector to be appended. |
Definition at line 361 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::PushBack | ( | const Vector< Vector< Vector< T, Vect_Full, Allocator0 >, Vect_Full, Allocator1 >, Vect_Full, Allocator2 > & | X | ) |
Appends a vector of vectors of vectors.
The inner vectors of vectors of X are appended to the current instance, in the same order as they appear in X.
[in] | X | vector of vectors of vectors to be appended. |
Definition at line 387 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::PushBack | ( | int | i, | |
int | j, | |||
const T & | x | |||
) |
Appends an element at the end of the inner vector #i #j.
[in] | i | index of the inner vector of vectors. |
[in] | j | index of the inner vector to which x should be appended. |
[in] | x | element to be appended. |
Definition at line 348 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Reallocate | ( | int | N | ) |
Reallocates the vector of vectors of vectors.
[in] | N | the new size of the vector of vectors of vectors. |
Definition at line 253 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Reallocate | ( | int | i, | |
int | N | |||
) |
Reallocates the inner vector of vectors #i.
[in] | i | index of the inner vector of vectors to be reallocated. |
[in] | N | the new size of the inner vector of vectors #i. |
Definition at line 266 of file Vector3.cxx.
void Seldon::Vector3< T, Allocator0, Allocator1, Allocator2 >::Reallocate | ( | int | i, | |
int | j, | |||
int | N | |||
) |
Reallocates the inner vector #i #j.
[in] | i | index of the inner vector of vectors. |
[in] | j | index of the inner vector to be reallocated. |
[in] | N | the new vector size. |
Definition at line 280 of file Vector3.cxx.