dlr::numeric::Array3D< Type > Class Template Reference

The Array3D class template represents a 3D array of arbitrary type. More...

#include <array3D.h>

Collaboration diagram for dlr::numeric::Array3D< Type >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Type value_type
 Typedef for value_type describes the contents of the array.
typedef Type * iterator
 Typedef for iterator type helps with standard library interface.
typedef const Type * const_iterator
 Typedef for const_iterator type helps with standard library interface.

Public Member Functions

 Array3D ()
 Default constructor initializes to zero size.
 Array3D (size_t shape0, size_t shape1, size_t shape2)
 Construct a shape0 x shape1 x shape2 array.
 Array3D (const std::string &inputString)
 Construct from an initialization string.
 Array3D (const Array3D< Type > &source)
 The copy constructor does a shallow copy.
 Array3D (size_t shape0, size_t shape1, size_t shape2, Type *const dataPtr)
 Construct an array around external data.
virtual ~Array3D ()
 Destroys the Array3D instance and deletes the internal data store if no remaining arrays point to it.
iterator begin ()
 Return begin() iterator for Standard Library algorithms.
const_iterator begin () const
 Return begin() const_iterator for Standard Library algorithms.
void clear ()
 Reset the array to zero size, abandoning all contents.
void checkDimension (size_t shape0, size_t shape1, size_t shape2) const
 Optionally throw an exception if the shape of *this is different than specified.
Array3D< Type > copy () const
 Allocates a new array and deep copies the contents of *this.
template<class Type2>
void copy (const Array3D< Type2 > &source)
 Deep copies the contents of source.
template<class Type2>
void copy (const Type2 *dataPtr)
 Copies elements from dataPtr.
Type * data ()
 Returns a pointer to the internal data store.
const Type * data () const
 This version of data(void) is appropriate for const Array2D, and returns a pointer-to-const.
Type * data (size_t index)
 Just like data(void), which is documented above, but returns a pointer to the (index)th element instead of the first element.
const Type * data (size_t index) const
 This version of data(size_t) is appropriate for const Array1D, and returns a pointer-to-const.
Type * data (size_t index0, size_t index1, size_t index2)
 Just like data(void), but returns a pointer to the element indexed by (index0, index1, index2).
const Type * data (size_t index0, size_t index1, size_t index2) const
 This version of data(size_t, size_t, size_t) is appropriate for const Array3D, and returns a pointer-to-const.
bool empty () const
 This member function returns true if the array instance contains no elements.
iterator end ()
 Return end() iterator for Standard Library algorithms.
const_iterator end () const
 Return end() const_iterator for Standard Library algorithms.
std::istream & readFromStream (std::istream &inputStream)
 This member function sets the value of the array from an input stream.
void reinit (size_t shape0, size_t shape1, size_t shape2)
 Changes the shape of the array and reallocates storage.
void reshape (int shape0, int shape1, int shape2)
 Changes the shape of the array.
Array1D< size_t > shape () const
 Returns a 3 element Array1D containing the dimension of *this along each axis.
size_t shape (size_t axis) const
 Returns the array dimension along the the axis indicated by index.
size_t shape0 () const
 Returns the array dimension along axis 0.
size_t shape1 () const
 Returns the array dimension along axis 1.
size_t shape2 () const
 Returns the array dimension along axis 2.
size_t size () const
 Returns the number of elements in the array.
Array2D< Type > slice (size_t index)
 Returns an Array2D<Type> which addresses an entire (rows x columns) slice of *this.
const Array2D< Type > slice (size_t index) const
 Returns a const Array2D<Type> which addresses an entire (rows x columns) slice of *this.
Array3D< Type > & operator= (const Array3D< Type > &source)
 Assignment operator shallow copies the contents of source.
Array3D< Type > & operator= (Type value)
 Assign value to every element in the array.
Type & operator() (size_t index)
 Returns the (index)th element of the array by reference.
Type operator() (size_t index) const
 Returns the (index)th element of the array by value.
Type & operator() (size_t index0, size_t index1, size_t index2)
 Returns one element of the array by reference.
Type operator() (size_t index0, size_t index1, size_t index2) const
 Returns one element of the array by value.
