CArray3< T > Class Template Reference
List of all members.
Detailed Description
template<class T>
class CArray3< T >
template class Array3 (three dimensional)
Definition at line 22 of file Array3.h.
|
Public Member Functions |
| CArray3 () |
| CArray3 (INT dim1, INT dim2, INT dim3) |
| CArray3 (T *p_array, INT dim1, INT dim2, INT dim3, bool p_free_array=true, bool p_copy_array=false) |
| CArray3 (const T *p_array, INT dim1, INT dim2, INT dim3) |
| ~CArray3 () |
void | set_name (const char *p_name) |
void | get_array_size (INT &dim1, INT &dim2, INT &dim3) |
INT | get_dim1 () |
INT | get_dim2 () |
INT | get_dim3 () |
void | zero () |
T * | get_array () |
void | set_array (T *p_array, INT dim1, INT dim2, INT dim3, bool p_free_array, bool copy_array=false) |
bool | resize_array (INT dim1, INT dim2, INT dim3) |
T | get_element (INT idx1, INT idx2, INT idx3) const |
bool | set_element (T p_element, INT idx1, INT idx2, INT idx3) |
const T & | element (INT idx1, INT idx2, INT idx3) const |
T & | element (INT idx1, INT idx2, INT idx3) |
T & | element (T *p_array, INT idx1, INT idx2, INT idx3) |
T & | element (T *p_array, INT idx1, INT idx2, INT idx3, INT p_dim1_size, INT p_dim2_size) |
CArray3< T > & | operator= (const CArray3< T > &orig) |
void | display_size () const |
void | display_array () const |
const char * | get_name () const |
INT | get_array_size () const |
const T & | get_element (INT index) const |
bool | set_element (const T &p_element, INT index) |
const T & | element (INT idx1) const |
T & | element (INT index) |
T & | element (T *p_array, INT index) |
bool | resize_array (INT n) |
void | set_array (T *p_array, INT p_array_size, bool p_free_array=true, bool copy_array=false) |
void | set_array (const T *p_array, INT p_array_size) |
void | clear_array () |
const T & | operator[] (INT index) const |
T & | operator[] (INT index) |
Static Public Attributes |
static CParallel | parallel |
static CIO | io |
static CVersion | version |
Protected Attributes |
INT | dim1_size |
INT | dim2_size |
INT | dim3_size |
T * | array |
INT | array_size |
bool | free_array |
const char * | name |
| DECLARE_ARRAY_STATISTICS |
Constructor & Destructor Documentation
default constructor
Definition at line 26 of file Array3.h.
constructor
- Parameters:
-
| dim1 | dimension 1 |
| dim2 | dimension 2 |
| dim3 | dimension 3 |
Definition at line 37 of file Array3.h.
template<class T>
CArray3< T >::CArray3 |
( |
T * |
p_array, |
|
|
INT |
dim1, |
|
|
INT |
dim2, |
|
|
INT |
dim3, |
|
|
bool |
p_free_array = true , |
|
|
bool |
p_copy_array = false | |
|
) |
| | |
constructor
- Parameters:
-
| p_array | another array |
| dim1 | dimension 1 |
| dim2 | dimension 2 |
| dim3 | dimension 3 |
| p_free_array | if array must be freed |
| p_copy_array | if array must be copied |
Definition at line 51 of file Array3.h.
constructor
- Parameters:
-
| p_array | another array |
| dim1 | dimension 1 |
| dim2 | dimension 2 |
| dim3 | dimension 3 |
Definition at line 66 of file Array3.h.
Member Function Documentation
template<class T>
void CArray3< T >::set_name |
( |
const char * |
p_name |
) |
|
return total array size (including granularity buffer)
- Parameters:
-
| dim1 | dimension 1 will be stored here |
| dim2 | dimension 2 will be stored here |
| dim3 | dimension 3 will be stored here |
Definition at line 89 of file Array3.h.
get dimension 2
- Returns:
- dimension 2
Definition at line 106 of file Array3.h.
get dimension 3
- Returns:
- dimension 3
Definition at line 112 of file Array3.h.
get the array call get_array just before messing with it DO NOT call any [],resize/delete functions after get_array(), the pointer may become invalid !
- Returns:
- the array
Reimplemented from CArray< T >.
Definition at line 125 of file Array3.h.
template<class T>
void CArray3< T >::set_array |
( |
T * |
p_array, |
|
|
INT |
dim1, |
|
|
INT |
dim2, |
|
|
INT |
dim3, |
|
|
bool |
p_free_array, |
|
|
bool |
copy_array = false | |
|
) |
| | |
set the array pointer and free previously allocated memory
- Parameters:
-
| p_array | another array |
| dim1 | dimension 1 |
| dim2 | dimensino 2 |
| dim3 | dimensino 3 |
| p_free_array | if array must be freed |
| copy_array | if array must be copied |
Definition at line 136 of file Array3.h.
resize array
- Parameters:
-
| dim1 | new dimension 1 |
| dim2 | new dimension 2 |
| dim3 | new dimension 3 |
- Returns:
- if resizing was successful
Definition at line 151 of file Array3.h.
get array element at index
- Parameters:
-
| idx1 | index 1 |
| idx2 | index 2 |
| idx3 | index 3 |
- Returns:
- array element at index
Definition at line 166 of file Array3.h.
set array element at index 'index'
- Parameters:
-
| p_element | array element |
| idx1 | index 1 |
| idx2 | index 2 |
| idx3 | index 3 |
- Returns:
- if setting was successful
Definition at line 182 of file Array3.h.
get array element at index
- Parameters:
-
| idx1 | index 1 |
| idx2 | index 2 |
| idx3 | index 3 |
- Returns:
- array element at index
Definition at line 197 of file Array3.h.
get array element at index
- Parameters:
-
| idx1 | index 1 |
| idx2 | index 2 |
| idx3 | index 3 |
- Returns:
- array element at index
Definition at line 212 of file Array3.h.
get element of given array at given index
- Parameters:
-
| p_array | another array |
| idx1 | index 1 |
| idx2 | index 2 |
| idx3 | index 3 |
- Returns:
- array element at index
Definition at line 228 of file Array3.h.
get element of given array at given index
- Parameters:
-
| p_array | another array |
| idx1 | index 1 |
| idx2 | index 2 |
| idx3 | index 3 |
| p_dim1_size | size of dimension 1 |
| p_dim2_size | size of dimension 2 |
- Returns:
- element of given array at given index
Definition at line 247 of file Array3.h.
operator overload for array assignment
- Parameters:
-
- Returns:
- new array
Definition at line 263 of file Array3.h.
template<class T>
void CArray3< T >::display_size |
( |
|
) |
const |
template<class T>
void CArray3< T >::display_array |
( |
|
) |
const |
template<class T>
const char* CArray< T >::get_name |
( |
|
) |
const [inherited] |
get name
- Returns:
- name
Definition at line 130 of file Array.h.
template<class T>
INT CArray< T >::get_array_size |
( |
|
) |
const [inherited] |
get array size (including granularity buffer)
- Returns:
- total array size
Definition at line 148 of file Array.h.
template<class T>
const T& CArray< T >::get_element |
( |
INT |
index |
) |
const [inherited] |
get array element at index
- Parameters:
-
- Returns:
- array element at index
Definition at line 174 of file Array.h.
template<class T>
bool CArray< T >::set_element |
( |
const T & |
p_element, |
|
|
INT |
index | |
|
) |
| | [inherited] |
set array element at index 'index' return false in case of trouble
- Parameters:
-
| p_element | array element to set |
| index | index |
- Returns:
- if setting was successful
Definition at line 187 of file Array.h.
template<class T>
const T& CArray< T >::element |
( |
INT |
idx1 |
) |
const [inherited] |
get element at given index
- Parameters:
-
- Returns:
- element at given index
Definition at line 200 of file Array.h.
template<class T>
T& CArray< T >::element |
( |
INT |
index |
) |
[inherited] |
get element at given index
- Parameters:
-
- Returns:
- element at given index
Definition at line 211 of file Array.h.
template<class T>
T& CArray< T >::element |
( |
T * |
p_array, |
|
|
INT |
index | |
|
) |
| | [inherited] |
get element of given array at given index
- Parameters:
-
| p_array | another array |
| index | index |
- Returns:
- element of given array at given index
Definition at line 226 of file Array.h.
template<class T>
bool CArray< T >::resize_array |
( |
INT |
n |
) |
[inherited] |
resize array
- Parameters:
-
- Returns:
- if resizing was successful
Definition at line 239 of file Array.h.
template<class T>
void CArray< T >::set_array |
( |
T * |
p_array, |
|
|
INT |
p_array_size, |
|
|
bool |
p_free_array = true , |
|
|
bool |
copy_array = false | |
|
) |
| | [inherited] |
set the array pointer and free previously allocated memory
- Parameters:
-
| p_array | another array |
| p_array_size | size of another array |
| p_free_array | if array must be freed |
| copy_array | if array must be copied |
Definition at line 273 of file Array.h.
template<class T>
void CArray< T >::set_array |
( |
const T * |
p_array, |
|
|
INT |
p_array_size | |
|
) |
| | [inherited] |
set the array pointer and free previously allocated memory
- Parameters:
-
| p_array | another array |
| p_array_size | size of another array |
Definition at line 295 of file Array.h.
template<class T>
void CArray< T >::clear_array |
( |
|
) |
[inherited] |
clear the array (with zeros)
Definition at line 306 of file Array.h.
template<class T>
const T& CArray< T >::operator[] |
( |
INT |
index |
) |
const [inherited] |
operator overload for array read only access use set_element() for write access (will also make the array dynamically grow)
DOES NOT DO ANY BOUNDS CHECKING
- Parameters:
-
- Returns:
- element at index
Definition at line 320 of file Array.h.
template<class T>
T& CArray< T >::operator[] |
( |
INT |
index |
) |
[inherited] |
operator overload for array read only access
DOES NOT DO ANY BOUNDS CHECKING
- Parameters:
-
- Returns:
- element at index
Definition at line 333 of file Array.h.
Member Data Documentation
size of array's dimension 1
Definition at line 297 of file Array3.h.
size of array's dimension 2
Definition at line 299 of file Array3.h.
size of array's dimension 3
Definition at line 301 of file Array3.h.
memory for dynamic array
Definition at line 370 of file Array.h.
the number of potentially used elements in array
Definition at line 372 of file Array.h.
if array must be freed
Definition at line 374 of file Array.h.
template<class T>
const char* CArray< T >::name [protected, inherited] |
array's name
Definition at line 376 of file Array.h.
array statistics
Definition at line 378 of file Array.h.
The documentation for this class was generated from the following file: