Loading...
Searching...
No Matches
casacore::IPosition Class Reference
casa package (libcasa_casa) » Arrays_module

More...

`#include <IPosition.h>`

## Public Types

typedef ssize_t | value_type
| Define the STL-style iterators.
typedef ssize_t * | iterator
typedef const ssize_t * | const_iterator
typedef value_type * | pointer
typedef const value_type * | const_pointer
typedef value_type & | reference
typedef const value_type & | const_reference
typedef size_t | size_type
typedef ptrdiff_t | difference_type

## Public Member Functions

| IPosition () noexcept
| A zero-length IPosition.
| IPosition (size_t length)
| An IPosition of size "length." The values in the object are uninitialized.
| IPosition (std::initializer_list< ssize_t > list)
| An IPosition initialized from the given list.
| IPosition (size_t length, ssize_t val)
| An IPosition of size "length." All values in the object are initialized to val.
template<typename... Vals>
| IPosition (size_t, ssize_t val1, ssize_t val2, Vals... vals)
| An IPosition initialized from a variable number of parameters.
| IPosition (const IPosition &source)
| Makes a copy (copy, NOT reference, semantics) of source.
| IPosition (IPosition &&source) noexcept
| ~IPosition ()
IPosition & | operator= (const IPosition &source)
| Makes this a copy of other.
IPosition & | operator= (IPosition &&source)
IPosition & | operator= (ssize_t value)
| Copy "value" into every position of this IPosition.
| IPosition (const Array< int > &other)
| Convert an IPosition to and from an Array<int/int64>.
| IPosition (const Array< long long > &other)
Vector< int > | asVector () const
Vector< long long > | asVector64 () const
| IPosition (const std::vector< int > &other)
| Convert an IPosition to and from an Array<int/int64>.
| IPosition (const std::vector< long long > &other)
std::vector< int > | asStdVector () const
std::vector< long long > | asStdVector64 () const
template<typename InputIterator>
void | fill (size_t size, InputIterator iter)
| Resize and fill this IPosition object.
template<typename OutputIterator>
void | copy (OutputIterator iter) const
| Copy the contents of this IPosition object to the output iterator.
IPosition | nonDegenerate (size_t startingAxis=0) const
| This member functions return an IPosition which has degenerate (length==1) axes removed and the dimensionality reduced appropriately.
IPosition | nonDegenerate (const IPosition &ignoreAxes) const
void | resize (size_t newSize, bool copy=true)
| Old values are copied on resize if copy==true.
ssize_t & | operator[] (size_t index)
| Index into the IPosition.
ssize_t | operator[] (size_t index) const
ssize_t & | operator() (size_t index)
ssize_t | operator() (size_t index) const
IPosition | operator() (const IPosition &axes) const
| Make an IPosition by using only the specified elements of the current IPosition.
ssize_t & | last (size_t index=0)
| Index into the IPosition from the end.
ssize_t | last (size_t index=0) const
const ssize_t * | storage () const
| Get the storage.
void | append (const IPosition &other)
| Append this IPosition with another one (causing a resize).
void | prepend (const IPosition &other)
| Prepend this IPosition with another one (causing a resize).
IPosition | concatenate (const IPosition &other) const
| Return an IPosition as the concetanation of this and another IPosition.
void | setFirst (const IPosition &other)
| Set the first values of this IPosition to another IPosition.
void | setLast (const IPosition &other)
| Set the last values of this IPosition to another IPosition.
IPosition | getFirst (size_t n) const
| Construct an IPosition from the first n values of this IPosition.
IPosition | getLast (size_t n) const
| Construct an IPosition from the last n values of this IPosition.
IPosition | removeAxes (const IPosition &axes) const
| Return an IPosition where the given axes are reoved.
IPosition | keepAxes (const IPosition &axes) const
| Return an IPosition containing the given axes only.
size_t | nelements () const
| The number of elements in this IPosition.
size_t | size () const
bool | empty () const
| Is the IPosition empty (i.e.
bool | conform (const IPosition &other) const
| conform returns true if nelements() == other.nelements().
void | operator+= (const IPosition &other)
| Element-by-element arithmetic.
void | operator-= (const IPosition &other)
void | operator*= (const IPosition &other)
void | operator/= (const IPosition &other)
void | operator+= (ssize_t val)
void | operator-= (ssize_t val)
void | operator*= (ssize_t val)
void | operator/= (ssize_t val)
long long | product () const
| Returns 0 if nelements() == 0, otherwise it returns the product of its elements.
bool | allOne () const
| Are all elements equal to 1?
bool | isEqual (const IPosition &other) const
| Element-by-element comparison for equality.
bool | isEqual (const IPosition &other, bool skipDegeneratedAxes) const
| Element-by-element comparison for equality.
bool | isEqual (const IPosition &other, size_t nrCompare) const
| Element-by-element comparison for (partial) equality.
bool | isSubSet (const IPosition &other) const
| Is the other IPosition a subset of (or equal to) this IPosition?
std::string | toString () const
| Write the IPosition into a string.
bool | ok () const
| Is this IPosition consistent?
iterator | begin ()
| Get the begin and end iterator object for this object.
const_iterator | begin () const
iterator | end ()
const_iterator | end () const

## Static Public Member Functions

template<typename... Vals>
static IPosition | Make (Vals... vals)
| Construct an IPosition that is initialized from a variable number of parameter.
static IPosition | makeAxisPath (size_t nrdim)
| Construct a default axis path consisting of the values 0.
static IPosition | makeAxisPath (size_t nrdim, const IPosition &partialPath)
| Construct a full axis path from a (partially) given axis path.
static IPosition | otherAxes (size_t nrdim, const IPosition &axes)
| Make a list of axes which are the axes not given in axes up to the given dimension.

## Private Types

enum | { BufferLength }

## Private Member Functions

void | allocateBuffer ()
| Allocate a buffer with length size_p.
void | throwIndexError () const
| Throw an index error exception.

## Private Attributes

size_t | size_p
ssize_t | buffer_p [BufferLength]
ssize_t * | data_p
| When the iposition is length BufferSize or less data is just buffer_p, avoiding calls to new and delete.

## Friends

class | IPositionComparator
std::ostream & | operator<< (std::ostream &os, const IPosition &ip)
| Write an IPosition to an ostream in a simple text form.

## Detailed Description

A Vector of integers, for indexing into Array<T> objects.

### Intended use:

Public interface

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25

### Etymology

IPosition is an Index Position in an n-dimensional array.

### Synopsis

IPosition is "logically" a Vector<int> constrained so that its origin is zero-based, and in fact that used to be the way it was implemented. It was split out into a separate class to make the inheritance from Arrays simpler (since Arrays use IPositions). The template instantiation mechanism is complicated enough that this simplification was felt to be a good idea.

IPosition objects are normally used to index into, and define the shapes of, multi-dimensional arrays. For example, if you have a 5 dimensional array, you need an IPosition of length 5 to index into the array (or to define its shape, etc.).

Unlike Vectors, IPositions always use copy semantics.

IPosition ip1(5); // An IPosition of length 5
ip1(0) = 11; ip1(1) = 5;... ip1(4) = 6; // Indices 0-based
IPosition ip2(ip1); // Copy constructor; a COPY
casacore::IPosition::IPosition
IPosition() noexcept
A zero-length IPosition.
Definition IPosition.h:556

Binary operations must take place either with a conformnat (same size) IPosition or with an integer, which behaves as if it was an IPosition of the same size (i.e., length). All the usual binary arithmetic operations are available, as well as logical operations, which return Booleans. These all operate "element-by-element".

All non-inlined member functions of IPosition check invariants if the preprocessor symbol AIPS_DEBUG is defined. That is, the member functions check that ok() is true (constructors check after construction, other functions on entry to the function). If these tests fail, an AipsError exception is thrown; its message contains the line number and source file of the failure (it is thrown by the lAssert macro defined in aips/Assert.h).

Constructors and functions exist to construct an IPosition directly from a Vector or std::vector object or to convert to it. Furthermore the fill and copy can be used to fill from or copy to any STL-type iterator.

### Example

IPosition blc(5), trc(5,1,2,3,4,5);
blc = 0; // OR IPosition blc(5,0);
//..\.
if (blc > trc) {
IPosition tmp;
tmp = trc; // Swap
trc = blc;
blc = tmp;
}
//..\.
trc += 5; // make the box 5 larger in all dimensions
std::vector<int> vec(trc.toStdVector());

Definition at line 116 of file IPosition.h.

## Member Typedef Documentation

## const_iterator

typedef const ssize_t* casacore::IPosition::const_iterator

Definition at line 405 of file IPosition.h.

## const_pointer

typedef const value_type* casacore::IPosition::const_pointer

Definition at line 407 of file IPosition.h.

## const_reference

typedef const value_type& casacore::IPosition::const_reference

Definition at line 409 of file IPosition.h.

## difference_type

typedef ptrdiff_t casacore::IPosition::difference_type

Definition at line 411 of file IPosition.h.

## iterator

typedef ssize_t* casacore::IPosition::iterator

Definition at line 404 of file IPosition.h.

## pointer

typedef value_type* casacore::IPosition::pointer

Definition at line 406 of file IPosition.h.

## reference

typedef value_type& casacore::IPosition::reference

Definition at line 408 of file IPosition.h.

## size_type

typedef size_t casacore::IPosition::size_type

Definition at line 410 of file IPosition.h.

## value_type

typedef ssize_t casacore::IPosition::value_type

Define the STL-style iterators.

It makes it possible to iterate through all data elements.

IPosition shp(2,0);
for (IPosition::iterator iter=shp.begin(); iter!=shp.end(); iter++) {
*iter += 1;
}
casacore::IPosition::iterator
ssize_t * iterator
Definition IPosition.h:404

STL-style typedefs.

Definition at line 403 of file IPosition.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

private

Enumerator
BufferLength |

Definition at line 433 of file IPosition.h.

## Constructor & Destructor Documentation

## IPosition() [1/11]

casacore::IPosition::IPosition | ( |  | ) |

inline noexcept

A zero-length IPosition.

Definition at line 556 of file IPosition.h.

References buffer_p, data_p, and size_p.

Referenced by append(), concatenate(), conform(), getFirst(), getLast(), IPosition(), IPosition(), IPosition(), IPosition(), IPosition(), IPosition(), isEqual(), isEqual(), isEqual(), isSubSet(), keepAxes(), Make(), makeAxisPath(), makeAxisPath(), nonDegenerate(), nonDegenerate(), operator()(), operator*=(), operator+=(), operator-=(), operator/=(), operator<<, operator=(), operator=(), operator=(), otherAxes(), prepend(), removeAxes(), setFirst(), and setLast().

## IPosition() [2/11]

casacore::IPosition::IPosition | ( | size_t | length | ) |

explicit

An IPosition of size "length." The values in the object are uninitialized.

References IPosition(), and casacore::length().

## IPosition() [3/11]

casacore::IPosition::IPosition | ( | std::initializer_list< ssize_t > | list | ) |

An IPosition initialized from the given list.

References IPosition().

## IPosition() [4/11]

casacore::IPosition::IPosition | ( | size_t | length,
|  | ssize_t | val )

An IPosition of size "length." All values in the object are initialized to val.

References IPosition(), and casacore::length().

## IPosition() [5/11]

template<typename... Vals>

casacore::IPosition::IPosition | ( | size_t | ,
|  | ssize_t | val1,
|  | ssize_t | val2,
|  | Vals... | vals )

inline

An IPosition initialized from a variable number of parameters.

The first parameter should specify the size, but the actual size of the resulting IPosition is determined from the number of parameters (the first argument is ignored).

This constructor should be disfavoured, because i) of the dummy parameter and ii) because it may narrow the specified parameter without a warning.

Instead, use an initializer list constructor whenever possible. If an IPosition is created inside a macro, an initializer list is not possible. In those cases, use the Make(Vals...) factory method. Both of those methods do not have the above issues. [[ deprecated("Use the initializer list constructor or Make() method") ]]

Definition at line 149 of file IPosition.h.

References IPosition().

## IPosition() [6/11]

casacore::IPosition::IPosition | ( | const IPosition & | source | ) |

Makes a copy (copy, NOT reference, semantics) of source.

References IPosition().

## IPosition() [7/11]

casacore::IPosition::IPosition | ( | IPosition && | source | ) |

noexcept

References IPosition().

## ~IPosition()

casacore::IPosition::~IPosition | ( |  | ) |

## IPosition() [8/11]

casacore::IPosition::IPosition | ( | const Array< int > & | other | ) |

Convert an IPosition to and from an Array<int/int64>.

In either case, the array must be one dimensional.

## IPosition() [9/11]

casacore::IPosition::IPosition | ( | const Array< long long > & | other | ) |

## IPosition() [10/11]

casacore::IPosition::IPosition | ( | const std::vector< int > & | other | ) |

Convert an IPosition to and from an Array<int/int64>.

In either case, the array must be one dimensional.

## IPosition() [11/11]

casacore::IPosition::IPosition | ( | const std::vector< long long > & | other | ) |

## Member Function Documentation

## allocateBuffer()

void casacore::IPosition::allocateBuffer | ( |  | ) |

private

Allocate a buffer with length size_p.

## allOne()

bool casacore::IPosition::allOne | ( |  | ) | const

Are all elements equal to 1?

Useful to check if a given stride is really a stride.

## append()

void casacore::IPosition::append | ( | const IPosition & | other | ) |

Append this IPosition with another one (causing a resize).

References IPosition().

Referenced by casacore::TableExprGroupAggr::getArray(), casacore::TableProxy::record2Array(), and casacore::TableExprNodeSet::toArray().

## asStdVector()

std::vector< int > casacore::IPosition::asStdVector | ( |  | ) | const

## asStdVector64()

std::vector< long long > casacore::IPosition::asStdVector64 | ( |  | ) | const

## asVector()

Vector< int > casacore::IPosition::asVector | ( |  | ) | const

## asVector64()

Vector< long long > casacore::IPosition::asVector64 | ( |  | ) | const

## begin() [1/2]

iterator casacore::IPosition::begin | ( |  | ) |

inline

Get the begin and end iterator object for this object.

Definition at line 415 of file IPosition.h.

References data_p.

## begin() [2/2]

const_iterator casacore::IPosition::begin | ( |  | ) | const

