#include <Array4D.h>
Public Member Functions | |
int | dim1 () |
Gets the number of elements in the array's first dimension. | |
int | dim2 () |
Gets the number of elements in the array's second dimension. | |
int | dim3 () |
Gets the number of elements in the array's third dimension. | |
int | dim4 () |
Gets the number of elements in the array's fourth dimension. | |
int | size () |
Gets the total number of elements in the array. | |
T **** | array () |
Gets a pointer to an array containing the array elements. | |
void | allocate (int i, int j, int k, int l) |
Allocates memory for the array. | |
void | deallocate () |
Deallocates memory for the array. | |
void | operator= (const Array4D &rhs) |
Sets two arrays equal. | |
Array4D () | |
Creates an array. | |
Array4D (int i, int j, int k, int l) | |
Creates an array and allocates memory. | |
Array4D (const Array4D &rhs) | |
Creates an array and sets it equal to another array. | |
~Array4D () | |
Destroy's the array and cleans up the memory. | |
T & | operator() (int i, int j, int k, int l) |
Accesses element (i,j,k,l) of the array. | |
Private Attributes | |
int | n_1 |
Number of elements in the array's first dimension. | |
int | n_2 |
Number of elements in the array's second dimension. | |
int | n_3 |
Number of elements in the array's third dimension. | |
int | n_4 |
Number of elements in the array's fourth dimension. | |
T **** | pArray |
Array containing the data. |
All of the memory allocation and deallocation details are dealt with by the class.
Definition at line 43 of file Array4D.h.
Creates an array.
Definition at line 213 of file Array4D.h.
References Array4D< T >::n_1, Array4D< T >::n_2, Array4D< T >::n_3, Array4D< T >::n_4, and Array4D< T >::pArray.
Creates an array and allocates memory.
i | size of the array's first dimension. | |
j | size of the array's second dimension. | |
k | size of the array's third dimension. | |
l | size of the array's fourth dimension. |
Definition at line 225 of file Array4D.h.
References Array4D< T >::allocate(), Array4D< T >::n_1, Array4D< T >::n_2, Array4D< T >::n_3, Array4D< T >::n_4, and Array4D< T >::pArray.
Creates an array and sets it equal to another array.
rhs | array to set this array equal to. |
Definition at line 235 of file Array4D.h.
References Array4D< T >::allocate(), Array4D< T >::n_1, Array4D< T >::n_2, Array4D< T >::n_3, Array4D< T >::n_4, and Array4D< T >::pArray.
Destroy's the array and cleans up the memory.
Definition at line 256 of file Array4D.h.
References Array4D< T >::deallocate().
int Array4D< T >::dim1 | ( | ) | [inline] |
Gets the number of elements in the array's first dimension.
Definition at line 87 of file Array4D.h.
References Array4D< T >::n_1.
int Array4D< T >::dim2 | ( | ) | [inline] |
Gets the number of elements in the array's second dimension.
Definition at line 94 of file Array4D.h.
References Array4D< T >::n_2.
int Array4D< T >::dim3 | ( | ) | [inline] |
Gets the number of elements in the array's third dimension.
Definition at line 101 of file Array4D.h.
References Array4D< T >::n_3.
int Array4D< T >::dim4 | ( | ) | [inline] |
Gets the number of elements in the array's fourth dimension.
Definition at line 108 of file Array4D.h.
References Array4D< T >::n_4.
int Array4D< T >::size | ( | ) | [inline] |
Gets the total number of elements in the array.
Definition at line 115 of file Array4D.h.
References Array4D< T >::n_1, Array4D< T >::n_2, and Array4D< T >::n_3.
T**** Array4D< T >::array | ( | ) | [inline] |
Gets a pointer to an array containing the array elements.
The ordering of this array is NOT specified.
Definition at line 121 of file Array4D.h.
References Array4D< T >::pArray.
void Array4D< T >::allocate | ( | int | i, | |
int | j, | |||
int | k, | |||
int | l | |||
) | [inline] |
Allocates memory for the array.
i | size of the array's first dimension. | |
j | size of the array's second dimension. | |
k | size of the array's third dimension. | |
l | size of the array's fourth dimension. |
Definition at line 132 of file Array4D.h.
References Array4D< T >::deallocate(), Array4D< T >::n_1, Array4D< T >::n_2, Array4D< T >::n_3, Array4D< T >::n_4, and Array4D< T >::pArray.
Referenced by Array4D< T >::Array4D(), and Array4D< T >::operator=().
void Array4D< T >::deallocate | ( | ) | [inline] |
Deallocates memory for the array.
Definition at line 171 of file Array4D.h.
References Array4D< T >::n_1, Array4D< T >::n_2, Array4D< T >::n_3, and Array4D< T >::pArray.
Referenced by Array4D< T >::allocate(), and Array4D< T >::~Array4D().
Sets two arrays equal.
Definition at line 195 of file Array4D.h.
References Array4D< T >::allocate(), Array4D< T >::n_1, Array4D< T >::n_2, Array4D< T >::n_3, Array4D< T >::n_4, and Array4D< T >::pArray.
T& Array4D< T >::operator() | ( | int | i, | |
int | j, | |||
int | k, | |||
int | l | |||
) | [inline] |
Accesses element (i,j,k,l)
of the array.
Definition at line 261 of file Array4D.h.
References Array4D< T >::pArray.
Number of elements in the array's first dimension.
Definition at line 50 of file Array4D.h.
Referenced by Array4D< T >::allocate(), Array4D< T >::Array4D(), Array4D< T >::deallocate(), Array4D< T >::dim1(), Array4D< T >::operator=(), and Array4D< T >::size().
Number of elements in the array's second dimension.
Definition at line 57 of file Array4D.h.
Referenced by Array4D< T >::allocate(), Array4D< T >::Array4D(), Array4D< T >::deallocate(), Array4D< T >::dim2(), Array4D< T >::operator=(), and Array4D< T >::size().
Number of elements in the array's third dimension.
Definition at line 64 of file Array4D.h.
Referenced by Array4D< T >::allocate(), Array4D< T >::Array4D(), Array4D< T >::deallocate(), Array4D< T >::dim3(), Array4D< T >::operator=(), and Array4D< T >::size().
Number of elements in the array's fourth dimension.
Definition at line 71 of file Array4D.h.
Referenced by Array4D< T >::allocate(), Array4D< T >::Array4D(), Array4D< T >::dim4(), and Array4D< T >::operator=().
Array containing the data.
Definition at line 79 of file Array4D.h.
Referenced by Array4D< T >::allocate(), Array4D< T >::array(), Array4D< T >::Array4D(), Array4D< T >::deallocate(), Array4D< T >::operator()(), and Array4D< T >::operator=().