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

Non-templated base class for templated Array class. More...

`#include <ArrayBase.h>`

## Public Member Functions

| ArrayBase () noexcept
| ArrayBase (const IPosition &shape)
| Create an array of the given shape, i.e.
| ArrayBase (const ArrayBase &other)
| Copy constructor.
| ArrayBase (ArrayBase &&source) noexcept
ArrayBase & | assign (const ArrayBase &)
| Assignment.
ArrayBase & | operator= (const ArrayBase &)=delete
ArrayBase & | operator= (ArrayBase &&) noexcept
virtual | ~ArrayBase () noexcept
| Destructor.
size_t | ndim () const
| The dimensionality of this array.
size_t | nelements () const
| How many elements does this array have?
size_t | size () const
bool | empty () const
| Is the array empty (i.e.
bool | contiguousStorage () const
| Are the array data contiguous?
virtual bool | ok () const
| Check to see if the Array is consistent.
const IPosition & | shape () const
| The length of each axis.
IPosition | endPosition () const
| A convenience function: endPosition(i) = shape(i) - 1; i.e.
const IPosition & | steps () const
| Return steps to be made if stepping one element in a dimension.
virtual std::unique_ptr< ArrayBase > | makeArray () const
| Make an empty array of the same type.
virtual void | resize (const IPosition &newShape, bool copyValues=false)
| Resize the array and optionally copy the values.
virtual std::unique_ptr< ArrayPositionIterator > | makeIterator (size_t byDim) const
| Resize the array and optionally copy the values.
virtual std::unique_ptr< ArrayBase > | getSection (const Slicer &) const
| Get a reference to a section of an array.
virtual void | assignBase (const ArrayBase &source, bool checkType=true)
| Assign the source array to this array.
virtual void * | getVStorage (bool &deleteIt)
| The following functions behave the same as the corresponding getStorage functions in the derived templated Array class.
virtual const void * | getVStorage (bool &deleteIt) const
virtual void | putVStorage (void *&storage, bool deleteAndCopy)
virtual void | freeVStorage (const void *&storage, bool deleteIt) const
void | validateConformance (const ArrayBase &) const
| Various helper functions.
void | validateIndex (const IPosition &) const
void | validateIndex (size_t index) const
void | validateIndex (size_t index1, size_t index2) const
void | validateIndex (size_t index1, size_t index2, size_t index3) const

## Static Public Member Functions

static unsigned | arrayVersion ()
| Array version for major change (used by ArrayIO).

## Protected Member Functions

| ArrayBase (ArrayBase &&source, const IPosition &shapeForSource) noexcept
| For subclasses, this move constructor allows the moved-from object to obtain a given shape after resizing.
void | swap (ArrayBase &source) noexcept
bool | reformOrResize (const IPosition &newShape, bool resizeIfNeeded, size_t nReferences, long long nElementsAllocated, bool copyDataIfNeeded, size_t resizePercentage)
| Either reforms the array if size permits or resizes it to the new shape.
bool | isStorageContiguous () const
| Determine if the storage of a subset is contiguous.
void | checkVectorShape ()
| Check if the shape of a vector is correct.
void | checkMatrixShape ()
| Check if the shape of a matrix is correct.
void | checkCubeShape ()
| Check if the shape of a cube is correct.
void | baseReform (ArrayBase &tmp, const IPosition &shape, bool strict=true) const
| Reform the array to a shape with the same nr of elements.
void | baseNonDegenerate (const ArrayBase &other, const IPosition &ignoreAxes)
| Remove the degenerate axes from the Array object.
void | baseAddDegenerate (ArrayBase &, size_t numAxes)
| These member functions return an Array reference with the specified number of extra axes, all of length one, appended to the end of the Array.
size_t | makeSubset (ArrayBase &out, const IPosition &b, const IPosition &e, const IPosition &i)
| Make a subset of an array.
size_t | makeDiagonal (size_t firstAxis, long long diag)
| Set the length and stride such that the diagonal of the matrices defined by two consecutive axes is formed.
bool | conform2 (const ArrayBase &other) const
| Are the shapes identical?
void | baseMakeSteps ()
| Make the indexing step sizes.
bool | copyVectorHelper (const ArrayBase &other)
| Helper function for templated Vector class.

## Protected Attributes

size_t | nels_p
| Number of elements in the array.
size_t | ndimen_p
| Dimensionality of the array.
bool | contiguous_p
| Are the data contiguous?
IPosition | length_p
| Used to hold the shape, increment into the underlying storage and originalLength of the array.
IPosition | inc_p
IPosition | originalLength_p
IPosition | steps_p
| Used to hold the step to next element in each dimension.

## Detailed Description

Non-templated base class for templated Array class.

ArrayBase is only used to factor out common code from the templated Array class.

Definition at line 70 of file ArrayBase.h.

## Constructor & Destructor Documentation

## ArrayBase() [1/5]

casacore::ArrayBase::ArrayBase | ( |  | ) |

noexcept

Referenced by ArrayBase(), ArrayBase(), ArrayBase(), ArrayBase(), assign(), casacore::Array< LogicalArrayElem >::assignBase(), assignBase(), baseAddDegenerate(), baseNonDegenerate(), baseReform(), casacore::Array< LogicalArrayElem >::checkAssignableType(), conform2(), copyVectorHelper(), casacore::Array< LogicalArrayElem >::makeArray(), makeSubset(), operator=(), operator=(), swap(), validateConformance(), and ~ArrayBase().

## ArrayBase() [2/5]

casacore::ArrayBase::ArrayBase | ( | const IPosition & | shape | ) |

explicit

Create an array of the given shape, i.e.

after construction array.ndim() == shape.nelements() and array.shape() == shape. The origin of the Array is zero.

References ArrayBase(), and shape().

## ArrayBase() [3/5]

casacore::ArrayBase::ArrayBase | ( | const ArrayBase & | other | ) |

Copy constructor.

References ArrayBase().

## ArrayBase() [4/5]

casacore::ArrayBase::ArrayBase | ( | ArrayBase && | source | ) |

noexcept

References ArrayBase().

## ~ArrayBase()

virtual casacore::ArrayBase::~ArrayBase | ( |  | ) |

virtual noexcept

Destructor.

References ArrayBase().

## ArrayBase() [5/5]

casacore::ArrayBase::ArrayBase | ( | ArrayBase && | source,
|  | const IPosition & | shapeForSource )

protected noexcept

For subclasses, this move constructor allows the moved-from object to obtain a given shape after resizing.

This way, e.g. a source Matrix can still kee a dimensionality of 2.

References ArrayBase().

## Member Function Documentation

## arrayVersion()

unsigned casacore::ArrayBase::arrayVersion | ( |  | ) |

inline static

Array version for major change (used by ArrayIO).

enum did not work properly with cfront 3.0.1), so replaced by a static inline function. Users won't normally use this.

Definition at line 140 of file ArrayBase.h.

## assign()

ArrayBase & casacore::ArrayBase::assign | ( | const ArrayBase & |  | ) |

Assignment.

References ArrayBase(), and assign().

Referenced by assign().

## assignBase()

virtual void casacore::ArrayBase::assignBase | ( | const ArrayBase & | source,
|  | bool | checkType = true )

virtual

Assign the source array to this array.

If checkType==true, it is checked if the underlying template types match. Otherwise, it is only checked in debug mode (for performance).
The default implementation in ArrayBase throws an exception.

Reimplemented in casacore::Array< T >, casacore::Array< ArgType >, casacore::Array< Bool >, casacore::Array< casacore::AutoDiff< Double > >, casacore::Array< casacore::GaussianBeam >, casacore::Array< casacore::MDirection >, casacore::Array< casacore::MeasComet * >, casacore::Array< casacore::MFrequency >, casacore::Array< casacore::MPosition >, casacore::Array< casacore::MVFrequency >, casacore::Array< casacore::MVTime >, casacore::Array< casacore::Quantum< Double > >, casacore::Array< casacore::RigidVector< Double, 2 > >, casacore::Array< casacore::RORecordFieldPtr< Double > >, casacore::Array< casacore::Slicer * >, casacore::Array< casacore::SquareMatrix< Complex, 2 > >, casacore::Array< casacore::String >, casacore::Array< casacore::Unit >, casacore::Array< casacore::Vector< Range > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Array< Complex >, casacore::Array< DComplex >, casacore::Array< Domain >, casacore::Array< Double >, casacore::Array< double >, casacore::Array< Float >, casacore::Array< FType >, casacore::Array< Int >, casacore::Array< Int64 >, casacore::Array< LogicalArrayElem >, casacore::Array< M >, casacore::Array< MDirection >, casacore::Array< MDoppler >, casacore::Array< MEarthMagnetic >, casacore::Array< MEpoch >, casacore::Array< MFrequency >, casacore::Array< MPosition >, casacore::Array< MRadialVelocity >, casacore::Array< Range >, casacore::Array< rownr_t >, casacore::Array< Short >, casacore::Array< size_t >, casacore::Array< Type >, casacore::Array< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Array< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Array< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Array< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, casacore::Array< typename casacore::NumericTraits< FType >::ConjugateType >, casacore::Array< uInt >, and casacore::const_iterator< GaussianBeam >.

References ArrayBase().

## baseAddDegenerate()

void casacore::ArrayBase::baseAddDegenerate | ( | ArrayBase & | ,
|  | size_t | numAxes )

protected

These member functions return an Array reference with the specified number of extra axes, all of length one, appended to the end of the Array.

Note that the reform function can also be used to add extra axes.

References ArrayBase().

## baseMakeSteps()

void casacore::ArrayBase::baseMakeSteps | ( |  | ) |

protected

Make the indexing step sizes.

Referenced by casacore::Array< LogicalArrayElem >::makeSteps().

## baseNonDegenerate()

void casacore::ArrayBase::baseNonDegenerate | ( | const ArrayBase & | other,
|  | const IPosition & | ignoreAxes )

protected

Remove the degenerate axes from the Array object.

This is the implementation of the nonDegenerate functions. It has a different name to be able to make it virtual without having the "hide virtual function" message when compiling derived classes.

References ArrayBase().

## baseReform()

void casacore::ArrayBase::baseReform | ( | ArrayBase & | tmp,
|  | const IPosition & | shape,
|  | bool | strict = true ) const

protected

Reform the array to a shape with the same nr of elements.

If nonStrict then caller assumes responsibility for not overrunning storage (avoid or use with extreme care).

References ArrayBase(), and shape().

## checkCubeShape()

void casacore::ArrayBase::checkCubeShape | ( |  | ) |

protected

Check if the shape of a cube is correct.

Adjust it if smaller.

## checkMatrixShape()

void casacore::ArrayBase::checkMatrixShape | ( |  | ) |

protected

Check if the shape of a matrix is correct.

Adjust it if smaller.

## checkVectorShape()

void casacore::ArrayBase::checkVectorShape | ( |  | ) |

protected

Check if the shape of a vector is correct.

If possible, adjust if not. It is possible if at most one axis has length > 1.

## conform2()

bool casacore::ArrayBase::conform2 | ( | const ArrayBase & | other | ) | const

inline protected

Are the shapes identical?

Definition at line 245 of file ArrayBase.h.

References ArrayBase(), and length_p.

Referenced by casacore::Array< LogicalArrayElem >::conform().

## contiguousStorage()

bool casacore::ArrayBase::contiguousStorage | ( |  | ) | const

inline

Are the array data contiguous?

If they are not contiguous, getStorage (see below) needs to make a copy.

Definition at line 114 of file ArrayBase.h.

References contiguous_p.

Referenced by casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::avdev(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::max(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::min(), casacore::MArrayLogical_global_functions_MArray_logical_operations::nfalse(), casacore::MArrayLogical_global_functions_MArray_logical_operations::ntrue(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::product(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::rms(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::sum(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::sumsqr(), and casacore::MArrayMath_global_functions_MArray_mathematical_operations::variance().

## copyVectorHelper()

bool casacore::ArrayBase::copyVectorHelper | ( | const ArrayBase & | other | ) |

protected

Helper function for templated Vector class.

It returns if this and other are conformant.

References ArrayBase().

## empty()

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

inline

Is the array empty (i.e.

no elements)?

Definition at line 108 of file ArrayBase.h.

References nels_p.

## endPosition()

IPosition casacore::ArrayBase::endPosition | ( |  | ) | const

A convenience function: endPosition(i) = shape(i) - 1; i.e.

this is the IPosition of the last element of the Array.

## freeVStorage()

virtual void casacore::ArrayBase::freeVStorage | ( | const void *& | storage,
|  | bool | deleteIt ) const

virtual

Reimplemented in casacore::Array< T >, casacore::Array< ArgType >, casacore::Array< Bool >, casacore::Array< casacore::AutoDiff< Double > >, casacore::Array< casacore::GaussianBeam >, casacore::Array< casacore::MDirection >, casacore::Array< casacore::MeasComet * >, casacore::Array< casacore::MFrequency >, casacore::Array< casacore::MPosition >, casacore::Array< casacore::MVFrequency >, casacore::Array< casacore::MVTime >, casacore::Array< casacore::Quantum< Double > >, casacore::Array< casacore::RigidVector< Double, 2 > >, casacore::Array< casacore::RORecordFieldPtr< Double > >, casacore::Array< casacore::Slicer * >, casacore::Array< casacore::SquareMatrix< Complex, 2 > >, casacore::Array< casacore::String >, casacore::Array< casacore::Unit >, casacore::Array< casacore::Vector< Range > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Array< Complex >, casacore::Array< DComplex >, casacore::Array< Domain >, casacore::Array< Double >, casacore::Array< double >, casacore::Array< Float >, casacore::Array< FType >, casacore::Array< Int >, casacore::Array< Int64 >, casacore::Array< LogicalArrayElem >, casacore::Array< M >, casacore::Array< MDirection >, casacore::Array< MDoppler >, casacore::Array< MEarthMagnetic >, casacore::Array< MEpoch >, casacore::Array< MFrequency >, casacore::Array< MPosition >, casacore::Array< MRadialVelocity >, casacore::Array< Range >, casacore::Array< rownr_t >, casacore::Array< Short >, casacore::Array< size_t >, casacore::Array< Type >, casacore::Array< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Array< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Array< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Array< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, casacore::Array< typename casacore::NumericTraits< FType >::ConjugateType >, casacore::Array< uInt >, and casacore::const_iterator< GaussianBeam >.

Referenced by casacore::Adios2StManColumnT< T >::toAdios().

## getSection()

virtual std::unique_ptr< ArrayBase > casacore::ArrayBase::getSection | ( | const Slicer & |  | ) | const

virtual

Get a reference to a section of an array.

This is the same as Array<T>::operator(), but without having to know the exact template type.
The default implementation in ArrayBase throws an exception.

Reimplemented in casacore::Array< T >, casacore::Array< ArgType >, casacore::Array< Bool >, casacore::Array< casacore::AutoDiff< Double > >, casacore::Array< casacore::GaussianBeam >, casacore::Array< casacore::MDirection >, casacore::Array< casacore::MeasComet * >, casacore::Array< casacore::MFrequency >, casacore::Array< casacore::MPosition >, casacore::Array< casacore::MVFrequency >, casacore::Array< casacore::MVTime >, casacore::Array< casacore::Quantum< Double > >, casacore::Array< casacore::RigidVector< Double, 2 > >, casacore::Array< casacore::RORecordFieldPtr< Double > >, casacore::Array< casacore::Slicer * >, casacore::Array< casacore::SquareMatrix< Complex, 2 > >, casacore::Array< casacore::String >, casacore::Array< casacore::Unit >, casacore::Array< casacore::Vector< Range > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Array< Complex >, casacore::Array< DComplex >, casacore::Array< Domain >, casacore::Array< Double >, casacore::Array< double >, casacore::Array< Float >, casacore::Array< FType >, casacore::Array< Int >, casacore::Array< Int64 >, casacore::Array< LogicalArrayElem >, casacore::Array< M >, casacore::Array< MDirection >, casacore::Array< MDoppler >, casacore::Array< MEarthMagnetic >, casacore::Array< MEpoch >, casacore::Array< MFrequency >, casacore::Array< MPosition >, casacore::Array< MRadialVelocity >, casacore::Array< Range >, casacore::Array< rownr_t >, casacore::Array< Short >, casacore::Array< size_t >, casacore::Array< Type >, casacore::Array< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Array< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Array< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Array< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, casacore::Array< typename casacore::NumericTraits< FType >::ConjugateType >, casacore::Array< uInt >, and casacore::const_iterator< GaussianBeam >.

## getVStorage() [1/2]

virtual void * casacore::ArrayBase::getVStorage | ( | bool & | deleteIt | ) |

virtual

The following functions behave the same as the corresponding getStorage functions in the derived templated Array class.

They handle a pointer to a contiguous block of array data. If the array is not contiguous, a copy is used to make it contiguous.

Reimplemented in casacore::Array< T >, casacore::Array< ArgType >, casacore::Array< Bool >, casacore::Array< casacore::AutoDiff< Double > >, casacore::Array< casacore::GaussianBeam >, casacore::Array< casacore::MDirection >, casacore::Array< casacore::MeasComet * >, casacore::Array< casacore::MFrequency >, casacore::Array< casacore::MPosition >, casacore::Array< casacore::MVFrequency >, casacore::Array< casacore::MVTime >, casacore::Array< casacore::Quantum< Double > >, casacore::Array< casacore::RigidVector< Double, 2 > >, casacore::Array< casacore::RORecordFieldPtr< Double > >, casacore::Array< casacore::Slicer * >, casacore::Array< casacore::SquareMatrix< Complex, 2 > >, casacore::Array< casacore::String >, casacore::Array< casacore::Unit >, casacore::Array< casacore::Vector< Range > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Array< Complex >, casacore::Array< DComplex >, casacore::Array< Domain >, casacore::Array< Double >, casacore::Array< double >, casacore::Array< Float >, casacore::Array< FType >, casacore::Array< Int >, casacore::Array< Int64 >, casacore::Array< LogicalArrayElem >, casacore::Array< M >, casacore::Array< MDirection >, casacore::Array< MDoppler >, casacore::Array< MEarthMagnetic >, casacore::Array< MEpoch >, casacore::Array< MFrequency >, casacore::Array< MPosition >, casacore::Array< MRadialVelocity >, casacore::Array< Range >, casacore::Array< rownr_t >, casacore::Array< Short >, casacore::Array< size_t >, casacore::Array< Type >, casacore::Array< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Array< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Array< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Array< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, casacore::Array< typename casacore::NumericTraits< FType >::ConjugateType >, casacore::Array< uInt >, and casacore::const_iterator< GaussianBeam >.

Referenced by casacore::Adios2StManColumnT< T >::fromAdios(), and casacore::Adios2StManColumnT< T >::toAdios().

## getVStorage() [2/2]

virtual const void * casacore::ArrayBase::getVStorage | ( | bool & | deleteIt | ) | const

virtual

Reimplemented in casacore::Array< T >, casacore::Array< casacore::String >, casacore::Array< LogicalArrayElem >, and casacore::const_iterator< GaussianBeam >.

## isStorageContiguous()

bool casacore::ArrayBase::isStorageContiguous | ( |  | ) | const

protected

Determine if the storage of a subset is contiguous.

## makeArray()

virtual std::unique_ptr< ArrayBase > casacore::ArrayBase::makeArray | ( |  | ) | const

virtual

Make an empty array of the same type.

The default implementation in ArrayBase throws an exception.

Reimplemented in casacore::Array< T >, casacore::Array< ArgType >, casacore::Array< Bool >, casacore::Array< casacore::AutoDiff< Double > >, casacore::Array< casacore::GaussianBeam >, casacore::Array< casacore::MDirection >, casacore::Array< casacore::MeasComet * >, casacore::Array< casacore::MFrequency >, casacore::Array< casacore::MPosition >, casacore::Array< casacore::MVFrequency >, casacore::Array< casacore::MVTime >, casacore::Array< casacore::Quantum< Double > >, casacore::Array< casacore::RigidVector< Double, 2 > >, casacore::Array< casacore::RORecordFieldPtr< Double > >, casacore::Array< casacore::Slicer * >, casacore::Array< casacore::SquareMatrix< Complex, 2 > >, casacore::Array< casacore::String >, casacore::Array< casacore::Unit >, casacore::Array< casacore::Vector< Range > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Array< Complex >, casacore::Array< DComplex >, casacore::Array< Domain >, casacore::Array< Double >, casacore::Array< double >, casacore::Array< Float >, casacore::Array< FType >, casacore::Array< Int >, casacore::Array< Int64 >, casacore::Array< LogicalArrayElem >, casacore::Array< M >, casacore::Array< MDirection >, casacore::Array< MDoppler >, casacore::Array< MEarthMagnetic >, casacore::Array< MEpoch >, casacore::Array< MFrequency >, casacore::Array< MPosition >, casacore::Array< MRadialVelocity >, casacore::Array< Range >, casacore::Array< rownr_t >, casacore::Array< Short >, casacore::Array< size_t >, casacore::Array< Type >, casacore::Array< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Array< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Array< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Array< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, casacore::Array< typename casacore::NumericTraits< FType >::ConjugateType >, casacore::Array< uInt >, and casacore::const_iterator< GaussianBeam >.

## makeDiagonal()

size_t casacore::ArrayBase::makeDiagonal | ( | size_t | firstAxis,
|  | long long | diag )

protected

Set the length and stride such that the diagonal of the matrices defined by two consecutive axes is formed.

diag == 0 indicates the main diagonal, >0 above, <0 below. It returns the offset of the diagonal in the (original) array.

## makeIterator()

virtual std::unique_ptr< ArrayPositionIterator > casacore::ArrayBase::makeIterator | ( | size_t | byDim | ) | const

virtual

Resize the array and optionally copy the values.

The default implementation in ArrayBase throws an exception. virtual void resize(const IPosition &newShape, bool copyValues, ArrayInitPolicy policy);

Create an ArrayIterator object of the correct type. This is implemented in the derived Array classes.
The default implementation in ArrayBase throws an exception.

Reimplemented in casacore::Array< T >, casacore::Array< ArgType >, casacore::Array< Bool >, casacore::Array< casacore::AutoDiff< Double > >, casacore::Array< casacore::GaussianBeam >, casacore::Array< casacore::MDirection >, casacore::Array< casacore::MeasComet * >, casacore::Array< casacore::MFrequency >, casacore::Array< casacore::MPosition >, casacore::Array< casacore::MVFrequency >, casacore::Array< casacore::MVTime >, casacore::Array< casacore::Quantum< Double > >, casacore::Array< casacore::RigidVector< Double, 2 > >, casacore::Array< casacore::RORecordFieldPtr< Double > >, casacore::Array< casacore::Slicer * >, casacore::Array< casacore::SquareMatrix< Complex, 2 > >, casacore::Array< casacore::String >, casacore::Array< casacore::Unit >, casacore::Array< casacore::Vector< Range > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Array< Complex >, casacore::Array< DComplex >, casacore::Array< Domain >, casacore::Array< Double >, casacore::Array< double >, casacore::Array< Float >, casacore::Array< FType >, casacore::Array< Int >, casacore::Array< Int64 >, casacore::Array< LogicalArrayElem >, casacore::Array< M >, casacore::Array< MDirection >, casacore::Array< MDoppler >, casacore::Array< MEarthMagnetic >, casacore::Array< MEpoch >, casacore::Array< MFrequency >, casacore::Array< MPosition >, casacore::Array< MRadialVelocity >, casacore::Array< Range >, casacore::Array< rownr_t >, casacore::Array< Short >, casacore::Array< size_t >, casacore::Array< Type >, casacore::Array< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Array< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Array< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Array< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, casacore::Array< typename casacore::NumericTraits< FType >::ConjugateType >, casacore::Array< uInt >, and casacore::const_iterator< GaussianBeam >.

## makeSubset()

size_t casacore::ArrayBase::makeSubset | ( | ArrayBase & | out,
|  | const IPosition & | b,
|  | const IPosition & | e,
|  | const IPosition & | i )

protected

Make a subset of an array.

It checks if start,end,incr are within the array limits. It returns the offset of the subset in the (original) array.

References ArrayBase().

## ndim()

size_t casacore::ArrayBase::ndim | ( |  | ) | const

inline

The dimensionality of this array.

Definition at line 96 of file ArrayBase.h.

References ndim(), and ndimen_p.

Referenced by casacore::Matrix< LogicalArrayElem >::assign_conforming(), casacore::ArrayMath_global_functions_Array_mathematical_operations::expandArray(), ndim(), casacore::Cube< LogicalArrayElem >::operator=(), casacore::TableProxy::record2Array(), and casacore::Array< LogicalArrayElem >::setEndIter().

## nelements()

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

inline

How many elements does this array have?

Product of all axis lengths.

Definition at line 101 of file ArrayBase.h.

References nels_p.

Referenced by casacore::areEQ(), casacore::TabVecRep< T >::conform(), casacore::ArrayMath_global_functions_Array_mathematical_operations::madfm(), casacore::ArrayMath_global_functions_Array_mathematical_operations::madfm(), casacore::ArrayMath_global_functions_Array_mathematical_operations::madfmInPlace(), casacore::ArrayMath_global_functions_Array_mathematical_operations::median(), casacore::ArrayMath_global_functions_Array_mathematical_operations::median(), casacore::ArrayMath_global_functions_Array_mathematical_operations::medianInPlace(), and casacore::Vector< LogicalArrayElem >::resize().

## ok()

virtual bool casacore::ArrayBase::ok | ( |  | ) | const

virtual

Check to see if the Array is consistent.

This is about the same thing as checking for invariants. If AIPS_DEBUG is defined, this is invoked after construction and on entry to most member functions.

Reimplemented in casacore::Array< T >, casacore::Array< ArgType >, casacore::Array< Bool >, casacore::Array< casacore::AutoDiff< Double > >, casacore::Array< casacore::GaussianBeam >, casacore::Array< casacore::MDirection >, casacore::Array< casacore::MeasComet * >, casacore::Array< casacore::MFrequency >, casacore::Array< casacore::MPosition >, casacore::Array< casacore::MVFrequency >, casacore::Array< casacore::MVTime >, casacore::Array< casacore::Quantum< Double > >, casacore::Array< casacore::RigidVector< Double, 2 > >, casacore::Array< casacore::RORecordFieldPtr< Double > >, casacore::Array< casacore::Slicer * >, casacore::Array< casacore::SquareMatrix< Complex, 2 > >, casacore::Array< casacore::String >, casacore::Array< casacore::Unit >, casacore::Array< casacore::Vector< Range > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Array< Complex >, casacore::Array< DComplex >, casacore::Array< Domain >, casacore::Array< Double >, casacore::Array< double >, casacore::Array< Float >, casacore::Array< FType >, casacore::Array< Int >, casacore::Array< Int64 >, casacore::Array< LogicalArrayElem >, casacore::Array< M >, casacore::Array< MDirection >, casacore::Array< MDoppler >, casacore::Array< MEarthMagnetic >, casacore::Array< MEpoch >, casacore::Array< MFrequency >, casacore::Array< MPosition >, casacore::Array< MRadialVelocity >, casacore::Array< Range >, casacore::Array< rownr_t >, casacore::Array< Short >, casacore::Array< size_t >, casacore::Array< Type >, casacore::Array< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Array< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Array< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Array< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, casacore::Array< typename casacore::NumericTraits< FType >::ConjugateType >, casacore::Array< uInt >, casacore::const_iterator< GaussianBeam >, casacore::Cube< T >, casacore::Cube< casacore::RigidVector< Double, 2 > >, casacore::Cube< Double >, casacore::Cube< LogicalArrayElem >, casacore::Matrix< T >, casacore::Matrix< Bool >, casacore::Matrix< casacore::GaussianBeam >, casacore::Matrix< casacore::SquareMatrix< Complex, 2 > >, casacore::Matrix< Complex >, casacore::Matrix< Double >, casacore::Matrix< Float >, casacore::Matrix< FType >, casacore::Matrix< Int >, casacore::Matrix< Int64 >, casacore::Matrix< LogicalArrayElem >, casacore::Vector< T >, casacore::Vector< ArgType >, casacore::Vector< Bool >, casacore::Vector< casacore::AutoDiff< Double > >, casacore::Vector< casacore::MDirection >, casacore::Vector< casacore::MeasComet * >, casacore::Vector< casacore::MFrequency >, casacore::Vector< casacore::MPosition >, casacore::Vector< casacore::MVTime >, casacore::Vector< casacore::Quantum< Double > >, casacore::Vector< casacore::RORecordFieldPtr< Double > >, casacore::Vector< casacore::Slicer * >, casacore::Vector< casacore::SquareMatrix< Complex, 2 > >, casacore::Vector< casacore::String >, casacore::Vector< casacore::Unit >, casacore::Vector< casacore::Vector< Range > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< T >::BaseType >::base > >, casacore::Vector< DComplex >, casacore::Vector< Domain >, casacore::Vector< Double >, casacore::Vector< double >, casacore::Vector< Float >, casacore::Vector< FType >, casacore::Vector< Int >, casacore::Vector< Int64 >, casacore::Vector< LogicalArrayElem >, casacore::Vector< Range >, casacore::Vector< rownr_t >, casacore::Vector< size_t >, casacore::Vector< Type >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Vector< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Vector< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Vector< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Vector< typename casacore::FunctionTraits< T >::ArgType >, casacore::Vector< typename casacore::FunctionTraits< T >::BaseType >, casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, and casacore::Vector< uInt >.

## operator=() [1/2]

ArrayBase & casacore::ArrayBase::operator= | ( | ArrayBase && |  | ) |

noexcept

References ArrayBase().

## operator=() [2/2]

ArrayBase & casacore::ArrayBase::operator= | ( | const ArrayBase & |  | ) |

delete

References ArrayBase().

## putVStorage()

virtual void casacore::ArrayBase::putVStorage | ( | void *& | storage,
|  | bool | deleteAndCopy )

virtual

Reimplemented in casacore::Array< T >, casacore::Array< ArgType >, casacore::Array< Bool >, casacore::Array< casacore::AutoDiff< Double > >, casacore::Array< casacore::GaussianBeam >, casacore::Array< casacore::MDirection >, casacore::Array< casacore::MeasComet * >, casacore::Array< casacore::MFrequency >, casacore::Array< casacore::MPosition >, casacore::Array< casacore::MVFrequency >, casacore::Array< casacore::MVTime >, casacore::Array< casacore::Quantum< Double > >, casacore::Array< casacore::RigidVector< Double, 2 > >, casacore::Array< casacore::RORecordFieldPtr< Double > >, casacore::Array< casacore::Slicer * >, casacore::Array< casacore::SquareMatrix< Complex, 2 > >, casacore::Array< casacore::String >, casacore::Array< casacore::Unit >, casacore::Array< casacore::Vector< Range > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Array< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Array< Complex >, casacore::Array< DComplex >, casacore::Array< Domain >, casacore::Array< Double >, casacore::Array< double >, casacore::Array< Float >, casacore::Array< FType >, casacore::Array< Int >, casacore::Array< Int64 >, casacore::Array< LogicalArrayElem >, casacore::Array< M >, casacore::Array< MDirection >, casacore::Array< MDoppler >, casacore::Array< MEarthMagnetic >, casacore::Array< MEpoch >, casacore::Array< MFrequency >, casacore::Array< MPosition >, casacore::Array< MRadialVelocity >, casacore::Array< Range >, casacore::Array< rownr_t >, casacore::Array< Short >, casacore::Array< size_t >, casacore::Array< Type >, casacore::Array< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Array< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Array< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Array< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Array< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base >, casacore::Array< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base >, casacore::Array< typename casacore::NumericTraits< FType >::ConjugateType >, casacore::Array< uInt >, and casacore::const_iterator< GaussianBeam >.

Referenced by casacore::Adios2StManColumnT< T >::fromAdios().

## reformOrResize()

bool casacore::ArrayBase::reformOrResize | ( | const IPosition & | newShape,
|  | bool | resizeIfNeeded,
|  | size_t | nReferences,
|  | long long | nElementsAllocated,
|  | bool | copyDataIfNeeded,
|  | size_t | resizePercentage )

protected

Either reforms the array if size permits or resizes it to the new shape.

Implementation of Array<T>::reformOrResize (slightly different signature).

## resize()

virtual void casacore::ArrayBase::resize | ( | const IPosition & | newShape,
|  | bool | copyValues = false )

virtual

Resize the array and optionally copy the values.

The default implementation in ArrayBase throws an exception.

Reimplemented in casacore::Array< T >, casacore::Array< casacore::String >, casacore::Array< LogicalArrayElem >, casacore::const_iterator< GaussianBeam >, casacore::Vector< T >, casacore::Vector< casacore::String >, and casacore::Vector< LogicalArrayElem >.

## shape()

const IPosition & casacore::ArrayBase::shape | ( |  | ) | const

inline

The length of each axis.

Definition at line 123 of file ArrayBase.h.

References length_p.

Referenced by casacore::Array< LogicalArrayElem >::Array(), casacore::Array< LogicalArrayElem >::Array(), casacore::Array< LogicalArrayElem >::Array(), casacore::Array< LogicalArrayElem >::Array(), casacore::Array< LogicalArrayElem >::Array(), casacore::Array< LogicalArrayElem >::Array(), casacore::Array< LogicalArrayElem >::Array(), casacore::Array< LogicalArrayElem >::Array(), ArrayBase(), casacore::Array< LogicalArrayElem >::ArrayIterator< T >, baseReform(), casacore::checkArrayShapes(), casacore::ArrayMath_global_functions_Array_mathematical_operations::expandArray(), casacore::MArray< T >::fill(), casacore::ArrayMath_global_functions_Array_mathematical_operations::operator*(), casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/(), casacore::TableProxy::record2Array(), casacore::Array< LogicalArrayElem >::reform(), casacore::Array< LogicalArrayElem >::takeStorage(), and casacore::TableExprNodeSet::toArray().

## size()

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

inline

Definition at line 103 of file ArrayBase.h.

References nels_p.

Referenced by casacore::CoordinateSystem::_downcase(), casacore::ArrayLogical_global_functions_Array_logical_operations::allSame(), casacore::MArray< T >::flatten(), casacore::TableParseGroupby::singleKey(), and casacore::Vector< LogicalArrayElem >::Vector().

## steps()

const IPosition & casacore::ArrayBase::steps | ( |  | ) | const

inline

Return steps to be made if stepping one element in a dimension.

This is the 'physical' step, thus it also works correctly for non-contiguous arrays. E.g. data() + steps(0) gives the second element of the first axis.

Definition at line 134 of file ArrayBase.h.

References steps_p.

Referenced by casacore::ArrayMath_global_functions_Array_mathematical_operations::expandArray().

## swap()

void casacore::ArrayBase::swap | ( | ArrayBase & | source | ) |

protected noexcept

References ArrayBase().

## validateConformance()

void casacore::ArrayBase::validateConformance | ( | const ArrayBase & |  | ) | const

Various helper functions.

References ArrayBase().

## validateIndex() [1/4]

void casacore::ArrayBase::validateIndex | ( | const IPosition & |  | ) | const

Referenced by casacore::Vector< LogicalArrayElem >::operator()(), and casacore::Vector< LogicalArrayElem >::operator()().

## validateIndex() [2/4]

void casacore::ArrayBase::validateIndex | ( | size_t | index | ) | const

## validateIndex() [3/4]

void casacore::ArrayBase::validateIndex | ( | size_t | index1,
|  | size_t | index2 ) const

## validateIndex() [4/4]

void casacore::ArrayBase::validateIndex | ( | size_t | index1,
|  | size_t | index2,
|  | size_t | index3 ) const

## Member Data Documentation

## contiguous_p

bool casacore::ArrayBase::contiguous_p

protected

Are the data contiguous?

Definition at line 271 of file ArrayBase.h.

Referenced by contiguousStorage(), casacore::Matrix< LogicalArrayElem >::operator()(), casacore::Matrix< LogicalArrayElem >::operator()(), casacore::Vector< LogicalArrayElem >::operator[](), casacore::Vector< LogicalArrayElem >::operator[](), and casacore::Array< LogicalArrayElem >::setEndIter().

## inc_p

IPosition casacore::ArrayBase::inc_p

protected

Definition at line 274 of file ArrayBase.h.

Referenced by casacore::Cube< LogicalArrayElem >::index(), casacore::Cube< LogicalArrayElem >::index_continuous(), casacore::Vector< LogicalArrayElem >::operator()(), casacore::Vector< LogicalArrayElem >::operator()(), casacore::Vector< LogicalArrayElem >::operator[](), casacore::Vector< LogicalArrayElem >::operator[](), casacore::Cube< LogicalArrayElem >::xinc(), casacore::Matrix< LogicalArrayElem >::xinc(), casacore::Cube< LogicalArrayElem >::yinc(), casacore::Matrix< LogicalArrayElem >::yinc(), and casacore::Cube< LogicalArrayElem >::zinc().

## length_p

IPosition casacore::ArrayBase::length_p

protected

Used to hold the shape, increment into the underlying storage and originalLength of the array.

Definition at line 274 of file ArrayBase.h.

Referenced by conform2(), casacore::Cube< LogicalArrayElem >::ncolumn(), casacore::Matrix< LogicalArrayElem >::ncolumn(), casacore::Cube< LogicalArrayElem >::nplane(), casacore::Cube< LogicalArrayElem >::nrow(), casacore::Matrix< LogicalArrayElem >::nrow(), casacore::Array< LogicalArrayElem >::setEndIter(), shape(), casacore::Cube< LogicalArrayElem >::shape(), casacore::Cube< LogicalArrayElem >::shape(), casacore::Matrix< LogicalArrayElem >::shape(), casacore::Matrix< LogicalArrayElem >::shape(), casacore::Vector< LogicalArrayElem >::shape(), and casacore::Vector< LogicalArrayElem >::shape().

## ndimen_p

size_t casacore::ArrayBase::ndimen_p

protected

Dimensionality of the array.

Definition at line 269 of file ArrayBase.h.

Referenced by ndim().

## nels_p

size_t casacore::ArrayBase::nels_p

protected

Number of elements in the array.

Cached rather than computed.

Definition at line 267 of file ArrayBase.h.

Referenced by empty(), nelements(), casacore::Array< LogicalArrayElem >::setEndIter(), and size().

## originalLength_p

IPosition casacore::ArrayBase::originalLength_p

protected

Definition at line 274 of file ArrayBase.h.

Referenced by casacore::Cube< LogicalArrayElem >::index(), casacore::Cube< LogicalArrayElem >::index_continuous(), casacore::Cube< LogicalArrayElem >::yinc(), casacore::Matrix< LogicalArrayElem >::yinc(), and casacore::Cube< LogicalArrayElem >::zinc().

## steps_p

IPosition casacore::ArrayBase::steps_p

protected

Used to hold the step to next element in each dimension.

Definition at line 276 of file ArrayBase.h.

Referenced by casacore::Array< LogicalArrayElem >::setEndIter(), and steps().

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

- casa/Arrays/ArrayBase.h