inline

Definition at line 417 of file IPosition.h.

References data_p.

## concatenate()

IPosition casacore::IPosition::concatenate | ( | const IPosition & | other | ) | const

Return an IPosition as the concetanation of this and another IPosition.

References IPosition().

Referenced by casacore::ScaledComplexData< VirtualType, StoredType >::storedShape().

## conform()

bool casacore::IPosition::conform | ( | const IPosition & | other | ) | const

inline

conform returns true if nelements() == other.nelements().

Definition at line 634 of file IPosition.h.

References IPosition(), and size_p.

## copy()

template<typename OutputIterator>

void casacore::IPosition::copy | ( | OutputIterator | iter | ) | const

inline

Copy the contents of this IPosition object to the output iterator.

The size of the output must be sufficient.

Definition at line 228 of file IPosition.h.

References data_p, and size_p.

Referenced by resize().

## empty()

bool casacore::IPosition::empty | ( |  | ) | const

inline

Is the IPosition empty (i.e.

no elements)?

Definition at line 574 of file IPosition.h.

References size_p.

## end() [1/2]

iterator casacore::IPosition::end | ( |  | ) |

inline

Definition at line 419 of file IPosition.h.

References data_p, and size_p.

## end() [2/2]

const_iterator casacore::IPosition::end | ( |  | ) | const

inline

Definition at line 421 of file IPosition.h.

References data_p, and size_p.

