#include <array3D.h>
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 arrayShape0, size_t arrayShape1, size_t arrayShape2) | |
Construct an arrayShape0 x arrayShape1 x arrayShape2 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 arrayShape0, size_t arrayShape1, size_t arrayShape2, 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 arrayShape0, size_t arrayShape1, size_t arrayShape2) 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. | |
Type | getElement (size_t index0) const |
This member function returns a specific element of the array by value. | |
Type | getElement (size_t index0, size_t index1, size_t index2) const |
This member function returns a specific element of the array by value. | |
std::istream & | readFromStream (std::istream &inputStream) |
This member function sets the value of the array from an input stream. | |
void | reinit (size_t arrayShape0, size_t arrayShape1, size_t arrayShape2) |
Changes the shape of the array and reallocates storage. | |
void | reinitIfNecessary (size_t arrayShape0, size_t arrayShape1, size_t arrayShape2) |
Behaves just like member function reinit() unless *this already has the requested shape, in which case this member function does nothing, or *this has the requested size (but a different shape), in which case this member function behaves just like member function resize(). | |
void | reshape (int arrayShape0, int arrayShape1, int arrayShape2) |
Changes the shape of the array. | |
Type & | setElement (size_t index0, const Type &value) |
This member function sets the value of a specific element of the array. | |
Type & | setElement (size_t index0, size_t index1, size_t index2, const Type &value) |
This member function sets the value of a specific element 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. |
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.
typedef const Type* dlr::numeric::Array3D< Type >::const_iterator |
typedef Type* dlr::numeric::Array3D< Type >::iterator |
typedef Type dlr::numeric::Array3D< Type >::value_type |
dlr::numeric::Array3D< Type >::Array3D | ( | ) | [inline] |
dlr::numeric::Array3D< Type >::Array3D | ( | size_t | arrayShape0, | |
size_t | arrayShape1, | |||
size_t | arrayShape2 | |||
) | [inline] |
Construct an arrayShape0 x arrayShape1 x arrayShape2 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.
arrayShape0 | Number of elements in the first dimension of the array. | |
arrayShape1 | Number of elements in the second dimension of the array. | |
arrayShape2 | Number of elements in the third dimension of the array. |
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.
inputString | The argument specifies the string from which the array will be constructed. |
dlr::numeric::Array3D< Type >::Array3D | ( | const Array3D< Type > & | source | ) | [inline] |
dlr::numeric::Array3D< Type >::Array3D | ( | size_t | arrayShape0, | |
size_t | arrayShape1, | |||
size_t | arrayShape2, | |||
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.
arrayShape0 | Number of elements in the first dimension of the array. | |
arrayShape1 | Number of elements in the second dimension of the array. | |
arrayShape2 | 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. |
dlr::numeric::Array3D< Type >::~Array3D | ( | ) | [inline, virtual] |
const_iterator dlr::numeric::Array3D< Type >::begin | ( | ) | const [inline] |
iterator dlr::numeric::Array3D< Type >::begin | ( | ) | [inline] |
Return begin() iterator for Standard Library algorithms.
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().
void dlr::numeric::Array3D< Type >::checkDimension | ( | size_t | arrayShape0, | |
size_t | arrayShape1, | |||
size_t | arrayShape2 | |||
) | const [inline] |
Optionally throw an exception if the shape of *this is different than specified.
arrayShape0 | The required size along the first dimension. | |
arrayShape1 | The required size along the second dimension. | |
arrayShape2 | The required size along the third dimension. |
Definition at line 1312 of file array3D.h.
References dlr::numeric::Array3D< Type >::shape0(), dlr::numeric::Array3D< Type >::shape1(), and dlr::numeric::Array3D< Type >::shape2().
Referenced by dlr::numeric::operator==().
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().
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());
dataPtr | Pointer to the data to be copied. |
Definition at line 1361 of file array3D.h.
References dlr::numeric::Array3D< Type >::copy().
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.
source | The array to be copied. |
Definition at line 1343 of file array3D.h.
References dlr::numeric::Array3D< Type >::copy(), dlr::numeric::Array3D< Type >::data(), and dlr::numeric::Array3D< Type >::size().
Array3D< Type > dlr::numeric::Array3D< Type >::copy | ( | ) | const [inline] |
Allocates a new array and deep copies the contents of *this.
Definition at line 1333 of file array3D.h.
References dlr::numeric::Array3D< Type >::copy().
Referenced by dlr::numeric::Array3D< Type >::copy(), and dlr::numeric::Array3D< Type >::readFromStream().
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.
index0 | First index of selected element. | |
index1 | Second index of selected element. | |
index2 | Third index of selected element. |
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).
index0 | First index of selected element. | |
index1 | Second index of selected element. | |
index2 | Third index of selected element. |
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.
index | Indicates to which element of the array the return value should point. |
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" .
index | Indicates to which element of the array the return value should point. |
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.
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.
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/=().
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).
Definition at line 308 of file array3D.h.
References dlr::numeric::Array3D< Type >::size().
const_iterator dlr::numeric::Array3D< Type >::end | ( | ) | const [inline] |
iterator dlr::numeric::Array3D< Type >::end | ( | ) | [inline] |
Return end() iterator for Standard Library algorithms.
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().
Type dlr::numeric::Array3D< Type >::getElement | ( | size_t | index0, | |
size_t | index1, | |||
size_t | index2 | |||
) | const [inline] |
This member function returns a specific element of the array by value.
index0 | This argument, and the next two, specify which element value should be returned. | |
index1 | This argument, the previous, and the next, specify which element value should be returned. | |
index2 | This argument, and the previous two, specify which element value should be returned. |
Definition at line 359 of file array3D.h.
References dlr::numeric::Array3D< Type >::operator()().
Type dlr::numeric::Array3D< Type >::getElement | ( | size_t | index0 | ) | const [inline] |
This member function returns a specific element of the array by value.
index0 | This argument specifies which element value should be returned. |
Definition at line 340 of file array3D.h.
References dlr::numeric::Array3D< Type >::operator()().
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).
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. |
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).
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. |
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.
index | Indicates the selected element. |
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).
index | Indicates the selected element. |
Definition at line 575 of file array3D.h.
Referenced by dlr::numeric::Array3D< Type >::getElement(), dlr::numeric::Array3D< Type >::operator[](), and dlr::numeric::Array3D< Type >::setElement().
Array3D< Type > & dlr::numeric::Array3D< Type >::operator*= | ( | const Type | arg | ) | [inline] |
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.
arg | Array3D of values to be added to the elements of *this. |
Definition at line 1618 of file array3D.h.
References dlr::numeric::Array3D< Type >::data(), and dlr::numeric::Array3D< Type >::size().
Array3D< Type > & dlr::numeric::Array3D< Type >::operator+= | ( | const Type | arg | ) | [inline] |
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.
arg | Array3D of values to be added to the elements of *this. |
Definition at line 1654 of file array3D.h.
References dlr::numeric::Array3D< Type >::data(), and dlr::numeric::Array3D< Type >::size().
Array3D< Type > & dlr::numeric::Array3D< Type >::operator-= | ( | const Type | arg | ) | [inline] |
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.
arg | Array3D of values to be subtracted from the elements of *this. |
Definition at line 1672 of file array3D.h.
References dlr::numeric::Array3D< Type >::data(), and dlr::numeric::Array3D< Type >::size().
Array3D< Type > & dlr::numeric::Array3D< Type >::operator/= | ( | const Type | arg | ) | [inline] |
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.
arg | Array3D of values to be added to the elements of *this. |
Definition at line 1636 of file array3D.h.
References dlr::numeric::Array3D< Type >::data(), and dlr::numeric::Array3D< Type >::size().
Array3D< Type > & dlr::numeric::Array3D< Type >::operator= | ( | Type | value | ) | [inline] |
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.
source | The Array3D instance to be copied. |
Definition at line 1586 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.
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.
index | Indicates the selected element. |
Definition at line 651 of file array3D.h.
References dlr::numeric::Array3D< Type >::operator()().
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).
index | Indicates the selected element. |
Definition at line 641 of file array3D.h.
References dlr::numeric::Array3D< Type >::operator()().
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.
inputStream | This is the stream from which to read the array. |
Definition at line 1376 of file array3D.h.
References dlr::numeric::Array3D< Type >::begin(), dlr::numeric::Array2D< Type >::clear(), dlr::numeric::Array3D< Type >::copy(), dlr::numeric::Array3D< Type >::end(), and dlr::numeric::Array3D< Type >::reinit().
Referenced by dlr::numeric::operator>>().
void dlr::numeric::Array3D< Type >::reinit | ( | size_t | arrayShape0, | |
size_t | arrayShape1, | |||
size_t | arrayShape2 | |||
) | [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 arrayShape0 x arrayShape1 x arrayShape2 elements.
arrayShape0 | Requested dimension along axis 0. | |
arrayShape1 | Requested dimension along axis 1. | |
arrayShape2 | Requested dimension along axis 2. |
Definition at line 1469 of file array3D.h.
Referenced by dlr::numeric::Array3D< Type >::clear(), dlr::numeric::Array3D< Type >::readFromStream(), and dlr::numeric::Array3D< Type >::reinitIfNecessary().
void dlr::numeric::Array3D< Type >::reinitIfNecessary | ( | size_t | arrayShape0, | |
size_t | arrayShape1, | |||
size_t | arrayShape2 | |||
) | [inline] |
Behaves just like member function reinit() unless *this already has the requested shape, in which case this member function does nothing, or *this has the requested size (but a different shape), in which case this member function behaves just like member function resize().
arrayShape0 | Requested dimension along axis 0. | |
arrayShape1 | Requested dimension along axis 1. | |
arrayShape2 | Requested dimension along axis 2. |
Definition at line 1481 of file array3D.h.
References dlr::numeric::Array3D< Type >::reinit(), dlr::numeric::Array3D< Type >::reshape(), dlr::numeric::Array3D< Type >::shape0(), dlr::numeric::Array3D< Type >::shape1(), and dlr::numeric::Array3D< Type >::size().
void dlr::numeric::Array3D< Type >::reshape | ( | int | arrayShape0, | |
int | arrayShape1, | |||
int | arrayShape2 | |||
) | [inline] |
Changes the shape of the array.
It is an error if arrayShape0 * arrayShape1 * arrayShape2 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.
arrayShape0 | Requested dimension along axis 0. | |
arrayShape1 | Requested dimension along axis 1. | |
arrayShape2 | Requested dimension along axis 2. |
Definition at line 1497 of file array3D.h.
References dlr::numeric::Array3D< Type >::size().
Referenced by dlr::numeric::Array3D< Type >::reinitIfNecessary().
Type& dlr::numeric::Array3D< Type >::setElement | ( | size_t | index0, | |
size_t | index1, | |||
size_t | index2, | |||
const Type & | value | |||
) | [inline] |
This member function sets the value of a specific element of the array.
index0 | This argument, and the next two, specify which element value should be set. | |
index1 | This argument, the previous, and the next, specify which element value should be set. | |
index2 | This argument, and the previous two, specify which element value should be set. | |
value | This argument will be copied into the selected array element. |
Definition at line 462 of file array3D.h.
References dlr::numeric::Array3D< Type >::operator()().
Type& dlr::numeric::Array3D< Type >::setElement | ( | size_t | index0, | |
const Type & | value | |||
) | [inline] |
This member function sets the value of a specific element of the array.
index0 | This argument specifies which element value should be set. | |
value | This argument will be copied into the selected array element. |
Definition at line 437 of file array3D.h.
References dlr::numeric::Array3D< Type >::operator()().
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.
axis | Selected axis. |
Definition at line 1539 of file array3D.h.
References dlr::numeric::Array3D< Type >::shape0(), dlr::numeric::Array3D< Type >::shape1(), and dlr::numeric::Array3D< Type >::shape2().
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().
Definition at line 1527 of file array3D.h.
References dlr::numeric::Array3D< Type >::shape0(), dlr::numeric::Array3D< Type >::shape1(), and dlr::numeric::Array3D< Type >::shape2().
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.
Definition at line 497 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 >::reinitIfNecessary(), and dlr::numeric::Array3D< Type >::shape().
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.
Definition at line 506 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 >::reinitIfNecessary(), and dlr::numeric::Array3D< Type >::shape().
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.
Definition at line 515 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>=(), and dlr::numeric::Array3D< Type >::shape().
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().
Definition at line 524 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/=(), dlr::numeric::Array3D< Type >::reinitIfNecessary(), and dlr::numeric::Array3D< Type >::reshape().
const Array2D< Type > dlr::numeric::Array3D< Type >::slice | ( | size_t | index | ) | const [inline] |
Array2D< Type > dlr::numeric::Array3D< Type >::slice | ( | size_t | index | ) | [inline] |