#include <tvalarray.h>
Public Member Functions | |
tvalarray () | |
Create an empty array. | |
tvalarray (unsigned _n) | |
Create an array with n elements. | |
tvalarray (const T &value, unsigned _n) | |
Create an array with n initialized elements. | |
tvalarray (const T *values, unsigned _n) | |
Create an array with n initialized elements. | |
tvalarray (const tvalarray &a) | |
Copy constructor. | |
unsigned | size () const |
Gets the number of elements. | |
operator T * () | |
Gets the underlying array. | |
operator const T * () const | |
Gets the underlying array. | |
tvalarray & | operator= (const tvalarray &a) |
Copy (but do not resize!!!). | |
tvalarray & | operator+= (const tvalarray &a) |
Addition assignment. | |
tvalarray & | operator+= (const T &c) |
Addition assignment. | |
tvalarray & | operator^= (const tvalarray &a) |
Bitwise exclusive OR assignment. | |
tvalarray & | operator^= (const T &c) |
Bitwise exclusive OR assignment. | |
tvalarray & | operator &= (const tvalarray &a) |
Bitwise AND assignment. | |
tvalarray & | operator &= (const T &c) |
Bitwise AND assignment. | |
tvalarray & | operator|= (const tvalarray &a) |
Bitwise inclusive OR assignment. | |
tvalarray & | operator|= (const T &c) |
Bitwise inclusive OR assignment. | |
tvalarray & | operator<<= (const tvalarray &a) |
Bitwise left shift assignment. | |
tvalarray & | operator<<= (const T &c) |
Bitwise left shift assignment. | |
tvalarray & | operator>>= (const tvalarray &a) |
Bitwise right shift assignment. | |
tvalarray & | operator>>= (const T &c) |
Bitwise right shift assignment. | |
tvalarray & | operator*= (const tvalarray &a) |
Multiplication assignment. | |
tvalarray & | operator*= (const T &c) |
Multiplication assignment. | |
tvalarray & | operator/= (const tvalarray &a) |
Division assignment. | |
tvalarray & | operator/= (const T &c) |
Division assignment. | |
tvalarray & | operator%= (const tvalarray &a) |
Remainder assignment. | |
tvalarray & | operator%= (const T &c) |
Remainder assignment. | |
tvalarray & | operator= (const T &c) |
Assignment operation. | |
tvalarray & | operator-= (const T &c) |
Subtraction assignment. | |
tvalarray & | operator-= (const tvalarray &a) |
Subtraction assignment. | |
void | resize (unsigned _n, T value=T()) |
Resize array and initialize all elements. | |
T | operator[] (int k) const |
Gets the kth element. | |
T & | operator[] (int k) |
Gets the kth element. | |
tvalarray | shift (int k) const |
Returns a shifted array. | |
tvalarray | cshift (int k) const |
Returns a rotated array. | |
void | realloc (int _n) |
(Re)allocate array. | |
Protected Member Functions | |
tvalarray (T *array, unsigned _n, bool realloc) | |
Create an array that uses the specified low level array. | |
Friends | |
template<class Tp> | |
void | copy (const tvalarray< Tp > &source, tvalarray< Tp > &dest) |
Copy (also realloc if necessary). | |
template<class Tp> | |
void | copy (const tvalarray< tvalarray< Tp > > &source, tvalarray< tvalarray< Tp > > &dest) |
Copy (also realloc if necessary). | |
template<class Tp> | |
void | resize (tvalarray< Tp > &arr, unsigned _n, Tp value=Tp()) |
Resize array and initialize all elements. | |
template<class Tp> | |
void | resize (tvalarray< tvalarray< Tp > > &arr, unsigned _n, tvalarray< Tp > value=tvalarray< Tp >()) |
Resize array and initialize all elements in hyper-arrays. |
tvalarray< T >::tvalarray | ( | T * | array, | |
unsigned | _n, | |||
bool | realloc | |||
) | [inline, protected] |
Create an array that uses the specified low level array.
Create an array with n elements.
Create an array with n initialized elements.
Create an array with n initialized elements.
unsigned tvalarray< T >::size | ( | ) | const [inline] |
Gets the number of elements.
tvalarray< T >::operator T * | ( | ) | [inline] |
Gets the underlying array.
tvalarray< T >::operator const T * | ( | ) | const [inline] |
Gets the underlying array.
Copy (but do not resize!!!).
Addition assignment.
Addition assignment.
Bitwise exclusive OR assignment.
Bitwise exclusive OR assignment.
Bitwise AND assignment.
Bitwise AND assignment.
Bitwise inclusive OR assignment.
Bitwise inclusive OR assignment.
Bitwise left shift assignment.
Bitwise left shift assignment.
Bitwise right shift assignment.
Bitwise right shift assignment.
Multiplication assignment.
Multiplication assignment.
Division assignment.
Division assignment.
Remainder assignment.
Remainder assignment.
Assignment operation.
Subtraction assignment.
Subtraction assignment.
void tvalarray< T >::resize | ( | unsigned | _n, | |
T | value = T() | |||
) | [inline] |
Resize array and initialize all elements.
T tvalarray< T >::operator[] | ( | int | k | ) | const [inline] |
Gets the kth element.
T& tvalarray< T >::operator[] | ( | int | k | ) | [inline] |
Gets the kth element.
Returns a shifted array.
Returns a rotated array.
void tvalarray< T >::realloc | ( | int | _n | ) | [inline] |
(Re)allocate array.
void copy | ( | const tvalarray< Tp > & | source, | |
tvalarray< Tp > & | dest | |||
) | [friend] |
Copy (also realloc if necessary).
The instance for Tp!=tvalarray<>.
void copy | ( | const tvalarray< tvalarray< Tp > > & | source, | |
tvalarray< tvalarray< Tp > > & | dest | |||
) | [friend] |
Copy (also realloc if necessary).
The instance for Tp==tvalarray<>.
void resize | ( | tvalarray< Tp > & | arr, | |
unsigned | _n, | |||
Tp | value = Tp() | |||
) | [friend] |
Resize array and initialize all elements.
void resize | ( | tvalarray< tvalarray< Tp > > & | arr, | |
unsigned | _n, | |||
tvalarray< Tp > | value = tvalarray< Tp >() | |||
) | [friend] |
Resize array and initialize all elements in hyper-arrays.