## fill()

template<typename InputIterator>

void casacore::IPosition::fill | ( | size_t | size,
|  | InputIterator | iter )

inline

Resize and fill this IPosition object.

Definition at line 217 of file IPosition.h.

References data_p, resize(), and size().

## getFirst()

IPosition casacore::IPosition::getFirst | ( | size_t | n | ) | const

Construct an IPosition from the first n values of this IPosition.

An exception is thrown if n is too high.

References IPosition().

## getLast()

IPosition casacore::IPosition::getLast | ( | size_t | n | ) | const

Construct an IPosition from the last n values of this IPosition.

An exception is thrown if n is too high.

References IPosition().

## isEqual() [1/3]

bool casacore::IPosition::isEqual | ( | const IPosition & | other | ) | const

Element-by-element comparison for equality.

It returns true if the lengths and all elements are equal.
Note that an important difference between this function and operator==() is that if the two IPositions have different lengths, this function returns false, instead of throwing an exception as operator==() does.

References IPosition().

Referenced by casacore::checkArrayShapes(), casacore::LatticeBase::conform(), and casacore::TableExprNodeSet::toArray().

## isEqual() [2/3]

bool casacore::IPosition::isEqual | ( | const IPosition & | other,
|  | bool | skipDegeneratedAxes ) const

Element-by-element comparison for equality.

It returns true if all elements are equal. When skipDegeneratedAxes is true, axes with length 1 are skipped in both operands.

References IPosition().

## isEqual() [3/3]

bool casacore::IPosition::isEqual | ( | const IPosition & | other,
|  | size_t | nrCompare ) const

Element-by-element comparison for (partial) equality.

It returns true if the lengths and the first nrCompare elements are equal.

References IPosition().

## isSubSet()

bool casacore::IPosition::isSubSet | ( | const IPosition & | other | ) | const

Is the other IPosition a subset of (or equal to) this IPosition?

It is a subset if zero or more axes of this IPosition do not occur or are degenerated in the other and if the remaining axes are in the same order.

References IPosition().

## keepAxes()

IPosition casacore::IPosition::keepAxes | ( | const IPosition & | axes | ) | const

Return an IPosition containing the given axes only.

References IPosition().

## last() [1/2]

ssize_t & casacore::IPosition::last | ( | size_t | index = 0 | ) |

inline

Index into the IPosition from the end.

By default the last value is returned. If the preprocessor symbol AIPS_ARRAY_INDEX_CHECK is defined, it will check if the index is not out of bounds.

Definition at line 609 of file IPosition.h.

References data_p, size_p, and throwIndexError().

## last() [2/2]

ssize_t casacore::IPosition::last | ( | size_t | index = 0 | ) | const

inline

Definition at line 619 of file IPosition.h.

References data_p, size_p, and throwIndexError().

## Make()

template<typename... Vals>

IPosition casacore::IPosition::Make | ( | Vals... | vals | ) |

inline static

Construct an IPosition that is initialized from a variable number of parameter.

The resulting size of the IPosition will equal the number of parameters specified.

In general, using the initializer list constructor should be preferred. Defining an initializer list inside macros is however not possible. In those cases, this method can be used to construct the IPosition.

Example: IPosition::Make(3, 5) creates an IPosition of size 2, with values 3 and 5. It is identical to IPosition{3, 5}. A program is ill-formed when narrowing of a parameter is required, causing a compiler warning or error.

Definition at line 170 of file IPosition.h.

References IPosition().

## makeAxisPath() [1/2]

IPosition casacore::IPosition::makeAxisPath | ( | size_t | nrdim | ) |

inline static

Construct a default axis path consisting of the values 0.

. nrdim-1.

Definition at line 561 of file IPosition.h.

References IPosition(), and makeAxisPath().

Referenced by makeAxisPath().

## makeAxisPath() [2/2]

IPosition casacore::IPosition::makeAxisPath | ( | size_t | nrdim,
|  | const IPosition & | partialPath )

static

Construct a full axis path from a (partially) given axis path.