Type & operator[] (size_t index)
 Returns the (index)th element of the array by reference.
Type operator[] (size_t index) const
 Returns the (index)th element of the array by value.
template<class Type2>
Array3D< Type > & operator *= (const Array3D< Type2 > &arg)
 Multiplies each element of *this by the value of the corresponding element of arg.
template<class Type2>
Array3D< Type > & operator/= (const Array3D< Type2 > &arg)
 Divides each element of *this by the value of the corresponding element of arg.
template<class Type2>
Array3D< Type > & operator+= (const Array3D< Type2 > &arg)
 Increments each element of *this by the value of the corresponding element of arg.
template<class Type2>
Array3D< Type > & operator-= (const Array3D< Type2 > &arg)
 Decrements each element of *this by the value of the corresponding element of arg.
Array3D< Type > & operator+= (const Type arg)
 Increments each element of *this by a constant.
Array3D< Type > & operator-= (const Type arg)
 Decrements each element of *this by a constant.
Array3D< Type > & operator *= (const Type arg)
 Multiplies each element of *this by a constant.
Array3D< Type > & operator/= (const Type arg)
 Divides each element of *this by a constant.

Detailed Description

template<class Type>
class dlr::numeric::Array3D< Type >

The Array3D class template represents a 3D array of arbitrary type.

This class has internal reference counting.

IMPORTANT: This class does _shallow_ copies by default. If you type:

array1 = array2;

then array1 and array2 point to the same data. To do a deep copy, type

array1.copy(array2);

or

array1 = array2.copy();

The advantage of the first form is that it doesn't involve allocating memory. The advantage of the second form is that there's no error if array1 and array2 have different shapes.

Definition at line 50 of file array3D.h.


Member Typedef Documentation

template<class Type>
typedef Type dlr::numeric::Array3D< Type >::value_type

Typedef for value_type describes the contents of the array.

Definition at line 57 of file array3D.h.

template<class Type>
typedef Type* dlr::numeric::Array3D< Type >::iterator

Typedef for iterator type helps with standard library interface.

Definition at line 62 of file array3D.h.

template<class Type>
typedef const Type* dlr::numeric::Array3D< Type >::const_iterator

Typedef for const_iterator type helps with standard library interface.

Definition at line 68 of file array3D.h.


Constructor & Destructor Documentation

template<class Type>
dlr::numeric::Array3D< Type >::Array3D (  )  [inline]

Default constructor initializes to zero size.

Definition at line 1102 of file array3D.h.

template<class Type>
dlr::numeric::Array3D< Type >::Array3D ( size_t  shape0,
size_t  shape1,
size_t  shape2 
) [inline]

Construct a shape0 x shape1 x shape2 array.

The dimensions are arranged from most minor to most major. If you like to think of the 3D array as being composed of 2D slices, you might want to create the array like this:

Array3D<Type> myArray(numSlices, numRows, numColumns);

In this way, stepping through the allocated data from beginning to end will traverse the first row of the first slice, followed subsequent rows of the first slice, followed by the first row of the second slice, and so on.

Parameters:
shape0 Number of elements in the first dimension of the array.
shape1 Number of elements in the second dimension of the array.
shape2 Number of elements in the third dimension of the array.

Definition at line 1118 of file array3D.h.

template<class Type>
dlr::numeric::Array3D< Type >::Array3D ( const std::string &  inputString  )  [inline, explicit]

Construct from an initialization string.

The idea is to make constructor very flexible about interpreting string syntax. For now, though, the input string must have the format:

"[[[#, #, #, ...], [#, #, #, ...], [#, #, #, ...], ...], [[#, #, #, ...], [#, #, #, ...], [#, #, #, ...], ...], [[#, #, #, ...], [#, #, #, ...], [#, #, #, ...], ...], ...]"

Where "#" indicates text which can be converted to the element type of the array using the stream input operator.

Parameters:
inputString The argument specifies the string from which the array will be constructed.

Definition at line 1135 of file array3D.h.

References DLR_THROW3.

template<class Type>
dlr::numeric::Array3D< Type >::Array3D ( const Array3D< Type > &  source  )  [inline]

The copy constructor does a shallow copy.

The newly created array points to the same data as copied array.

Parameters:
source Array which is to be copied.

Definition at line 1169 of file array3D.h.

template<class Type>
dlr::numeric::Array3D< Type >::Array3D ( size_t  shape0,
size_t  shape1,
size_t  shape2,
Type *const   dataPtr 
) [inline]

Construct an array around external data.

Arrays constructed in this way will not implement reference counting, and will not delete dataPtr when done. The elements of the array are traversed with axis 0 being the most major axis and axis 2 being the most minor axis. That is, the first element in the C style array is at index (0, 0, 0), the second is at (0, 0, 1), followed by (0, 0, 2), (0, 0, 3), ..., (0, 0, N), (0, 1, 0), (0, 1, 1), and so on.

Parameters:
shape0 Number of elements in the first dimension of the array.
shape1 Number of elements in the second dimension of the array.
shape2 Number of elements in the third dimension of the array.
dataPtr A C-style array of Type into which the newly constructed Array3D should index.

Definition at line 1189 of file array3D.h.

template<class Type>
dlr::numeric::Array3D< Type >::~Array3D (  )  [inline, virtual]

Destroys the Array3D instance and deletes the internal data store if no remaining arrays point to it.

Definition at line 1205 of file array3D.h.


Member Function Documentation

template<class Type>
iterator dlr::numeric::Array3D< Type >::begin (  )  [inline]

Return begin() iterator for Standard Library algorithms.

Returns:
Iterator pointing to the first element of the Array3D.

Definition at line 153 of file array3D.h.

