arr3< T > Class Template Reference
[Array classes]
#include <arr.h>
List of all members.
|
Public Member Functions |
| arr3 () |
| arr3 (tsize sz1, tsize sz2, tsize sz3) |
| arr3 (const arr3 &orig) |
| ~arr3 () |
tsize | size1 () const |
tsize | size2 () const |
tsize | size3 () const |
tsize | size () const |
void | alloc (tsize sz1, tsize sz2, tsize sz3) |
void | dealloc () |
void | fill (const T &val) |
arr3 & | operator= (const arr3 &orig) |
template<typename T2, typename T3, typename T4> |
T & | operator() (T2 n1, T3 n2, T4 n3) |
template<typename T2, typename T3, typename T4> |
const T & | operator() (T2 n1, T3 n2, T4 n3) const |
void | swap (arr3 &other) |
template<typename T2> |
bool | conformable (const arr3< T2 > &other) const |
Detailed Description
template<typename T>
class arr3< T >
Three-dimensional array type. The storage ordering is the same as in C. An entry is located by address arithmetic, not by multiple dereferencing. The indices start at zero.
Definition at line 581 of file arr.h.
Constructor & Destructor Documentation
Creates a zero-sized array.
Definition at line 589 of file arr.h.
Creates an array with the dimensions sz1, sz2 and sz3.
Definition at line 591 of file arr.h.
Creates the array as a copy of orig.
Definition at line 594 of file arr.h.
Frees the memory associated with the array.
Definition at line 597 of file arr.h.
Member Function Documentation
Returns the first array dimension.
Definition at line 600 of file arr.h.
Returns the second array dimension.
Definition at line 602 of file arr.h.
Returns the third array dimension.
Definition at line 604 of file arr.h.
Returns the total array size, i.e. the product of all dimensions.
Definition at line 606 of file arr.h.
Allocates space for an array with sz1*sz2*sz3 elements. The content of the array is undefined on exit.
Definition at line 610 of file arr.h.
template<typename T>
void arr3< T >::dealloc |
( |
|
) |
[inline] |
Deallocates the space and makes the array zero-sized.
Definition at line 616 of file arr.h.
template<typename T>
void arr3< T >::fill |
( |
const T & |
val |
) |
[inline] |
Sets all array elements to val.
Definition at line 619 of file arr.h.
template<typename T>
arr3& arr3< T >::operator= |
( |
const arr3< T > & |
orig |
) |
[inline] |
Changes the array to be a copy of orig.
Definition at line 623 of file arr.h.
template<typename T>
template<typename T2, typename T3, typename T4>
T& arr3< T >::operator() |
( |
T2 |
n1, |
|
|
T3 |
n2, |
|
|
T4 |
n3 | |
|
) |
| | [inline] |
Returns a reference to the element with the indices n1, n2 and n3.
Definition at line 634 of file arr.h.
template<typename T>
template<typename T2, typename T3, typename T4>
const T& arr3< T >::operator() |
( |
T2 |
n1, |
|
|
T3 |
n2, |
|
|
T4 |
n3 | |
|
) |
| | const [inline] |
Returns a constant reference to the element with the indices n1, n2 and n3.
Definition at line 639 of file arr.h.
template<typename T>
void arr3< T >::swap |
( |
arr3< T > & |
other |
) |
[inline] |
Swaps contents and sizes with other.
Definition at line 643 of file arr.h.
template<typename T>
template<typename T2>
bool arr3< T >::conformable |
( |
const arr3< T2 > & |
other |
) |
const [inline] |
Returns true
if the array and other have the same dimensions, else false
.
Definition at line 654 of file arr.h.
The documentation for this class was generated from the following file: