casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::IPosition_global_functions_IPosition_Indexing Struct Reference

Indexing functions for IPosition's Convert between IPosition and offset in an array. More...

#include <IPosition.h>

Public Member Functions

IPosition toIPositionInArray (long long offset, const IPosition &shape)
 Convert from offset to IPosition in an array. More...
 
long long toOffsetInArray (const IPosition &iposition, const IPosition &shape)
 Convert from IPosition to offset in an array. More...
 
bool isInsideArray (const long long offset, const IPosition &shape)
 Determine if the given offset or IPosition is inside the array. More...
 
bool isInsideArray (const IPosition &iposition, const IPosition &shape)
 

Detailed Description

Indexing functions for IPosition's Convert between IPosition and offset in an array.

The offset of an element in an array is the number of elements from the origin that the element would be if the array were arranged linearly. The origin of the array has an offset equal to 0, while the "top right corner" of the array has an offset equal to one less than the total number of elements in the array.

Two examples of offset would be the index in a carray and the seek position in a file.

Definition at line 537 of file IPosition.h.

Member Function Documentation

bool casacore::IPosition_global_functions_IPosition_Indexing::isInsideArray ( const long long  offset,
const IPosition shape 
)

Determine if the given offset or IPosition is inside the array.

Returns true if it is inside the Array.

Thrown Exceptions

bool casacore::IPosition_global_functions_IPosition_Indexing::isInsideArray ( const IPosition iposition,
const IPosition shape 
)
IPosition casacore::IPosition_global_functions_IPosition_Indexing::toIPositionInArray ( long long  offset,
const IPosition shape 
)

Convert from offset to IPosition in an array.

long long casacore::IPosition_global_functions_IPosition_Indexing::toOffsetInArray ( const IPosition iposition,
const IPosition shape 
)

Convert from IPosition to offset in an array.


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