Construct from a shape and precalculate some values.
Copy constructor (copy semantics).
Assignment (copy semantics). "this" and "that" must either be conformant (same size) or "this" must be 0-length, in which case it will resize itself to be the same length as "that".
Index into the TSMShape. Indices are zero-based. If the preprocessor symbol AIPS_ARRAY_INDEX_CHECK is defined, "index" will be checked to ensure it is not out of bounds. If this check fails, an AipsError will be thrown.
The number of elements in this TSMShape. Since TSMShape objects use zero-based indexing, the maximum available index is nelements() - 1.
conform returns true if nelements() == other.nelements().
Calculate the offset for a given position.
Calculate the position for a given offset.
Calculate the increments when stepping through an array in a linear way. This can be used to update the array offset without recalculating it after each step. For example:
template<class T> Array<T> someFunc (const Array<T>& array, const IPosition& subArrayShape, const IPosition& subArrayStart) const { TSMShape TSM (array.shape()); IPosition offsetIncr = TSM.offsetIncrement (subArrayShape); Array<T> subArray(subArrayShape); Bool deleteMain; const T* mainData = array.getStorage (deleteMain); mainData += TSM.offset (subArrayStart) Bool deleteSub; T* subData = subArray.getStorage (deleteSub); for (uInt i=0; i<subArrayShape(2); i++) { for (uInt j=0; j<subArrayShape(1); j++) { for (uInt k=0; k<subArrayShape(0); k++) { *subData++ = *mainData++; } mainData += offsetIncr(1); } mainData += offSetIncr(2); } }