28 #ifndef CASA_IPOSITION_H
29 #define CASA_IPOSITION_H
37 #include <sys/types.h>
44 template<
class T>
class Array;
45 template<
class T>
class Vector;
179 IPosition(
const std::vector<Int>& other);
184 template<
typename InputIterator>
188 for (
uInt i=0; i<
size; ++i, ++iter) {
195 template<
typename OutputIterator>
196 void copy (OutputIterator iter)
const
256 const ssize_t *
storage()
const;
569 #if defined(AIPS_ARRAY_INDEX_CHECK)
579 #if defined(AIPS_ARRAY_INDEX_CHECK)
589 #if defined(AIPS_ARRAY_INDEX_CHECK)
590 if (
size_p - index <= 0) {
599 #if defined(AIPS_ARRAY_INDEX_CHECK)
600 if (
size_p - index <= 0) {
A Vector of integers, for indexing into Array<T> objects.
IPosition keepAxes(const IPosition &axes) const
Return an IPosition containing the given axes only.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
iterator begin()
Get the begin and end iterator object for this object.
std::vector< double > Vector
IPosition & operator=(const IPosition &other)
Makes this a copy of other.
ssize_t * data_p
When the iposition is length BufferSize or less data is just buffer_p, avoiding calls to new and dele...
ssize_t buffer_p[BufferLength]
Bool conform(const IPosition &other) const
conform returns true if nelements() == other.nelements().
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
AipsIO is the object persistency mechanism of Casacore.
IPosition concatenate(const IPosition &other) const
Return an IPosition as the concetanation of this and another IPosition.
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
void throwIndexError() const
Throw an index error exception.
void operator+=(const IPosition &other)
Element-by-element arithmetic.
LatticeExprNode operator!=(const LatticeExprNode &left, const LatticeExprNode &right)
ostream-like interface to creating log messages.
const value_type * const_pointer
Bool isEqual(const IPosition &other) const
Element-by-element comparison for equality.
const_iterator begin() const
IPosition getFirst(uInt n) const
Construct an IPosition from the first n values of this IPosition.
Bool 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 ...
MVEarthMagnetic operator*(const RotMatrix &left, const MVEarthMagnetic &right)
Rotate a EarthMagnetic vector with rotation matrix and other multiplications.
void append(const IPosition &other)
Append this IPosition with another one (causing a resize).
void operator-=(const IPosition &other)
LatticeExprNode operator>=(const LatticeExprNode &left, const LatticeExprNode &right)
const_iterator end() const
void setFirst(const IPosition &other)
Set the first values of this IPosition to another IPosition.
Bool ok() const
Is this IPosition consistent?
void fill(uInt size, InputIterator iter)
Resize and fill this IPosition object.
IPosition removeAxes(const IPosition &axes) const
Return an IPosition where the given axes are reoved.
const ssize_t * storage() const
Get the storage.
Bool allOne() const
Are all elements equal to 1? Useful to check if a given stride is really a stride.
IPosition()
A zero-length IPosition.
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
ssize_t value_type
Define the STL-style iterators.
void allocateBuffer()
Allocate a buffer with length size_p.
void operator*=(const IPosition &other)
void operator/=(const IPosition &other)
Bool empty() const
Is the IPosition empty (i.e.
ssize_t & last(uInt index=0)
Index into the IPosition from the end.
void copy(OutputIterator iter) const
Copy the contents of this IPosition object to the output iterator.
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
friend std::ostream & operator<<(std::ostream &os, const IPosition &ip)
Write an IPosition to an ostream in a simple text form.
std::vector< Int > asStdVector() const
ssize_t & operator[](uInt index)
Index into the IPosition.
LatticeExprNode operator<=(const LatticeExprNode &left, const LatticeExprNode &right)
bool Bool
Define the standard types used by Casacore.
static IPosition makeAxisPath(uInt nrdim)
Construct a default axis path consisting of the values 0.
ssize_t & operator()(uInt index)
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
LatticeExprNode operator>(const LatticeExprNode &left, const LatticeExprNode &right)
ptrdiff_t difference_type
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
static IPosition otherAxes(uInt nrdim, const IPosition &axes)
Make a list of axes which are the axes not given in axes up to the given dimension.
void prepend(const IPosition &other)
Prepend this IPosition with another one (causing a resize).
LatticeExprNode operator-(const LatticeExprNode &expr)
String: the storage and methods of handling collections of characters.
Bool operator==(const MVTime &lh, const MVTime &rh)
is equal operator, uses operator Double which returns days
const value_type & const_reference
void resize(uInt newSize, Bool copy=True)
Old values are copied on resize if copy==True.
LatticeExprNode operator<(const LatticeExprNode &left, const LatticeExprNode &right)
const ssize_t * const_iterator
IPosition nonDegenerate(uInt startingAxis=0) const
This member functions return an IPosition which has degenerate (length==1) axes removed and the dimen...
bool operator()(const IPosition &lhs, const IPosition &rhs) const
allows a way for IPosition to be used as keys in a std::map
void setLast(const IPosition &other)
Set the last values of this IPosition to another IPosition.
uInt nelements() const
The number of elements in this IPosition.
String toString() const
Write the IPosition into a String.
Vector< Int > asVector() const
friend AipsIO & operator>>(AipsIO &aio, IPosition &ip)
Read an IPosition from an AipsIO stream in a binary format.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
Int64 product() const
Returns 0 if nelements() == 0, otherwise it returns the product of its elements.
IPosition getLast(uInt n) const
Construct an IPosition from the last n values of this IPosition.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.