28 #ifndef CASA_IPOSITION_H 29 #define CASA_IPOSITION_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/casa/iosfwd.h> 34 #include <casacore/casa/BasicSL/String.h> 37 #include <sys/types.h> 44 template<
class T>
class Array;
45 template<
class T>
class Vector;
178 IPosition(
const std::vector<Int>& other);
183 template<
typename InputIterator>
187 for (
uInt i=0; i<
size; ++i, ++iter) {
194 template<
typename OutputIterator>
195 void copy (OutputIterator iter)
const 255 const ssize_t *
storage()
const;
398 const_iterator
end()
const 557 #if defined(AIPS_ARRAY_INDEX_CHECK) 567 #if defined(AIPS_ARRAY_INDEX_CHECK) 577 #if defined(AIPS_ARRAY_INDEX_CHECK) 578 if (
size_p - index <= 0) {
587 #if defined(AIPS_ARRAY_INDEX_CHECK) 588 if (
size_p - index <= 0) {
A Vector of integers, for indexing into Array<T> objects.
IPosition getFirst(uInt n) const
Construct an IPosition from the first n values of this IPosition.
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.
IPosition & operator=(const IPosition &other)
Makes this a copy of other.
Bool allOne() const
Are all elements equal to 1? Useful to check if a given stride is really a stride.
IPosition removeAxes(const IPosition &axes) const
Return an IPosition where the given axes are reoved.
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 operator==(const std11_allocator< T > &, const std11_allocator< T > &)
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
AipsIO is the object persistency mechanism of Casacore.
void copy(OutputIterator iter) const
Copy the contents of this IPosition object to the output iterator.
bool operator!=(const std11_allocator< T > &, const std11_allocator< T > &)
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
IPosition nonDegenerate(uInt startingAxis=0) const
This member functions return an IPosition which has degenerate (length==1) axes removed and the dimen...
void operator+=(const IPosition &other)
Element-by-element arithmetic.
Bool conform(const IPosition &other) const
conform returns true if nelements() == other.nelements().
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 ...
ostream-like interface to creating log messages.
const value_type * const_pointer
const ssize_t * storage() const
Get the storage.
IPosition concatenate(const IPosition &other) const
Return an IPosition as the concetanation of this and another IPosition.
uInt nelements() const
The number of elements in this IPosition.
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
std::vector< Int > asStdVector() const
void setFirst(const IPosition &other)
Set the first values of this IPosition to another IPosition.
IPosition keepAxes(const IPosition &axes) const
Return an IPosition containing the given axes only.
void throwIndexError() const
Throw an index error exception.
void fill(uInt size, InputIterator iter)
Resize and fill this IPosition object.
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)
Bool isEqual(const IPosition &other) const
Element-by-element comparison for equality.
void operator/=(const IPosition &other)
ssize_t & last(uInt index=0)
Index into the IPosition from the end.
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.
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.
IPosition getLast(uInt n) const
Construct an IPosition from the last n values of this IPosition.
Vector< Int > asVector() const
static IPosition makeAxisPath(uInt nrdim)
Construct a default axis path consisting of the values 0 .
Bool empty() const
Is the IPosition empty (i.e.
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
String toString() const
Write the IPosition into a String.
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.
const_iterator begin() const
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.
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
Bool ok() const
Is this IPosition consistent?
void setLast(const IPosition &other)
Set the last values of this IPosition to another IPosition.
Int64 product() const
Returns 0 if nelements() == 0, otherwise it returns the product of its elements.
this file contains all the compiler specific defines
friend AipsIO & operator>>(AipsIO &aio, IPosition &ip)
Read an IPosition from an AipsIO stream in a binary format.
MVBaseline operator*(const RotMatrix &left, const MVBaseline &right)
Rotate a Baseline vector with rotation matrix and other multiplications.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.