#include <MultiDimArrayAccess.h>
Public Methods | |
MultiDimArrayIndexRange (const size_t *sz=((size_t *) 0), const int *st=((int *) 0), bool reverse=false) | |
Constructor for setting index data using size and initial values. More... | |
MultiDimArrayIndexRange (const int *si, const int *sf, bool reverse=false) | |
Constructor for setting index data to a range. More... | |
MultiDimArrayIndexRange (const size_t *sz=((size_t *) 0), const int *st=((int *) 0), bool reverse=false) | |
Constructor for setting index data using size and initial values. More... | |
MultiDimArrayIndexRange (const int *si, const int *sf, bool reverse=false) | |
Constructor for setting index data to a range. More... | |
Functions to set indices | |
void | setSizeAndStart (const size_t *sz=((size_t *) 0), const int *st=((int *) 0), bool reverse=false) |
void | setInclusiveRange (const int first[DIM], const int final[DIM], bool reverse=false) |
void | reverseDim () |
Reverse the ordering of the dimensions. More... | |
const MultiDimArrayIndexRange & | adjustDim (int d, int first, int final) |
Adjust the dimensions. More... | |
Functions to facilitate looping | |
int | beg (size_t i) const |
Give starting index. More... | |
int | end (size_t i) const |
Give ending index (one more than the last valid index). More... | |
size_t | size (size_t i) const |
Give size. More... | |
Functions computing offsets | |
int | offset (int i0) const |
Offset for a 1D array (not for use with any other type arrays). More... | |
int | offset (int i0, int i1) const |
Offset for a 2D array (not for use with any other type arrays). More... | |
int | offset (int i0, int i1, int i2) const |
Offset for a 3D array (not for use with any other type arrays). More... | |
int | offset (int i0, int i1, int i2, int i3) const |
Offset for a 4D array (not for use with any other type arrays). More... | |
Functions to set indices | |
void | setSizeAndStart (const size_t *sz=((size_t *) 0), const int *st=((int *) 0), bool reverse=false) |
void | setInclusiveRange (const int first[DIM], const int final[DIM], bool reverse=false) |
void | reverseDim () |
Reverse the ordering of the dimensions. More... | |
const MultiDimArrayIndexRange & | adjustDim (int d, int first, int final) |
Adjust the dimensions. More... | |
Functions to facilitate looping | |
int | beg (size_t i) const |
Give starting index. More... | |
int | end (size_t i) const |
Give ending index (one more than the last valid index). More... | |
size_t | size (size_t i) const |
Give size. More... | |
Functions computing offsets | |
int | offset (int i0) const |
Offset for a 1D array (not for use with any other type arrays). More... | |
int | offset (int i0, int i1) const |
Offset for a 2D array (not for use with any other type arrays). More... | |
int | offset (int i0, int i1, int i2) const |
Offset for a 3D array (not for use with any other type arrays). More... | |
int | offset (int i0, int i1, int i2, int i3) const |
Offset for a 4D array (not for use with any other type arrays). More... | |
Protected Attributes | |
int | d_start [DIM] |
Array of starting indices. More... | |
size_t | d_size [DIM] |
Array of sizes. More... | |
Friends | |
IO functions | |
ostream & | operator<< (ostream &os, const MultiDimArrayIndexRange< DIM > &r) |
Output to ostream. More... | |
istream & | operator<< (istream &is, MultiDimArrayIndexRange< DIM > &r) |
Input from istream. More... | |
IO functions | |
ostream & | operator<< (ostream &os, const MultiDimArrayIndexRange< DIM > &r) |
Output to ostream. More... | |
istream & | operator<< (istream &is, MultiDimArrayIndexRange< DIM > &r) |
Input from istream. More... |
The member functions should all be inlined for better performance.
Definition at line 15 of file MultiDimArrayAccess.h.
|
Constructor for setting index data using size and initial values.
Any pointers that are NULL are not used. The resulting default settings are:
Definition at line 38 of file MultiDimArrayAccess.h. References d_size, d_start, and reverseDim(). |
|
Constructor for setting index data to a range.
Any pointers that are NULL are not used. The resulting default settings are:
int* arguments, for the initial and final indices. It does not support default arguments until after the indices argument. NOTE: the place of the initial indices is different than it is for the constructor taking sizes instead of final indices.
If
Definition at line 68 of file MultiDimArrayAccess.h. References d_size, d_start, and reverseDim(). |
|
Constructor for setting index data using size and initial values.
Any pointers that are NULL are not used. The resulting default settings are:
Definition at line 38 of file MultiDimArrayAccess.h. References d_size, d_start, and reverseDim(). |
|
Constructor for setting index data to a range.
Any pointers that are NULL are not used. The resulting default settings are:
int* arguments, for the initial and final indices. It does not support default arguments until after the indices argument. NOTE: the place of the initial indices is different than it is for the constructor taking sizes instead of final indices.
If
Definition at line 68 of file MultiDimArrayAccess.h. References d_size, d_start, and reverseDim(). |
|
Adjust the dimensions.
Adjust the first and final indices. Set the dimension to adjust to < 0 or >= DIM to adjust all dimensions. Note: The third argument is the increment to the final index and not the size. Note: No error checking is done, for example, to make sure that the resulting size is non-negative.
Definition at line 153 of file MultiDimArrayAccess.h. |
|
Adjust the dimensions.
Adjust the first and final indices. Set the dimension to adjust to < 0 or >= DIM to adjust all dimensions. Note: The third argument is the increment to the final index and not the size. Note: No error checking is done, for example, to make sure that the resulting size is non-negative.
Definition at line 153 of file MultiDimArrayAccess.h. References d_size, and d_start. Referenced by ConstMultiDimArrayAccess::adjustDim(), MultiDimArrayAccess::adjustDim(), and reverseDim(). |
|
Give starting index.
Definition at line 203 of file MultiDimArrayAccess.h. References d_start. |
|
Give starting index.
Definition at line 203 of file MultiDimArrayAccess.h. References d_start. Referenced by ConstMultiDimArrayAccess::beg(), and MultiDimArrayAccess::beg(). |
|
Give ending index (one more than the last valid index).
Definition at line 208 of file MultiDimArrayAccess.h. |
|
Give ending index (one more than the last valid index).
Definition at line 208 of file MultiDimArrayAccess.h. References d_size, and d_start. Referenced by ConstMultiDimArrayAccess::end(), and MultiDimArrayAccess::end(). |
|
Offset for a 4D array (not for use with any other type arrays).
Definition at line 248 of file MultiDimArrayAccess.h. |
|
Offset for a 3D array (not for use with any other type arrays).
Definition at line 239 of file MultiDimArrayAccess.h. |
|
Offset for a 2D array (not for use with any other type arrays).
Definition at line 231 of file MultiDimArrayAccess.h. |
|
Offset for a 1D array (not for use with any other type arrays).
Definition at line 224 of file MultiDimArrayAccess.h. References d_start. |
|
Offset for a 4D array (not for use with any other type arrays).
Definition at line 248 of file MultiDimArrayAccess.h. |
|
Offset for a 3D array (not for use with any other type arrays).
Definition at line 239 of file MultiDimArrayAccess.h. |
|
Offset for a 2D array (not for use with any other type arrays).
Definition at line 231 of file MultiDimArrayAccess.h. |
|
Offset for a 1D array (not for use with any other type arrays).
Definition at line 224 of file MultiDimArrayAccess.h. References d_start. Referenced by ConstMultiDimArrayAccess::operator()(), and MultiDimArrayAccess::operator()(). |
|
Reverse the ordering of the dimensions.
This tells the object that the indices you have set If you do this, you should also reverse your indices to the offset functions. Use this to accomodate Fortran ordering.
Example, the 2x3 arrays declared in C with Definition at line 131 of file MultiDimArrayAccess.h. |
|
Reverse the ordering of the dimensions.
This tells the object that the indices you have set If you do this, you should also reverse your indices to the offset functions. Use this to accomodate Fortran ordering.
Example, the 2x3 arrays declared in C with Definition at line 131 of file MultiDimArrayAccess.h. References adjustDim(), d_size, and d_start. Referenced by MultiDimArrayIndexRange(), ConstMultiDimArrayAccess::reverseDim(), MultiDimArrayAccess::reverseDim(), setInclusiveRange(), and setSizeAndStart(). |
|
Set first and final indices (inclusive).
Definition at line 100 of file MultiDimArrayAccess.h. References d_size, d_start, and reverseDim(). |
|
Set first and final indices (inclusive).
Definition at line 100 of file MultiDimArrayAccess.h. References d_size, d_start, and reverseDim(). |
|
Set size and starting indices.
Definition at line 86 of file MultiDimArrayAccess.h. References d_size, d_start, and reverseDim(). |
|
Set size and starting indices.
Definition at line 86 of file MultiDimArrayAccess.h. References d_size, d_start, and reverseDim(). Referenced by ConstMultiDimArrayAccess::ConstMultiDimArrayAccess(). |
|
Give size.
Definition at line 213 of file MultiDimArrayAccess.h. References d_size. |
|
Give size.
Definition at line 213 of file MultiDimArrayAccess.h. References d_size. Referenced by ConstMultiDimArrayAccess::size(), and MultiDimArrayAccess::size(). |
|
Input from istream.
Definition at line 188 of file MultiDimArrayAccess.h. |
|
Output to ostream.
Definition at line 179 of file MultiDimArrayAccess.h. |
|
Input from istream.
Definition at line 188 of file MultiDimArrayAccess.h. |
|
Output to ostream.
Definition at line 179 of file MultiDimArrayAccess.h. |
|
Array of sizes.
Definition at line 20 of file MultiDimArrayAccess.h. Referenced by adjustDim(), end(), MultiDimArrayIndexRange(), offset(), reverseDim(), setInclusiveRange(), setSizeAndStart(), and size(). |
|
Array of starting indices.
Definition at line 18 of file MultiDimArrayAccess.h. Referenced by adjustDim(), beg(), end(), MultiDimArrayIndexRange(), offset(), reverseDim(), setInclusiveRange(), and setSizeAndStart(). |