Array3D< T > Class Template Reference

A 3-dimensional template for making arrays. More...

#include <Array3D.h>

List of all members.

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 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)
 Allocates memory for the array.
void deallocate ()
 Deallocates memory for the array.
void operator= (const Array3D &rhs)
 Sets two arrays equal.
void operator= (const T C)
 Sets all of the elements in an array equal to the same value.
 Array3D ()
 Creates an array.
 Array3D (int i, int j, int k)
 Creates an array and allocates memory.
 Array3D (const Array3D< T > &rhs)
 Creates an array and sets it equal to another array.
 ~Array3D ()
 Destroys the array and cleans up the memory.
T & operator() (int i, int j, int k)
 Accesses element (i,j,k) 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.
T *** pArray
 Array containing the data.

Friends

ostream & operator<< (ostream &strm, const Array3D< T > &rhs)


Detailed Description

template<class T>
class Array3D< T >

A 3-dimensional template for making arrays.

All of the memory allocation and deallocation details are dealt with by the class.

Definition at line 43 of file Array3D.h.


Constructor & Destructor Documentation

template<class T>
Array3D< T >::Array3D (  )  [inline]

Creates an array.

Definition at line 182 of file Array3D.h.

template<class T>
Array3D< T >::Array3D ( int  i,
int  j,
int  k 
) [inline]

Creates an array and allocates memory.

Parameters:
i size of the array's first dimension.
j size of the array's second dimension.
k size of the array's third dimension.

Definition at line 191 of file Array3D.h.

template<class T>
Array3D< T >::Array3D ( const Array3D< T > &  rhs  )  [inline]

Creates an array and sets it equal to another array.

Parameters:
rhs array to set this array equal to.

Definition at line 199 of file Array3D.h.

template<class T>
Array3D< T >::~Array3D (  )  [inline]

Destroys the array and cleans up the memory.

Definition at line 216 of file Array3D.h.


Member Function Documentation

template<class T>
int Array3D< T >::dim1 (  )  [inline]

Gets the number of elements in the array's first dimension.

Returns:
number of elements in the array's first dimension.

Definition at line 73 of file Array3D.h.

Referenced by QMCMikesBetterWalkerInitialization::FindBestWalker(), QMCMikesBetterWalkerInitialization::GradObjectiveFunctionForWalkers(), and QMCMikesBetterWalkerInitialization::ObjectiveFunctionForWalkers().

template<class T>
int Array3D< T >::dim2 (  )  [inline]

Gets the number of elements in the array's second dimension.

Returns:
number of elements in the array's second dimension.

Definition at line 80 of file Array3D.h.

template<class T>
int Array3D< T >::dim3 (  )  [inline]

Gets the number of elements in the array's third dimension.

Returns:
number of elements in the array's third dimension.

Definition at line 87 of file Array3D.h.

Referenced by QMCMikesBetterWalkerInitialization::FindBestWalker(), QMCMikesBetterWalkerInitialization::GradObjectiveFunctionForWalkers(), and QMCMikesBetterWalkerInitialization::ObjectiveFunctionForWalkers().

template<class T>
int Array3D< T >::size (  )  [inline]

Gets the total number of elements in the array.

Returns:
total number of elements in the array.

Definition at line 94 of file Array3D.h.

template<class T>
T*** Array3D< T >::array (  )  [inline]

Gets a pointer to an array containing the array elements.

The ordering of this array is NOT specified.

Definition at line 100 of file Array3D.h.

Referenced by QMCSCFJastrow::calculate_CIDerivatives(), QMCSlater::calculate_DerivativeRatios(), QMCSCFJastrow::calculate_OrbitalDerivatives(), and QMCSCFJastrow::update_SCF().

template<class T>
void Array3D< T >::allocate ( int  i,
int  j,
int  k 
) [inline]

Allocates memory for the array.

Parameters:
i size of the array's first dimension.
j size of the array's second dimension.
k size of the array's third dimension.

Definition at line 109 of file Array3D.h.

Referenced by Array3D< double >::Array3D(), QMCWalkerData::initialize(), and Array3D< double >::operator=().

template<class T>
void Array3D< T >::deallocate (  )  [inline]

Deallocates memory for the array.

Definition at line 138 of file Array3D.h.

Referenced by Array3D< double >::allocate(), and Array3D< double >::~Array3D().

template<class T>
void Array3D< T >::operator= ( const Array3D< T > &  rhs  )  [inline]

Sets two arrays equal.

Definition at line 156 of file Array3D.h.

template<class T>
void Array3D< T >::operator= ( const T  C  )  [inline]

Sets all of the elements in an array equal to the same value.

Definition at line 171 of file Array3D.h.

template<class T>
T& Array3D< T >::operator() ( int  i,
int  j,
int  k 
) [inline]

Accesses element (i,j,k) of the array.

Definition at line 221 of file Array3D.h.


Friends And Related Function Documentation

template<class T>
ostream& operator<< ( ostream &  strm,
const Array3D< T > &  rhs 
) [friend]

Definition at line 223 of file Array3D.h.


Member Data Documentation

template<class T>
int Array3D< T >::n_1 [private]

template<class T>
int Array3D< T >::n_2 [private]

template<class T>
int Array3D< T >::n_3 [private]

template<class T>
T*** Array3D< T >::pArray [private]


The documentation for this class was generated from the following file:

Generated on Sat Jul 5 16:14:00 2008 for QMcBeaver by  doxygen 1.5.6