Loading...
Searching...
No Matches
casacore::IPosition_global_functions_IPosition_Indexing Struct Reference
casa package (libcasa_casa) » Arrays_module

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.
long long | toOffsetInArray (const IPosition &iposition, const IPosition &shape)
| Convert from IPosition to offset in an array.
bool | isInsideArray (const long long offset, const IPosition &shape)
| Determine if the given offset or IPosition is inside the array.
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 535 of file IPosition.h.

## Member Function Documentation

## isInsideArray() [1/2]

bool casacore::IPosition_global_functions_IPosition_Indexing::isInsideArray | ( | const IPosition & | iposition,
|  | const IPosition & | shape )

References casacore::shape().

## isInsideArray() [2/2]

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

- ArrayConformanceError: If all the IPositions are not the same length

References casacore::offset(), and casacore::shape().

## toIPositionInArray()

IPosition casacore::IPosition_global_functions_IPosition_Indexing::toIPositionInArray | ( | long long | offset,
|  | const IPosition & | shape )

Convert from offset to IPosition in an array.

References casacore::offset(), and casacore::shape().

## toOffsetInArray()

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

Convert from IPosition to offset in an array.

References casacore::shape().

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

- casa/Arrays/IPosition.h