It fills the path with the non-given axis. It is checked if the given axis path is valid (i.e. if the axis are < nrdim and if they are not doubly defined). E.g.: in the 4D case an axis path [0,2] is returned as [0,2,1,3].

References IPosition().

## nelements()

size_t casacore::IPosition::nelements | ( |  | ) | const

inline

The number of elements in this IPosition.

Since IPosition objects use zero-based indexing, the maximum available index is nelements() - 1.

Definition at line 566 of file IPosition.h.

References size_p.

Referenced by operator()(), operator()(), and casacore::TSMCube::setLastColSlice().

## nonDegenerate() [1/2]

IPosition casacore::IPosition::nonDegenerate | ( | const IPosition & | ignoreAxes | ) | const

References IPosition().

## nonDegenerate() [2/2]

IPosition casacore::IPosition::nonDegenerate | ( | size_t | startingAxis = 0 | ) | const

This member functions return an IPosition which has degenerate (length==1) axes removed and the dimensionality reduced appropriately.

Only axes greater than startingAxis are considered (normally one wants to remove trailing axes.
The functions with argument ignoreAxes do not consider the axes given in that argument.

References IPosition().

## ok()

bool casacore::IPosition::ok | ( |  | ) | const

Is this IPosition consistent?

## operator()() [1/3]

IPosition casacore::IPosition::operator() | ( | const IPosition & | axes | ) | const

Make an IPosition by using only the specified elements of the current IPosition.

All values of axes must be less than the number of elements of the current object.

### Example

IPosition ipos(4, 11, 12, 13, 14); ex1 is IPosition(3, 11, 12, 13); IPosition ex1 = ipos(IPosition(3,0,1,2); ex2 is IPosition(3, 12, 11) IPosition ex2 = ipos(IPosition(2,2,1); ex3 is IPosition(4,14,14,14,14) IPosition ex3 = ipos(IPosition(4,3,3,3,3);

References IPosition().

## operator()() [2/3]

ssize_t & casacore::IPosition::operator() | ( | size_t | index | ) |

inline

Definition at line 589 of file IPosition.h.

References data_p, nelements(), and throwIndexError().

## operator()() [3/3]

ssize_t casacore::IPosition::operator() | ( | size_t | index | ) | const

inline

Definition at line 599 of file IPosition.h.

References data_p, nelements(), and throwIndexError().

## operator*=() [1/2]

void casacore::IPosition::operator*= | ( | const IPosition & | other | ) |

References IPosition().

## operator*=() [2/2]

void casacore::IPosition::operator*= | ( | ssize_t | val | ) |

## operator+=() [1/2]

void casacore::IPosition::operator+= | ( | const IPosition & | other | ) |

Element-by-element arithmetic.

References IPosition().

## operator+=() [2/2]

void casacore::IPosition::operator+= | ( | ssize_t | val | ) |

## operator-=() [1/2]

void casacore::IPosition::operator-= | ( | const IPosition & | other | ) |

References IPosition().

## operator-=() [2/2]

void casacore::IPosition::operator-= | ( | ssize_t | val | ) |

## operator/=() [1/2]

void casacore::IPosition::operator/= | ( | const IPosition & | other | ) |

References IPosition().

## operator/=() [2/2]

void casacore::IPosition::operator/= | ( | ssize_t | val | ) |

## operator=() [1/3]

IPosition & casacore::IPosition::operator= | ( | const IPosition & | source | ) |

Makes this a copy of other.

When the dest is not of the same size, it will resize itself to be the same length as the source.

References IPosition().

## operator=() [2/3]

IPosition & casacore::IPosition::operator= | ( | IPosition && | source | ) |

References IPosition().

## operator=() [3/3]

IPosition & casacore::IPosition::operator= | ( | ssize_t | value | ) |

Copy "value" into every position of this IPosition.

References IPosition(), and casacore::NewDelAllocator< T >::value.

## operator[]() [1/2]

ssize_t & casacore::IPosition::operator[] | ( | size_t | index | ) |

inline

Index into the IPosition.

Indices are zero-based. If the preprocessor symbol AIPS_ARRAY_INDEX_CHECK is defined, operator() will check "index" to ensure it is not out of bounds. If this check fails, an AipsError will be thrown.

Definition at line 579 of file IPosition.h.

References data_p.

## operator[]() [2/2]

ssize_t casacore::IPosition::operator[] | ( | size_t | index | ) | const

inline

Definition at line 584 of file IPosition.h.

References data_p.

## otherAxes()

IPosition casacore::IPosition::otherAxes | ( | size_t | nrdim,
|  | const IPosition & | axes )

static

Make a list of axes which are the axes not given in axes up to the given dimension.

References IPosition().

## prepend()

void casacore::IPosition::prepend | ( | const IPosition & | other | ) |

Prepend this IPosition with another one (causing a resize).

References IPosition().

## product()

long long casacore::IPosition::product | ( |  | ) | const

Returns 0 if nelements() == 0, otherwise it returns the product of its elements.

## removeAxes()

IPosition casacore::IPosition::removeAxes | ( | const IPosition & | axes | ) | const

Return an IPosition where the given axes are reoved.

References IPosition().

## resize()

void casacore::IPosition::resize | ( | size_t | newSize,
|  | bool | copy = true )

Old values are copied on resize if copy==true.

If the size increases, values beyond the former size are undefined.

References copy().

Referenced by fill().

## setFirst()

void casacore::IPosition::setFirst | ( | const IPosition & | other | ) |

Set the first values of this IPosition to another IPosition.

An exception is thrown if the other IPosition is too long.

References IPosition().

## setLast()

void casacore::IPosition::setLast | ( | const IPosition & | other | ) |

Set the last values of this IPosition to another IPosition.

An exception is thrown if the other IPosition is too long.

References IPosition().

## size()

size_t casacore::IPosition::size | ( |  | ) | const

inline

Definition at line 570 of file IPosition.h.

References size_p.

Referenced by casacore::Array< LogicalArrayElem >::checkBeforeResize(), casacore::ArrayMath_global_functions_Array_mathematical_operations::expandArray(), fill(), casacore::TableExprGroupAggr::getArray(), casacore::TableExprNodeSet::toArray(), and casacore::ShapesFileWriter::Write().

## storage()

const ssize_t * casacore::IPosition::storage | ( |  | ) | const

inline

Get the storage.

Definition at line 629 of file IPosition.h.

References data_p.

## throwIndexError()

void casacore::IPosition::throwIndexError | ( |  | ) | const

private

Throw an index error exception.

Referenced by last(), last(), operator()(), and operator()().

## toString()

std::string casacore::IPosition::toString | ( |  | ) | const

Write the IPosition into a string.

TODO deprecate in favour of to_string(const IPosition&)

## Friends And Related Symbol Documentation

## IPositionComparator

friend class IPositionComparator

friend

Definition at line 118 of file IPosition.h.

References IPositionComparator.

Referenced by IPositionComparator.

## operator<<

std::ostream & operator<< | ( | std::ostream & | os,
|  | const IPosition & | ip )

friend

Write an IPosition to an ostream in a simple text form.

References IPosition().

## Member Data Documentation

## buffer_p

ssize_t casacore::IPosition::buffer_p[BufferLength]

private

Definition at line 435 of file IPosition.h.

Referenced by IPosition().

## data_p

ssize_t* casacore::IPosition::data_p

private

When the iposition is length BufferSize or less data is just buffer_p, avoiding calls to new and delete.

Definition at line 438 of file IPosition.h.

Referenced by begin(), begin(), copy(), end(), end(), fill(), IPosition(), last(), last(), operator()(), operator()(), operator[](), operator[](), and storage().

## size_p

size_t casacore::IPosition::size_p

private

Definition at line 434 of file IPosition.h.

Referenced by conform(), copy(), empty(), end(), end(), IPosition(), last(), last(), nelements(), and size().

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

- casa/Arrays/IPosition.h