Referenced by dlr::numeric::operator *(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator==(), dlr::numeric::operator>(), dlr::numeric::operator>=(), and dlr::numeric::Array3D< Type >::readFromStream().

template<class Type>
const_iterator dlr::numeric::Array3D< Type >::begin (  )  const [inline]

Return begin() const_iterator for Standard Library algorithms.

Returns:
Const iterator pointing to the first element of the array3D.

Definition at line 162 of file array3D.h.

template<class Type>
void dlr::numeric::Array3D< Type >::clear (  )  [inline]

Reset the array to zero size, abandoning all contents.

This is equivalent to this->reinit(0, 0, 0);

Definition at line 169 of file array3D.h.

References dlr::numeric::Array3D< Type >::reinit().

template<class Type>
void dlr::numeric::Array3D< Type >::checkDimension ( size_t  shape0,
size_t  shape1,
size_t  shape2 
) const [inline]

Optionally throw an exception if the shape of *this is different than specified.

Parameters:
shape0 The required size along the first dimension.
shape1 The required size along the second dimension.
shape2 The required size along the third dimension.

Definition at line 1213 of file array3D.h.

References DLR_THROW, dlr::numeric::Array3D< Type >::shape0(), dlr::numeric::Array3D< Type >::shape1(), and dlr::numeric::Array3D< Type >::shape2().

Referenced by dlr::numeric::operator==().

template<class Type>
Array3D< Type > dlr::numeric::Array3D< Type >::copy (  )  const [inline]

Allocates a new array and deep copies the contents of *this.

Returns:
A new array which is a (deep) copy of *this.

Definition at line 1234 of file array3D.h.

References dlr::numeric::Array3D< Type >::copy().

Referenced by dlr::numeric::Array3D< Type >::copy().

template<class Type>
template<class Type2>
void dlr::numeric::Array3D< Type >::copy ( const Array3D< Type2 > &  source  )  [inline]

Deep copies the contents of source.

It is an error if source does not have the same size as *this. Note that source need not have exactly the same number of rows and columns as *this, as long as their product is right.

Parameters:
source The array to be copied.

Definition at line 1244 of file array3D.h.

References dlr::numeric::Array3D< Type >::copy(), dlr::numeric::Array3D< Type >::data(), DLR_THROW3, and dlr::numeric::Array3D< Type >::size().

template<class Type>
template<class Type2>
void dlr::numeric::Array3D< Type >::copy ( const Type2 *  dataPtr  )  [inline]

Copies elements from dataPtr.

There must be valid data at all addresses from dataPtr to (dataPtr + this->size());

Parameters:
dataPtr Pointer to the data to be copied.

Definition at line 1262 of file array3D.h.

References DLR_THROW.

template<class Type>
Type* dlr::numeric::Array3D< Type >::data ( void   )  [inline]

Returns a pointer to the internal data store.

This is ugly but often necessary for interfacing with external libraries. Data is stored contiguously in raster order. The first element corresponds to indices (0, 0, 0), the second to (0, 0, 1), the (shape2 + 1)th element corresponds to index (0, 1, 0), and so on.

Returns:
Pointer to the internal data store.

Definition at line 227 of file array3D.h.

Referenced by dlr::numeric::Array3D< Type >::copy(), dlr::numeric::Array3D< Type >::operator *=(), dlr::numeric::Array3D< Type >::operator+=(), dlr::numeric::Array3D< Type >::operator-=(), and dlr::numeric::Array3D< Type >::operator/=().

template<class Type>
const Type* dlr::numeric::Array3D< Type >::data ( void   )  const [inline]

This version of data(void) is appropriate for const Array2D, and returns a pointer-to-const.

Returns:
Const pointer to the internal data store.

Definition at line 236 of file array3D.h.

template<class Type>
Type* dlr::numeric::Array3D< Type >::data ( size_t  index  )  [inline]

Just like data(void), which is documented above, but returns a pointer to the (index)th element instead of the first element.

Note that "data(index)" is synonymous with "data() + index" .

Parameters:
index Indicates to which element of the array the return value should point.
Returns:
pointer to the (index)th element of the array.

Definition at line 248 of file array3D.h.

template<class Type>
const Type* dlr::numeric::Array3D< Type >::data ( size_t  index  )  const [inline]

This version of data(size_t) is appropriate for const Array1D, and returns a pointer-to-const.

Parameters:
index Indicates to which element of the array the return value should point.
Returns:
Const pointer to the (index)th element of the array.

Definition at line 262 of file array3D.h.

template<class Type>
Type* dlr::numeric::Array3D< Type >::data ( size_t  index0,
size_t  index1,
size_t  index2 
) [inline]

Just like data(void), but returns a pointer to the element indexed by (index0, index1, index2).

Parameters:
index0 First index of selected element.
index1 Second index of selected element.
index2 Third index of selected element.
Returns:
Pointer to the selected element of the array.

Definition at line 277 of file array3D.h.

template<class Type>
const Type* dlr::numeric::Array3D< Type >::data ( size_t  index0,
size_t  index1,
size_t  index2 
) const [inline]

This version of data(size_t, size_t, size_t) is appropriate for const Array3D, and returns a pointer-to-const.

Parameters:
index0 First index of selected element.
index1 Second index of selected element.
index2 Third index of selected element.
Returns:
Pointer to the selected element of the array.

Definition at line 293 of file array3D.h.

template<class Type>
bool dlr::numeric::Array3D< Type >::empty (  )  const [inline]

This member function returns true if the array instance contains no elements.

It has complexity O(1).

Returns:
The return value indicates whether or not the array is empty.

Definition at line 308 of file array3D.h.

References dlr::numeric::Array3D< Type >::size().

template<class Type>
iterator dlr::numeric::Array3D< Type >::end (  )  [inline]

Return end() iterator for Standard Library algorithms.

Returns:
Iterator pointing just past the last element of the array3D.

Definition at line 318 of file array3D.h.

Referenced by dlr::numeric::operator *(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator==(), dlr::numeric::operator>(), dlr::numeric::operator>=(), and dlr::numeric::Array3D< Type >::readFromStream().

template<class Type>
const_iterator dlr::numeric::Array3D< Type >::end (  )  const [inline]

Return end() const_iterator for Standard Library algorithms.

Returns:
Const iterator pointing just past the last element of the array3D.

Definition at line 327 of file array3D.h.

template<class Type>
std::istream & dlr::numeric::Array3D< Type >::readFromStream ( std::istream &  inputStream  )  [inline]

This member function sets the value of the array from an input stream.

The array is modified only if the read was successful, otherwise the array is not modified, and failbit is set in the stream state. Because of this nice behavior, readFromStream is quite slow.

Parameters:
inputStream This is the stream from which to read the array.
Returns:
The return value is a reference to inputStream.

Definition at line 1277 of file array3D.h.

References dlr::numeric::Array3D< Type >::begin(), dlr::numeric::Array2D< Type >::clear(), dlr::numeric::Array3D< Type >::end(), dlr::numeric::Array3D< Type >::reinit(), dlr::numeric::Array3D< Type >::shape0(), dlr::numeric::Array3D< Type >::shape1(), and dlr::numeric::Array3D< Type >::shape2().

Referenced by dlr::numeric::operator>>().

template<class Type>
void dlr::numeric::Array3D< Type >::reinit ( size_t  shape0,
size_t  shape1,
size_t  shape2 
) [inline]

Changes the shape of the array and reallocates storage.

The current array contents are lost. After a successful call to reinit(), the array will have shape0 x shape1 x shape2 elements.

Parameters:
shape0 Requested dimension along axis 0.
shape1 Requested dimension along axis 1.
shape2 Requested dimension along axis 2.

Definition at line 1370 of file array3D.h.

Referenced by dlr::numeric::Array3D< Type >::clear(), and dlr::numeric::Array3D< Type >::readFromStream().

template<class Type>
void dlr::numeric::Array3D< Type >::reshape ( int  shape0,
int  shape1,
int  shape2 
) [inline]

Changes the shape of the array.

It is an error if shape0 * shape1 * shape2 is not equal to this->size(). Any one argument may be specified as -1, but no more than one. If one of the arguments is -1, its value will be calculated based on the total size of the array and the value of the other arguments.

Parameters:
shape0 Requested dimension along axis 0.
shape1 Requested dimension along axis 1.
shape2 Requested dimension along axis 2.

Definition at line 1382 of file array3D.h.

References DLR_THROW, and dlr::numeric::Array3D< Type >::size().

template<class Type>
Array1D< size_t > dlr::numeric::Array3D< Type >::shape (  )  const [inline]

Returns a 3 element Array1D containing the dimension of *this along each axis.

That is, the first element of the returned array will be this->shape0(), the second element will be this->shape1(), and the third element will be this->shape2().

Returns:
Array describing the shape of *this.

Definition at line 1412 of file array3D.h.

References dlr::numeric::Array3D< Type >::shape0(), dlr::numeric::Array3D< Type >::shape1(), and dlr::numeric::Array3D< Type >::shape2().

template<class Type>
size_t dlr::numeric::Array3D< Type >::shape ( size_t  axis  )  const [inline]

Returns the array dimension along the the axis indicated by index.

This is synonymous with shape()[axis], but may execute faster.

Parameters:
axis Selected axis.
Returns:
Dimension along the selected axis.

Definition at line 1424 of file array3D.h.

References DLR_THROW, dlr::numeric::Array3D< Type >::shape0(), dlr::numeric::Array3D< Type >::shape1(), and dlr::numeric::Array3D< Type >::shape2().

template<class Type>
size_t dlr::numeric::Array3D< Type >::shape0 (  )  const [inline]

Returns the array dimension along axis 0.

This is synonymous with shape(0), but may execute faster.

Returns:
Number of elements.

Definition at line 398 of file array3D.h.

Referenced by dlr::numeric::Array3D< Type >::checkDimension(), dlr::numeric::operator *(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator==(), dlr::numeric::operator>(), dlr::numeric::operator>=(), dlr::numeric::Array3D< Type >::readFromStream(), dlr::numeric::Array3D< Type >::shape(), and dlr::numeric::shapeMatch().

template<class Type>
size_t dlr::numeric::Array3D< Type >::shape1 (  )  const [inline]

Returns the array dimension along axis 1.

This is synonymous with shape(1), but may execute faster.

Returns:
Number of elements.

Definition at line 407 of file array3D.h.

Referenced by dlr::numeric::Array3D< Type >::checkDimension(), dlr::numeric::operator *(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator==(), dlr::numeric::operator>(), dlr::numeric::operator>=(), dlr::numeric::Array3D< Type >::readFromStream(), dlr::numeric::Array3D< Type >::shape(), and dlr::numeric::shapeMatch().

template<class Type>
size_t dlr::numeric::Array3D< Type >::shape2 (  )  const [inline]

Returns the array dimension along axis 2.

This is synonymous with shape(2), but may execute faster.

Returns:
Number of elements.

Definition at line 416 of file array3D.h.

Referenced by dlr::numeric::Array3D< Type >::checkDimension(), dlr::numeric::operator *(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator==(), dlr::numeric::operator>(), dlr::numeric::operator>=(), dlr::numeric::Array3D< Type >::readFromStream(), dlr::numeric::Array3D< Type >::shape(), and dlr::numeric::shapeMatch().

template<class Type>
size_t dlr::numeric::Array3D< Type >::size (  )  const [inline]

Returns the number of elements in the array.

This is the equal to the product of the elements of this->shape().

Returns:
Number of elements.

Definition at line 425 of file array3D.h.

Referenced by dlr::numeric::Array3D< Type >::copy(), dlr::numeric::Array3D< Type >::empty(), dlr::numeric::Array3D< Type >::operator *=(), dlr::numeric::Array3D< Type >::operator+=(), dlr::numeric::Array3D< Type >::operator-=(), dlr::numeric::Array3D< Type >::operator/=(), and dlr::numeric::Array3D< Type >::reshape().

template<class Type>
Array2D< Type > dlr::numeric::Array3D< Type >::slice ( size_t  index  )  [inline]

Returns an Array2D<Type> which addresses an entire (rows x columns) slice of *this.

The returned Array2D references the same data as the selected slice of *this.

Parameters:
index Specifies which slice to reference.
Returns:
An Array2D instance referencing the selected slice.

Definition at line 1450 of file array3D.h.

template<class Type>
const Array2D< Type > dlr::numeric::Array3D< Type >::slice ( size_t  index  )  const [inline]

Returns a const Array2D<Type> which addresses an entire (rows x columns) slice of *this.

The returned Array2D references the same data as the selected slice of *this.

Parameters:
index Specifies which slice to reference.
Returns:
An Array2D instance referencing the selected slice.

Definition at line 1461 of file array3D.h.

template<class Type>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator= ( const Array3D< Type > &  source  )  [inline]

Assignment operator shallow copies the contents of source.

After the copy, both arrays reference the same data.

Parameters:
source The Array3D instance to be copied.
Returns:
Reference to *this.

Definition at line 1471 of file array3D.h.

References dlr::numeric::Array3D< Type >::m_dataPtr, dlr::numeric::Array3D< Type >::m_isAllocated, dlr::numeric::Array3D< Type >::m_refCountPtr, dlr::numeric::Array3D< Type >::m_shape0, dlr::numeric::Array3D< Type >::m_shape1, dlr::numeric::Array3D< Type >::m_shape1Times2, dlr::numeric::Array3D< Type >::m_shape2, and dlr::numeric::Array3D< Type >::m_size.

template<class Type>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator= ( Type  value  )  [inline]

Assign value to every element in the array.

Parameters:
value The value to be copied.
Returns:
Reference to *this.

Definition at line 1494 of file array3D.h.

template<class Type>
Type& dlr::numeric::Array3D< Type >::operator() ( size_t  index  )  [inline]

Returns the (index)th element of the array by reference.

Synonymous with operator()(size_t).

Parameters:
index Indicates the selected element.
Returns:
Reference to the (index)th element of the array.

Definition at line 476 of file array3D.h.

Referenced by dlr::numeric::Array3D< Type >::operator[]().

template<class Type>
Type dlr::numeric::Array3D< Type >::operator() ( size_t  index  )  const [inline]

Returns the (index)th element of the array by value.

Synonymous with operator()(size_t) const.

Parameters:
index Indicates the selected element.
Returns:
Value of the (index)th element of the array.

Definition at line 489 of file array3D.h.

template<class Type>
Type& dlr::numeric::Array3D< Type >::operator() ( size_t  index0,
size_t  index1,
size_t  index2 
) [inline]

Returns one element of the array by reference.

Elements are indexed as described in the documentation of Array3D::Array3D(size_t, size_t, size_t).

Parameters:
index0 Indicates the position of the selected element along the first axis.
index1 Indicates the position of the selected element along the third axis.
index2 Indicates the position of the selected element along the third axis.
Returns:
Reference to the selected element of the array.

Definition at line 508 of file array3D.h.

template<class Type>
Type dlr::numeric::Array3D< Type >::operator() ( size_t  index0,
size_t  index1,
size_t  index2 
) const [inline]

Returns one element of the array by value.

Elements are indexed as described in the documentation of Array3D::Array3D(size_t, size_t, size_t).

Parameters:
index0 Indicates the position of the selected element along the first axis.
index1 Indicates the position of the selected element along the third axis.
index2 Indicates the position of the selected element along the third axis.
Returns:
Value of the selected element of the array.

Definition at line 528 of file array3D.h.

template<class Type>
Type& dlr::numeric::Array3D< Type >::operator[] ( size_t  index  )  [inline]

Returns the (index)th element of the array by reference.

Synonymous with operator()(size_t).

Parameters:
index Indicates the selected element.
Returns:
Reference to the (index)th element of the array.

Definition at line 542 of file array3D.h.

References dlr::numeric::Array3D< Type >::operator()().

template<class Type>
Type dlr::numeric::Array3D< Type >::operator[] ( size_t  index  )  const [inline]

Returns the (index)th element of the array by value.

Synonymous with operator()(size_t) const.

Parameters:
index Indicates the selected element.
Returns:
Value of the (index)th element of the array.

Definition at line 552 of file array3D.h.

References dlr::numeric::Array3D< Type >::operator()().

template<class Type>
template<class Type2>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator *= ( const Array3D< Type2 > &  arg  )  [inline]

Multiplies each element of *this by the value of the corresponding element of arg.

Parameters:
arg Array3D of values to be added to the elements of *this.
Returns:
Reference to *this.

Definition at line 1503 of file array3D.h.

References dlr::numeric::Array3D< Type >::data(), DLR_THROW, and dlr::numeric::Array3D< Type >::size().

template<class Type>
template<class Type2>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator/= ( const Array3D< Type2 > &  arg  )  [inline]

Divides each element of *this by the value of the corresponding element of arg.

Parameters:
arg Array3D of values to be added to the elements of *this.
Returns:
Reference to *this.

Definition at line 1521 of file array3D.h.

References dlr::numeric::Array3D< Type >::data(), DLR_THROW, and dlr::numeric::Array3D< Type >::size().

template<class Type>
template<class Type2>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator+= ( const Array3D< Type2 > &  arg  )  [inline]

Increments each element of *this by the value of the corresponding element of arg.

Parameters:
arg Array3D of values to be added to the elements of *this.
Returns:
Reference to *this.

Definition at line 1539 of file array3D.h.

References dlr::numeric::Array3D< Type >::data(), DLR_THROW, and dlr::numeric::Array3D< Type >::size().

template<class Type>
template<class Type2>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator-= ( const Array3D< Type2 > &  arg  )  [inline]

Decrements each element of *this by the value of the corresponding element of arg.

Parameters:
arg Array3D of values to be subtracted from the elements of *this.
Returns:
Reference to *this.

Definition at line 1557 of file array3D.h.

References dlr::numeric::Array3D< Type >::data(), DLR_THROW, and dlr::numeric::Array3D< Type >::size().

template<class Type>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator+= ( const Type  arg  )  [inline]

Increments each element of *this by a constant.

Parameters:
arg Value by which array elements will be incremented.
Returns:
Reference to *this.

Definition at line 1575 of file array3D.h.

template<class Type>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator-= ( const Type  arg  )  [inline]

Decrements each element of *this by a constant.

Parameters:
arg Value by which array elements will be decremented.
Returns:
Reference to *this.

Definition at line 1585 of file array3D.h.

template<class Type>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator *= ( const Type  arg  )  [inline]

Multiplies each element of *this by a constant.

Parameters:
arg Value by which array elements will be multiplied.
Returns:
Reference to *this.

Definition at line 1595 of file array3D.h.

template<class Type>
Array3D< Type > & dlr::numeric::Array3D< Type >::operator/= ( const Type  arg  )  [inline]

Divides each element of *this by a constant.

Parameters:
arg Value by which array elements will be divided.
Returns:
Reference to *this.

Definition at line 1605 of file array3D.h.


The documentation for this class was generated from the following file:
Generated on Mon Jul 9 20:34:21 2007 for dlrLibs Utility Libraries by  doxygen 1.5.2