casa
5.7.0-16
|
template <class T, class U> class vector; More...
#include <MSFlagger.h>
Classes | |
class | BaseIteratorSTL |
See the function begin() and end() for a detailed description of the STL iterator capability. More... | |
class | ConstIteratorSTL |
class | IteratorSTL |
Public Member Functions | |
Array () | |
Result has dimensionality of zero, and nelements is zero. More... | |
Array (const IPosition &shape) | |
Create an array of the given shape, i.e. More... | |
Array (const IPosition &shape, ArrayInitPolicy initPolicy) | |
Create an array of the given shape, i.e. More... | |
Array (const IPosition &shape, const T &initialValue) | |
Create an array of the given shape and initialize it with the initial value. More... | |
Array (const Array< T > &other) | |
After construction, this and other reference the same storage. More... | |
Array (const IPosition &shape, T *storage, StorageInitPolicy policy=COPY) | |
Create an Array of a given shape from a pointer. More... | |
Array (const IPosition &shape, T *storage, StorageInitPolicy policy, AbstractAllocator< T > const &allocator) | |
Create an Array of a given shape from a pointer. More... | |
Array (const IPosition &shape, const T *storage) | |
Create an Array of a given shape from a pointer. More... | |
virtual | ~Array () |
Frees up storage only if this array was the last reference to it. More... | |
virtual CountedPtr< ArrayBase > | makeArray () const |
Make an empty array of the same template type. More... | |
virtual void | assign (const Array< T > &other) |
Assign the other array to this array. More... | |
virtual void | assignBase (const ArrayBase &other, Bool checkType=True) |
Assign the source array to this array. More... | |
void | set (const T &value) |
Set every element of the array to "value." Also could use the assignment operator which assigns an array from a scalar. More... | |
void | apply (T(*function)(T)) |
Apply the function to every element of the array. More... | |
void | apply (T(*function)(const T &)) |
This version takes a function which takes a const T reference and returns a T. More... | |
void | apply (const Functional< T, T > &function) |
This version applies a functional. More... | |
virtual void | reference (const Array< T > &other) |
After invocation, this array and other reference the same storage. More... | |
virtual Array< T > & | operator= (const Array< T > &other) |
Copy the values in other to this. More... | |
Array< T > & | operator= (const T &value) |
Set every element of this array to "value". More... | |
Array< T > & | operator= (const MaskedArray< T > &marray) |
Copy to this those values in marray whose corresponding elements in marray's mask are True. More... | |
Array< T > | copy (ArrayInitPolicy policy=ArrayInitPolicies::NO_INIT) const |
This makes a copy of the array and returns it. More... | |
void | copyMatchingPart (const Array< T > &from) |
This function copies the matching part of from array to this array. More... | |
void | unique () |
This ensures that this array does not reference any other storage. More... | |
template<class U > | |
void | tovector (vector< T, U > &out) const |
Create an STL vector from an Array. More... | |
vector< T > | tovector () const |
Array< T > | reform (const IPosition &shape) const |
It is occasionally useful to have an array which access the same storage appear to have a different shape. More... | |
bool | reformOrResize (const IPosition &newShape, uInt resizePercentage=0, Bool resizeIfNeeded=True) |
Having an array that can be reused without requiring reallocation can be useful for large arrays. More... | |
bool | adjustLastAxis (const IPosition &newShape, uInt resizePercentage=0, bool resizeIfNeeded=True) |
Use this method to extend or reduce the last dimension of an array. More... | |
size_t | capacity () const |
Returns the number of elements allocated. More... | |
Array< T > | nonDegenerate (uInt startingAxis=0, Bool throwIfError=True) const |
These member functions remove degenerate (ie. More... | |
Array< T > | nonDegenerate (const IPosition &ignoreAxes) const |
void | nonDegenerate (const Array< T > &other, uInt startingAxis=0, Bool throwIfError=True) |
void | nonDegenerate (const Array< T > &other, const IPosition &ignoreAxes) |
void | removeDegenerate (uInt startingAxis=0, Bool throwIfError=True) |
Remove degenerate axes from this Array object. More... | |
void | removeDegenerate (const IPosition &ignoreAxes) |
const Array< T > | addDegenerate (uInt numAxes) const |
This member function returns an Array reference with the specified number of extra axes, all of length one, appended to the end of the Array. More... | |
Array< T > | addDegenerate (uInt numAxes) |
virtual void | resize () |
Make this array a different shape. More... | |
virtual void | resize (const IPosition &newShape, Bool copyValues=False) |
Resize the array and optionally copy the values. More... | |
virtual void | resize (const IPosition &newShape, Bool copyValues, ArrayInitPolicy policy) |
Resize the array and optionally copy the values. More... | |
T & | operator() (const IPosition &) |
Access a single element of the array. More... | |
const T & | operator() (const IPosition &) const |
Array< T > | operator() (const IPosition &start, const IPosition &end) |
Get a reference to an array section extending from start to end (inclusive). More... | |
const Array< T > | operator() (const IPosition &start, const IPosition &end) const |
Array< T > | operator() (const IPosition &start, const IPosition &end, const IPosition &inc) |
Along the ith axis, every inc[i]'th element is chosen. More... | |
const Array< T > | operator() (const IPosition &start, const IPosition &end, const IPosition &inc) const |
Array< T > | operator() (const Slicer &) |
Get a reference to an array section using a Slicer. More... | |
const Array< T > | operator() (const Slicer &) const |
virtual CountedPtr< ArrayBase > | getSection (const Slicer &) const |
Get a reference to a section of an array. More... | |
Array< T > | operator[] (size_t i) const |
Get the subset given by the i-th value of the last axis. More... | |
Array< T > | diagonals (uInt firstAxis=0, Int64 diag=0) const |
Get the diagonal of each matrix part in the full array. More... | |
const MaskedArray< T > | operator() (const LogicalArray &mask) const |
The array is masked by the input LogicalArray. More... | |
MaskedArray< T > | operator() (const LogicalArray &mask) |
const MaskedArray< T > | operator() (const MaskedLogicalArray &mask) const |
The array is masked by the input MaskedLogicalArray. More... | |
MaskedArray< T > | operator() (const MaskedLogicalArray &mask) |
uInt | nrefs () const |
The number of references the underlying storage has assigned to it. More... | |
virtual Bool | ok () const |
Check to see if the Array is consistent. More... | |
Bool | conform (const Array< T > &other) const |
Are the shapes identical? More... | |
Bool | conform (const MaskedArray< T > &other) const |
T * | data () |
Get a pointer to the beginning of the array. More... | |
const T * | data () const |
T * | getStorage (Bool &deleteIt) |
Generally use of this should be shunned, except to use a FORTRAN routine or something similar. More... | |
const T * | getStorage (Bool &deleteIt) const |
virtual void * | getVStorage (Bool &deleteIt) |
The following functions behave the same as the corresponding getStorage functions in the derived templated Array class. More... | |
virtual const void * | getVStorage (Bool &deleteIt) const |
void | putStorage (T *&storage, Bool deleteAndCopy) |
putStorage() is normally called after a call to getStorage() (cf). More... | |
virtual void | putVStorage (void *&storage, Bool deleteAndCopy) |
void | freeStorage (const T *&storage, Bool deleteIt) const |
If deleteIt is set, delete "storage". More... | |
void | freeVStorage (const void *&storage, Bool deleteIt) const |
virtual void | takeStorage (const IPosition &shape, T *storage, StorageInitPolicy policy=COPY) |
Replace the data values with those in the pointer storage . More... | |
virtual void | takeStorage (const IPosition &shape, T *storage, StorageInitPolicy policy, AbstractAllocator< T > const &allocator) |
If policy is COPY , storage of a new copy is allocated by allocator . More... | |
virtual void | takeStorage (const IPosition &shape, const T *storage) |
Since the pointer is const, a copy is always taken. More... | |
virtual void | takeStorage (const IPosition &shape, const T *storage, AbstractAllocator< T > const &allocator) |
Since the pointer is const, a copy is always taken. More... | |
virtual CountedPtr < ArrayPositionIterator > | makeIterator (uInt byDim) const |
Create an ArrayIterator object of the correct type. More... | |
Public Member Functions inherited from casacore::ArrayBase | |
ArrayBase () | |
ArrayBase (const IPosition &shape) | |
Create an array of the given shape, i.e. More... | |
ArrayBase (const ArrayBase &other) | |
Copy constructor. More... | |
ArrayBase & | operator= (const ArrayBase &) |
Assignment. More... | |
virtual | ~ArrayBase () |
Destructor. More... | |
uInt | ndim () const |
The dimensionality of this array. More... | |
size_t | nelements () const |
How many elements does this array have? Product of all axis lengths. More... | |
size_t | size () const |
Bool | empty () const |
Is the array empty (i.e. More... | |
Bool | contiguousStorage () const |
Are the array data contiguous? If they are not contiguous, getStorage (see below) needs to make a copy. More... | |
const IPosition & | shape () const |
The length of each axis. More... | |
IPosition | endPosition () const |
A convenience function: endPosition(i) = shape(i) - 1; i.e. More... | |
const IPosition & | steps () const |
Return steps to be made if stepping one element in a dimension. More... | |
void | validateConformance (const ArrayBase &) const |
Various helper functions. More... | |
void | validateIndex (const IPosition &) const |
void | validateIndex (uInt index) const |
void | validateIndex (uInt index1, uInt index2) const |
void | validateIndex (uInt index1, uInt index2, uInt index3) const |
Friends | |
class | ArrayIterator< T > |
Used to iterate through Arrays. More... | |
class | Matrix< T > |
Needed to be a friend for Matrix<T>::reference() More... | |
typedef T | value_type |
Define the STL-style iterator functions (only forward iterator). More... | |
typedef IteratorSTL | iterator |
typedef ConstIteratorSTL | const_iterator |
typedef T * | contiter |
typedef const T * | const_contiter |
CountedPtr< Block< T > > | data_p |
Reference counted block that contains the storage. More... | |
T * | begin_p |
This pointer is adjusted to point to the first element of the array. More... | |
T * | end_p |
The end for an STL-style iteration. More... | |
iterator | begin () |
Get the begin iterator object for any array. More... | |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
contiter | cbegin () |
Get the begin iterator object for a contiguous array. More... | |
const_contiter | cbegin () const |
contiter | cend () |
const_contiter | cend () const |
Array (Allocator_private::AllocSpec< T > allocator) | |
Array (const IPosition &shape, ArrayInitPolicy initPolicy, Allocator_private::BulkAllocator< T > *allocator) | |
Array< T > | copy (ArrayInitPolicy policy, Allocator_private::BulkAllocator< T > *allocator) const |
Makes a copy using the allocator. More... | |
Allocator_private::BulkAllocator < T > * | nonNewDelAllocator () const |
If the current allocator is NewDelAllocator<T>, BulkAllocator for DefaultAllocator<T> is returned, otherwise BulkAllocator for the current allocator is returned. More... | |
static ArrayInitPolicy | defaultArrayInitPolicy () |
static void | copyToContiguousStorage (T *dst, Array< T > const &src, ArrayInitPolicy policy) |
virtual void | preTakeStorage (const IPosition &) |
pre/post processing hook of takeStorage() for subclasses. More... | |
virtual void | postTakeStorage () |
virtual void | doNonDegenerate (const Array< T > &other, const IPosition &ignoreAxes) |
Remove the degenerate axes from the Array object. More... | |
void | makeSteps () |
Fill the steps and the end for a derived class. More... | |
void | setEndIter () |
Set the end iterator. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from casacore::ArrayBase | |
static uInt | arrayVersion () |
Array version for major change (used by ArrayIO). More... | |
Protected Member Functions inherited from casacore::ArrayBase | |
void | baseCopy (const ArrayBase &that) |
Bool | reformOrResize (const IPosition &newShape, Bool resizeIfNeeded, uInt nReferences, Int64 nElementsAllocated, Bool copyDataIfNeeded, uInt resizePercentage) |
Either reforms the array if size permits or resizes it to the new shape. More... | |
Bool | isStorageContiguous () const |
Determine if the storage of a subset is contiguous. More... | |
void | checkVectorShape () |
Check if the shape of a vector is correct. More... | |
void | checkMatrixShape () |
Check if the shape of a matrix is correct. More... | |
void | checkCubeShape () |
Check if the shape of a cube is correct. More... | |
void | baseReform (ArrayBase &tmp, const IPosition &shape, Bool strict=True) const |
Reform the array to a shape with the same nr of elements. More... | |
void | baseNonDegenerate (const ArrayBase &other, const IPosition &ignoreAxes) |
Remove the degenerate axes from the Array object. More... | |
void | baseAddDegenerate (ArrayBase &, uInt 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. More... | |
size_t | makeSubset (ArrayBase &out, const IPosition &b, const IPosition &e, const IPosition &i) |
Make a subset of an array. More... | |
size_t | makeDiagonal (uInt firstAxis, Int64 diag) |
Set the length and stride such that the diagonal of the matrices defined by two consecutive axes is formed. More... | |
Bool | conform2 (const ArrayBase &other) const |
Are the shapes identical? More... | |
void | baseMakeSteps () |
Make the indexing step sizes. More... | |
void | throwNdimVector () |
Throw expection if vector dimensionality is incorrect. More... | |
Bool | copyVectorHelper (const ArrayBase &other) |
Helper function for templated Vector class. More... | |
Protected Attributes inherited from casacore::ArrayBase | |
size_t | nels_p |
Number of elements in the array. More... | |
uInt | ndimen_p |
Dimensionality of the array. More... | |
Bool | contiguous_p |
Are the data contiguous? More... | |
IPosition | length_p |
Used to hold the shape, increment into the underlying storage and originalLength of the array. More... | |
IPosition | inc_p |
IPosition | originalLength_p |
IPosition | steps_p |
Used to hold the step to next element in each dimension. More... | |
template <class T, class U> class vector;
forward declarations:
A templated N-D Array class with zero origin Array<T> is a templated, N-dimensional, Array class. The origin is zero, but by default indices are zero-based. This Array class is the base class for specialized Vector<T>, Matrix<T>, and Cube<T> classes.
Indexing into the array, and positions in general, are given with IPosition (essentially a vector of integers) objects. That is, an N-dimensional array requires a length-N IPosition to define a position within the array. Unlike C, indexing is done with (), not []. Also, the storage order is the same as in FORTRAN, i.e. memory varies most rapidly with the first index.
Indexing into an N-dimensional array is relatively expensive. Normally you will index into a Vector, Matrix, or Cube. These may be obtained from an N-dimensional array by creating a reference, or by using an ArrayIterator. The "shape" of the array is an IPosition which gives the length of each axis.
An Array may be standalone, or it may refer to another array, or to part of another array (by refer we mean that if you change a pixel in the current array, a pixel in the referred to array also changes, i.e. they share underlying storage).
Warning: One way one array can reference another is through the copy constructor; While this might be what you want, you should probably use the reference() member function to make it explicit; The copy constructor is used when arguments are passed by value; normally functions should not pass Arrays by value, rather they should pass a reference or a const reference; On the positive side, returning an array from a function is efficient since no copying need be done;
Aside from the explicit reference() member function, a user will most commonly encounter an array which references another array when he takes an array slice (or section). A slice is a sub-region of an array (which might also have a stride: every nth row, every mth column, ...).
While the last example has an array slice referenced explicitly by another array variable, normally the user will often only use the slice as a temporary in an expresion, for example:
The Array classes are intended to operate on relatively large amounts of data. While they haven't been extensively tuned yet, they are relatively efficient in terms of speed. Presently they are not space efficient – the overhead is about 15 words. While this will be improved (probably to about 1/2 that), these array classes are not appropriate for very large numbers of very small arrays. The Block<T> class may be what you want in this circumstance.
Element by element mathematical and logical operations are available for arrays (defined in aips/ArrayMath.h and aips/ArrayLogical.h). Because arithmetic and logical functions are split out, it is possible to create an Array<T> (and hence Vector<T> etc) for any type T that has a default constructor, assignment operator, and copy constructor. In particular, Array<String> works.
If compiled with the preprocessor symbol AIPS_DEBUG symbol, array consistency ("invariants") will be checked in most member functions, and indexing will be range-checked. This should not be defined for production runs.
Tip: Most of the data members and functions which are "protected" should likely become "private";
Definition at line 37 of file MSFlagger.h.
typedef const T* casacore::Array< T >::const_contiter |
typedef ConstIteratorSTL casacore::Array< T >::const_iterator |
typedef T* casacore::Array< T >::contiter |
typedef IteratorSTL casacore::Array< T >::iterator |
typedef T casacore::Array< T >::value_type |
Define the STL-style iterator functions (only forward iterator).
It makes it possible to iterate through all data elements of an array and to use it common STL functions. The end() function is relatively expensive, so it should not be used inside a for statement. It is much better to call it beforehand as shown in the example below. Furthermore it is very important to use ++iter
, because iter++
is 4 times slower.
The Array class supports random access, so in principle a random iterator could be implemented, but its performance would not be great, especially for non-contiguous arrays.
Some other STL like functions exist for performance reasons. If the array is contiguous, it is possible to use the cbegin
and cend
functions which are about 10% faster. STL-style typedefs.
casacore::Array< T >::Array | ( | ) |
Result has dimensionality of zero, and nelements is zero.
Storage will be allocated by DefaultAllocator<T>
.
|
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. Storage is allocated by DefaultAllocator<T>
. Without initPolicy parameter, the initialization of elements depends on type T
. When T
is a fundamental type like int
, elements are NOT initialized. When T
is a class type like casacore::Complex
or std::string
, elements are initialized. This inconsistent behavior confuses programmers and make it hard to write efficient and generic code using template. Especially when T
is of type Complex
or DComplex
and it is unnecessary to initialize, provide initPolicy with value NO_INIT
to skip the initialization. Therefore, it is strongly recommended to explicitly provide initPolicy parameter,
casacore::Array< T >::Array | ( | const IPosition & | shape, |
ArrayInitPolicy | initPolicy | ||
) |
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. Storage is allocated by DefaultAllocator<T>
. When initPolicy parameter is INIT
, elements are initialized with the default value of T()
. When initPolicy parameter is NO_INIT
, elements are NOT initialized and programmers are responsible to initialize elements before they are referred, especially when T
is such type like std::string
.
casacore::Array< T >::Array | ( | const IPosition & | shape, |
const T & | initialValue | ||
) |
Create an array of the given shape and initialize it with the initial value.
Storage is allocated by DefaultAllocator<T>
.
casacore::Array< T >::Array | ( | const Array< T > & | other | ) |
After construction, this and other reference the same storage.
casacore::Array< T >::Array | ( | const IPosition & | shape, |
T * | storage, | ||
StorageInitPolicy | policy = COPY |
||
) |
Create an Array of a given shape from a pointer.
If policy
is COPY
, storage of a new copy is allocated by DefaultAllocator<T>
. If policy
is TAKE_OVER
, storage
will be destructed and released by NewDelAllocator<T>
. It is strongly recommended to supply an appropriate allocator
argument explicitly whenever policy
== TAKE_OVER
to let Array
to know how to release the storage
.
casacore::Array< T >::Array | ( | const IPosition & | shape, |
T * | storage, | ||
StorageInitPolicy | policy, | ||
AbstractAllocator< T > const & | allocator | ||
) |
Create an Array of a given shape from a pointer.
If policy
is COPY
, storage of a new copy is allocated by the specified allocator. If policy
is TAKE_OVER
, storage
will be destructed and released by the specified allocator. Otherwise, allocator
is ignored. It is strongly recommended to allocate and initialize storage
with DefaultAllocator<T>
rather than new[] or NewDelAllocator<T>
because new[] can't decouple allocation and initialization. DefaultAllocator<T>
is a subclass of std::allocator. You can allocate storage
via the allocator as below.
casacore::Array< T >::Array | ( | const IPosition & | shape, |
const T * | storage | ||
) |
Create an Array of a given shape from a pointer.
Because the pointer is const, a copy is always made. The copy is allocated by DefaultAllocator<T>
.
|
virtual |
Frees up storage only if this array was the last reference to it.
|
private |
|
private |
const Array<T> casacore::Array< T >::addDegenerate | ( | uInt | numAxes | ) | const |
Array<T> casacore::Array< T >::addDegenerate | ( | uInt | numAxes | ) |
bool casacore::Array< T >::adjustLastAxis | ( | const IPosition & | newShape, |
uInt | resizePercentage = 0 , |
||
bool | resizeIfNeeded = True |
||
) |
Use this method to extend or reduce the last dimension of an array.
If sufficient excess capacity exists then the bookkeeping is adjusted to support the new shape. If insufficient storage exists then a new array is allocated (unless resizeIfNeeded is false; then an exception is thrown). If resizing is not required then the data remains untouched; if resizing is required then the data is copied into the new storage. The resizePercentage works the same as for reformOrResize (see above). This method never releases extra storage; use "resize" to do this. Array may not be sharing storage with another array at call time; an exception will be thrown if the array is shared. Returns true if the array was extension required a Array<T>::resize operation.
void casacore::Array< T >::apply | ( | T(*)(T) | function | ) |
Apply the function to every element of the array.
This modifies the array in place.
This version takes a function which takes a T and returns a T.
void casacore::Array< T >::apply | ( | T(*)(const T &) | function | ) |
This version takes a function which takes a const T reference and returns a T.
void casacore::Array< T >::apply | ( | const Functional< T, T > & | function | ) |
This version applies a functional.
|
virtual |
Assign the other array to this array.
If the shapes mismatch, this array is resized.
Reimplemented in casacore::Vector< T >, casacore::Vector< casacore::casacore::MFrequency >, casacore::Vector< casacore::casacore::String >, casacore::Vector< casacore::casacore::Quantum >, casacore::Vector< Float >, casacore::Vector< Double >, casacore::Vector< casacore::DComplex >, casacore::Vector< casacore::Float >, casacore::Vector< Int >, casacore::Vector< Int64 >, casacore::Vector< casacore::Double >, casacore::Vector< FType >, casacore::Vector< Bool >, casacore::Vector< casacore::uInt >, casacore::Vector< casacore::casacore::MDirection >, casacore::Vector< casacore::Complex >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Bool >, casacore::Vector< casacore::String >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< Float >, casacore::Matrix< Double >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< casacore::Double >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< Complex >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, casacore::Cube< T >, casacore::Cube< Double >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, and casacore::Cube< casacore::Complex >.
|
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 from casacore::ArrayBase.
|
inline |
Get the begin iterator object for any array.
Definition at line 856 of file Array.h.
Referenced by casacore::MArrayLogical_global_functions_MArray_logical_operations::allEQ(), casacore::MArrayLogical_global_functions_MArray_logical_operations::anyEQ(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::avdev(), casacore::python::to_list< casacore::Array< casacore::String > >::makeobject(), casacore::python::to_list< casacore::Vector< casacore::String > >::makeobject(), 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(), casa::spwInfo::update(), and casacore::MArrayMath_global_functions_MArray_mathematical_operations::variance().
|
inline |
size_t casacore::Array< T >::capacity | ( | ) | const |
Returns the number of elements allocated.
This value is >= to the value returned by size().
|
inline |
Get the begin iterator object for a contiguous array.
Definition at line 868 of file Array.h.
Referenced by casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), 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().
|
inline |
|
inline |
Definition at line 872 of file Array.h.
Referenced by casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), and casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace().
|
inline |
|
inline |
Bool casacore::Array< T >::conform | ( | const MaskedArray< T > & | other | ) | const |
Array<T> casacore::Array< T >::copy | ( | ArrayInitPolicy | policy = ArrayInitPolicies::NO_INIT | ) | const |
This makes a copy of the array and returns it.
This can be useful for, e.g. making working copies of function arguments that you can write into.
Note that since the copy constructor makes a reference, if we just created used to copy constructor, modifying "tmp" would also modify "arg". Clearly another alternative would simply be:
which likely would be simpler to understand. (Should copy() be deprecated and removed?)
Referenced by casa::VisBufferAsync::copyVector(), and casa::CalStats::stats().
|
private |
Makes a copy using the allocator.
void casacore::Array< T >::copyMatchingPart | ( | const Array< T > & | from | ) |
This function copies the matching part of from array to this array.
The matching part is the part with the minimum size for each axis. E.g. if this array has shape [4,5,6] and from array has shape [7,3], the matching part has shape [4,3].
Note it is used by the resize function if copyValues==True
.
|
staticprotected |
|
inline |
Get a pointer to the beginning of the array.
Note that the array may not be contiguous.
Definition at line 597 of file Array.h.
Referenced by casacore::ArrayLogical_global_functions_Array_logical_operations::allSame(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::boxedArrayMath(), casacore::MArray< T >::flatten(), casacore::LSQaips::getErrors(), casa::sdfiller::DataRecord::operator=(), casa::sdfiller::MSDataRecord::operator=(), casacore::MArrayMath_global_functions_MArray_mathematical_operations::partialArrayMath(), casacore::HDF5Record::readArr(), casa::ScantableFieldIterator::ScantableFieldIterator(), casa::ScantableFrequenciesIterator::ScantableFrequenciesIterator(), casa::ScantableSourceIterator::ScantableSourceIterator(), casacore::LSQaips::solve(), and casacore::HDF5Record::writeArr().
|
inline |
|
inlinestaticprotected |
Array<T> casacore::Array< T >::diagonals | ( | uInt | firstAxis = 0 , |
Int64 | diag = 0 |
||
) | const |
Get the diagonal of each matrix part in the full array.
The matrices are taken using axes firstAxes and firstAxis+1. diag==0 is main diagonal; diag>0 above the main diagonal; diag<0 below.
|
protectedvirtual |
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.
Reimplemented in casacore::Cube< T >, casacore::Cube< Double >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, casacore::Cube< casacore::Complex >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< Float >, casacore::Matrix< Double >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< casacore::Double >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< Complex >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, casacore::Vector< T >, casacore::Vector< casacore::casacore::MFrequency >, casacore::Vector< casacore::casacore::String >, casacore::Vector< casacore::casacore::Quantum >, casacore::Vector< Float >, casacore::Vector< Double >, casacore::Vector< casacore::DComplex >, casacore::Vector< casacore::Float >, casacore::Vector< Int >, casacore::Vector< Int64 >, casacore::Vector< casacore::Double >, casacore::Vector< FType >, casacore::Vector< Bool >, casacore::Vector< casacore::uInt >, casacore::Vector< casacore::casacore::MDirection >, casacore::Vector< casacore::Complex >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Bool >, and casacore::Vector< casacore::String >.
Referenced by casacore::Array< casacore::String >::nonDegenerate().
|
inline |
Definition at line 860 of file Array.h.
Referenced by casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace(), casacore::python::to_list< casacore::Array< casacore::String > >::makeobject(), casacore::python::to_list< casacore::Vector< casacore::String > >::makeobject(), and casa::spwInfo::update().
|
inline |
void casacore::Array< T >::freeStorage | ( | const T *& | storage, |
Bool | deleteIt | ||
) | const |
If deleteIt is set, delete "storage".
Normally freeStorage calls will follow calls to getStorage. The reason the pointer is "const" is because only const pointers are released from const arrays. The "storage" pointer is set to zero.
Referenced by casa::SakuraArrayConverter::ConvertCASAToSakura().
|
virtual |
Reimplemented from casacore::ArrayBase.
|
virtual |
Get a reference to a section of an array.
This is the same as operator(), but can be used in a type-agnostic way.
Reimplemented from casacore::ArrayBase.
T* casacore::Array< T >::getStorage | ( | Bool & | deleteIt | ) |
Generally use of this should be shunned, except to use a FORTRAN routine or something similar.
Because you can't know the state of the underlying data layout (in particular, if there are increments) sometimes the pointer returned will be to a copy, but often this won't be necessary. A boolean is returned which tells you if this is a copy (and hence the storage must be deleted). Note that if you don't do anything unusual, getStorage followed by freeStorage or putStorage will do the deletion for you (if required). e.g.:
NB: However, if you only use getStorage, you will have to delete the pointer yourself using freeStorage().
It would probably be useful to have corresponding "copyin" "copyout" functions that used a user supplied buffer. Note that deleteIt is set in this function.
Referenced by casa::SkyCal< DataType, CalDataType >::apply(), casa::VisibilityResamplerBase::cacheAxisIncrements(), casa::SakuraArrayConverter::ConvertCASAToSakura(), casa::SakuraArrayConverter::ConvertSakuraToCASA(), casa::ProtoVR::DataToGrid(), casa::SkyCal< DataType, CalDataType >::flag(), and casacore::Array< casacore::String >::getStorage().
|
inline |
|
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 from casacore::ArrayBase.
|
virtual |
Reimplemented from casacore::ArrayBase.
|
virtual |
Make an empty array of the same template type.
Reimplemented from casacore::ArrayBase.
|
virtual |
Create an ArrayIterator object of the correct type.
Reimplemented from casacore::ArrayBase.
|
inlineprotected |
Array<T> casacore::Array< T >::nonDegenerate | ( | uInt | startingAxis = 0 , |
Bool | throwIfError = True |
||
) | const |
These member functions remove degenerate (ie.
length==1) axes from Arrays. Only axes greater than startingAxis are considered (normally one wants to remove trailing axes). The first two of these functions return an Array reference with axes removed. The latter two functions let this Array object reference the 'other' array with degenerated axes removed.
Unless throwIfError is False, an exception will be thrown if startingAxis exceeds the array's dimensionality.
The functions with argument ignoreAxes
do not consider the axes given in that argument. In this way it can be achieved that degenerate axes are kept.
Caution: When the two functions returning void
are invoked on a derived object (e;g; Matrix), an exception is thrown if removing the degenerate axes from other does not result in a correct number of axes;
Array<T> casacore::Array< T >::nonDegenerate | ( | const IPosition & | ignoreAxes | ) | const |
void casacore::Array< T >::nonDegenerate | ( | const Array< T > & | other, |
uInt | startingAxis = 0 , |
||
Bool | throwIfError = True |
||
) |
|
inline |
|
private |
If the current allocator is NewDelAllocator<T>, BulkAllocator for DefaultAllocator<T> is returned, otherwise BulkAllocator for the current allocator is returned.
uInt casacore::Array< T >::nrefs | ( | ) | const |
The number of references the underlying storage has assigned to it.
It is 1 unless there are outstanding references to the storage (e.g., through a slice). Normally you have no need to do this since the arrays handle all of the references for you.
|
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 from casacore::ArrayBase.
Reimplemented in casacore::Cube< T >, casacore::Cube< casacore::casacore::Cube< casacore::Float > >, casacore::Cube< casacore::CountedPtr< CFCell > >, casacore::Cube< Double >, casacore::Cube< float >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::casacore::CountedPtr< casa::CFCell > >, casacore::Cube< casacore::casacore::Cube< casacore::Bool > >, casacore::Cube< casacore::casacore::RigidVector< casacore::Double, 2 > >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, casacore::Cube< casacore::Complex >, casacore::Cube< casacore::RigidVector< Double, 2 > >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< casacore::SquareMatrix< Complex, 2 > >, casacore::Matrix< std::shared_ptr< casacore::casacore::MVDirection > >, casacore::Matrix< Float >, casacore::Matrix< casacore::GaussianBeam >, casacore::Matrix< Double >, casacore::Matrix< casa::CalStats::OUT< T > >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< std::vector< bool > >, casacore::Matrix< casacore::Double >, casacore::Matrix< casa::CStokesVector >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< casacore::casacore::CountedPtr< casa::CFBuffer > >, casacore::Matrix< Complex >, casacore::Matrix< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, casacore::Matrix< casa::VBStore >, casacore::Vector< T >, casacore::Vector< casa::AsciiAnnotationFileLine >, casacore::Vector< typename casacore::FunctionTraits< T >::DiffType >, casacore::Vector< casacore::casacore::MFrequency >, casacore::Vector< casacore::Vector< casacore::Int > >, casacore::Vector< casacore::casacore::String >, casacore::Vector< casacore::casacore::IPosition >, casacore::Vector< casacore::SquareMatrix< Complex, 2 > >, casacore::Vector< casacore::casacore::CountedPtr< casa::VisibilityResamplerBase > >, casacore::Vector< casacore::MPosition >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Vector< casacore::casacore::Quantum >, casacore::Vector< CFStore >, casacore::Vector< CFStore2 >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::BaseType >, casacore::Vector< casacore::casacore::Array< casacore::Float > >, casacore::Vector< casacore::casacore::MeasurementSet::PredefinedColumns >, casacore::Vector< double >, casacore::Vector< Float >, casacore::Vector< casa::AnnotationBase::Keyword >, casacore::Vector< typename casacore::FunctionTraits< Float >::ArgType >, casacore::Vector< typename casacore::FunctionTraits< Float >::DiffType >, casacore::Vector< casacore::AutoDiff< Double > >, casacore::Vector< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Vector< QString >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MDirection > >, casacore::Vector< casacore::casacore::RegularFile >, casacore::Vector< casacore::casacore::RigidVector< double, 2 > >, casacore::Vector< casacore::casacore::CountedPtr< casa::SkyJones > >, casacore::Vector< float >, casacore::Vector< casacore::Quantum >, casacore::Vector< Double >, casacore::Vector< casacore::casacore::Quantum< casacore::Double > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Array< casacore::Complex > > >, casacore::Vector< casacore::Vector< Range > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::Double > > > >, casacore::Vector< casacore::DComplex >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Slice > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::Double > > >, casacore::Vector< int >, casacore::Vector< AutoDiff< T > >, casacore::Vector< casacore::Float >, casacore::Vector< Vector< Double > >, casacore::Vector< casacore::casacore::CountedPtr< casa::refim::SkyJones > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::DiffType >, casacore::Vector< casacore::casacore::Vector< int > >, casacore::Vector< std::shared_ptr< casacore::casacore::MVFrequency > >, casacore::Vector< casa::SynthesisParamsSelect >, casacore::Vector< casa::DisplayPoint3 >, casacore::Vector< casacore::casacore::Vector< casacore::Int > >, casacore::Vector< casacore::casacore::Matrix< casacore::Int > >, casacore::Vector< casacore::casacore::MVBaseline >, casacore::Vector< casacore::CountedPtr< CFBuffer > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Float >::BaseType >::base > >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Vector< casacore::uInt64 >, casacore::Vector< casacore::Int64 >, casacore::Vector< casacore::casacore::MEpoch >, casacore::Vector< casacore::casacore::Slice >, casacore::Vector< casacore::Unit >, casacore::Vector< Int >, casacore::Vector< casacore::casacore::Vector< casacore::Double > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MVFrequency > >, casacore::Vector< Int64 >, casacore::Vector< casacore::casacore::MPosition >, casacore::Vector< casacore::MDirection >, casacore::Vector< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Vector< dbus::variant >, casacore::Vector< casacore::MFrequency >, casacore::Vector< casacore::RORecordFieldPtr< Double > >, casacore::Vector< casacore::casacore::Matrix< casacore::Double > >, casacore::Vector< casacore::Double >, casacore::Vector< Type >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::ArgType >, casacore::Vector< FType >, casacore::Vector< FitterType >, casacore::Vector< std::shared_ptr< casa::SIImageStore > >, casacore::Vector< Bool >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::String > >, casacore::Vector< typename casacore::casacore::NumericTraits< T >::ConjugateType >, casacore::Vector< std::map< std::pair< double, int >, int > >, casacore::Vector< casa::Flux< casacore::Double > >, casacore::Vector< casacore::casacore::RigidVector< casacore::Double, 3 > >, casacore::Vector< casacore::casacore::Vector< FuncTypes > >, casacore::Vector< typename casacore::FunctionTraits< T >::BaseType >, casacore::Vector< casacore::casacore::Matrix< casacore::Complex > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Array< casacore::DComplex > > >, casacore::Vector< std::pair< casacore::Quantity, casacore::Quantity > >, casacore::Vector< bool >, casacore::Vector< SAS >, casacore::Vector< typename casacore::FunctionTraits< T >::ArgType >, casacore::Vector< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Vector< casacore::casacore::PagedImage< casacore::Complex > * >, casacore::Vector< casacore::casacore::CountedPtr< casa::ResamplerWorklet > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Matrix< casacore::Double > > >, casacore::Vector< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Vector< casacore::casacore::SquareMatrix< casacore::Complex, 2 > >, casacore::Vector< casacore::casacore::MSSelection >, casacore::Vector< casacore::casacore::Vector< bool > >, casacore::Vector< casacore::Vector< casacore::Vector< casacore::Vector< casacore::Double > > > >, casacore::Vector< casacore::casacore::Stokes::StokesTypes >, casacore::Vector< casacore::casacore::Vector< casacore::uInt > >, casacore::Vector< casacore::Float * >, casacore::Vector< casacore::uInt >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MVAngle > >, casacore::Vector< ALMAAntennaType >, casacore::Vector< typename casacore::FunctionTraits< Float >::BaseType >, casacore::Vector< casacore::Vector >, casacore::Vector< casacore::Slicer * >, casacore::Vector< std::map< casacore::Double, casacore::casacore::MDirection > >, casacore::Vector< INTERPMETHOD >, casacore::Vector< casacore::casacore::RigidVector< casacore::Int, 2 > >, casacore::Vector< casacore::casacore::MDirection >, casacore::Vector< casacore::MeasComet * >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< T >::BaseType >::base > >, casacore::Vector< Domain >, casacore::Vector< casacore::Quantum< Double > >, casacore::Vector< casacore::Complex >, casacore::Vector< uInt >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Bool >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< casacore::Float >::BaseType >::base > >, casacore::Vector< vi::casa::vi::ViiLayerFactory * >, casacore::Vector< RFlagWord >, casacore::Vector< casacore::Vector< casacore::Complex > >, casacore::Vector< casa::BeamCalcGeometry >, casacore::Vector< casacore::String >, and casacore::Vector< ArgType >.
T& casacore::Array< T >::operator() | ( | const IPosition & | ) |
Access a single element of the array.
This is relatively expensive. Extensive indexing should be done through one of the Array specializations (Vector, Matrix, Cube). If AIPS_DEBUG is defined, index checking will be performed.
Referenced by casacore::Cube< casacore::RigidVector< Double, 2 > >::operator()(), casacore::Matrix< casa::VBStore >::operator()(), and casacore::Vector< ArgType >::operator()().
const T& casacore::Array< T >::operator() | ( | const IPosition & | ) | const |
Array<T> casacore::Array< T >::operator() | ( | const IPosition & | start, |
const IPosition & | end | ||
) |
Get a reference to an array section extending from start to end (inclusive).
const Array<T> casacore::Array< T >::operator() | ( | const IPosition & | start, |
const IPosition & | end | ||
) | const |
Array<T> casacore::Array< T >::operator() | ( | const IPosition & | start, |
const IPosition & | end, | ||
const IPosition & | inc | ||
) |
Along the ith axis, every inc[i]'th element is chosen.
const Array<T> casacore::Array< T >::operator() | ( | const IPosition & | start, |
const IPosition & | end, | ||
const IPosition & | inc | ||
) | const |
Array<T> casacore::Array< T >::operator() | ( | const Slicer & | ) |
Get a reference to an array section using a Slicer.
const Array<T> casacore::Array< T >::operator() | ( | const Slicer & | ) | const |
const MaskedArray<T> casacore::Array< T >::operator() | ( | const LogicalArray< T > & | mask | ) | const |
The array is masked by the input LogicalArray.
This mask must conform to the array.
MaskedArray<T> casacore::Array< T >::operator() | ( | const LogicalArray< T > & | mask | ) |
const MaskedArray<T> casacore::Array< T >::operator() | ( | const MaskedLogicalArray< T > & | mask | ) | const |
The array is masked by the input MaskedLogicalArray.
The mask is effectively the AND of the internal LogicalArray and the internal mask of the MaskedLogicalArray. The MaskedLogicalArray must conform to the array.
MaskedArray<T> casacore::Array< T >::operator() | ( | const MaskedLogicalArray< T > & | mask | ) |
|
virtual |
Copy the values in other to this.
If the array on the left hand side has no elements, then it is resized to be the same size as as the array on the right hand side. Otherwise, the arrays must conform (same shapes).
Note that the assign function can be used to assign a non-conforming array.
Reimplemented in casacore::Vector< T >, casacore::Vector< casacore::casacore::MFrequency >, casacore::Vector< casacore::casacore::String >, casacore::Vector< casacore::casacore::Quantum >, casacore::Vector< Float >, casacore::Vector< Double >, casacore::Vector< casacore::DComplex >, casacore::Vector< casacore::Float >, casacore::Vector< Int >, casacore::Vector< Int64 >, casacore::Vector< casacore::Double >, casacore::Vector< FType >, casacore::Vector< Bool >, casacore::Vector< casacore::uInt >, casacore::Vector< casacore::casacore::MDirection >, casacore::Vector< casacore::Complex >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Bool >, casacore::Vector< casacore::String >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< Float >, casacore::Matrix< Double >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< casacore::Double >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< Complex >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, casacore::Cube< T >, casacore::Cube< Double >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, and casacore::Cube< casacore::Complex >.
Referenced by casacore::Cube< casacore::RigidVector< Double, 2 > >::operator=(), casacore::Matrix< casa::VBStore >::operator=(), and casacore::Vector< ArgType >::operator=().
Array<T>& casacore::Array< T >::operator= | ( | const T & | value | ) |
Set every element of this array to "value".
In other words, a scalar behaves as if it were a constant conformant array.
Array<T>& casacore::Array< T >::operator= | ( | const MaskedArray< T > & | marray | ) |
Copy to this those values in marray whose corresponding elements in marray's mask are True.
Array<T> casacore::Array< T >::operator[] | ( | size_t | i | ) | const |
Get the subset given by the i-th value of the last axis.
So for a cube it returns the i-th xy plane. For a Matrix it returns the i-th row. The returned array references the original array data; its dimensionality is one less. For a 1-dim array it still returns a 1-dim array.
Note: This function should not be used in tight loops as it is (much) slower than iterating using begin() and end(), ArrayIter, or ArrayAccessor;
|
inlineprotectedvirtual |
Reimplemented in casacore::Cube< T >, casacore::Cube< casacore::casacore::Cube< casacore::Float > >, casacore::Cube< casacore::CountedPtr< CFCell > >, casacore::Cube< Double >, casacore::Cube< float >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::casacore::CountedPtr< casa::CFCell > >, casacore::Cube< casacore::casacore::Cube< casacore::Bool > >, casacore::Cube< casacore::casacore::RigidVector< casacore::Double, 2 > >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, casacore::Cube< casacore::Complex >, casacore::Cube< casacore::RigidVector< Double, 2 > >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< casacore::SquareMatrix< Complex, 2 > >, casacore::Matrix< std::shared_ptr< casacore::casacore::MVDirection > >, casacore::Matrix< Float >, casacore::Matrix< casacore::GaussianBeam >, casacore::Matrix< Double >, casacore::Matrix< casa::CalStats::OUT< T > >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< std::vector< bool > >, casacore::Matrix< casacore::Double >, casacore::Matrix< casa::CStokesVector >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< casacore::casacore::CountedPtr< casa::CFBuffer > >, casacore::Matrix< Complex >, casacore::Matrix< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, and casacore::Matrix< casa::VBStore >.
|
inlineprotectedvirtual |
pre/post processing hook of takeStorage() for subclasses.
Reimplemented in casacore::Cube< T >, casacore::Cube< casacore::casacore::Cube< casacore::Float > >, casacore::Cube< casacore::CountedPtr< CFCell > >, casacore::Cube< Double >, casacore::Cube< float >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::casacore::CountedPtr< casa::CFCell > >, casacore::Cube< casacore::casacore::Cube< casacore::Bool > >, casacore::Cube< casacore::casacore::RigidVector< casacore::Double, 2 > >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, casacore::Cube< casacore::Complex >, casacore::Cube< casacore::RigidVector< Double, 2 > >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< casacore::SquareMatrix< Complex, 2 > >, casacore::Matrix< std::shared_ptr< casacore::casacore::MVDirection > >, casacore::Matrix< Float >, casacore::Matrix< casacore::GaussianBeam >, casacore::Matrix< Double >, casacore::Matrix< casa::CalStats::OUT< T > >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< std::vector< bool > >, casacore::Matrix< casacore::Double >, casacore::Matrix< casa::CStokesVector >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< casacore::casacore::CountedPtr< casa::CFBuffer > >, casacore::Matrix< Complex >, casacore::Matrix< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, casacore::Matrix< casa::VBStore >, casacore::Vector< T >, casacore::Vector< casa::AsciiAnnotationFileLine >, casacore::Vector< typename casacore::FunctionTraits< T >::DiffType >, casacore::Vector< casacore::casacore::MFrequency >, casacore::Vector< casacore::Vector< casacore::Int > >, casacore::Vector< casacore::casacore::String >, casacore::Vector< casacore::casacore::IPosition >, casacore::Vector< casacore::SquareMatrix< Complex, 2 > >, casacore::Vector< casacore::casacore::CountedPtr< casa::VisibilityResamplerBase > >, casacore::Vector< casacore::MPosition >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Vector< casacore::casacore::Quantum >, casacore::Vector< CFStore >, casacore::Vector< CFStore2 >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::BaseType >, casacore::Vector< casacore::casacore::Array< casacore::Float > >, casacore::Vector< casacore::casacore::MeasurementSet::PredefinedColumns >, casacore::Vector< double >, casacore::Vector< Float >, casacore::Vector< casa::AnnotationBase::Keyword >, casacore::Vector< typename casacore::FunctionTraits< Float >::ArgType >, casacore::Vector< typename casacore::FunctionTraits< Float >::DiffType >, casacore::Vector< casacore::AutoDiff< Double > >, casacore::Vector< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Vector< QString >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MDirection > >, casacore::Vector< casacore::casacore::RegularFile >, casacore::Vector< casacore::casacore::RigidVector< double, 2 > >, casacore::Vector< casacore::casacore::CountedPtr< casa::SkyJones > >, casacore::Vector< float >, casacore::Vector< casacore::Quantum >, casacore::Vector< Double >, casacore::Vector< casacore::casacore::Quantum< casacore::Double > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Array< casacore::Complex > > >, casacore::Vector< casacore::Vector< Range > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::Double > > > >, casacore::Vector< casacore::DComplex >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Slice > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::Double > > >, casacore::Vector< int >, casacore::Vector< AutoDiff< T > >, casacore::Vector< casacore::Float >, casacore::Vector< Vector< Double > >, casacore::Vector< casacore::casacore::CountedPtr< casa::refim::SkyJones > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::DiffType >, casacore::Vector< casacore::casacore::Vector< int > >, casacore::Vector< std::shared_ptr< casacore::casacore::MVFrequency > >, casacore::Vector< casa::SynthesisParamsSelect >, casacore::Vector< casa::DisplayPoint3 >, casacore::Vector< casacore::casacore::Vector< casacore::Int > >, casacore::Vector< casacore::casacore::Matrix< casacore::Int > >, casacore::Vector< casacore::casacore::MVBaseline >, casacore::Vector< casacore::CountedPtr< CFBuffer > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Float >::BaseType >::base > >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Vector< casacore::uInt64 >, casacore::Vector< casacore::Int64 >, casacore::Vector< casacore::casacore::MEpoch >, casacore::Vector< casacore::casacore::Slice >, casacore::Vector< casacore::Unit >, casacore::Vector< Int >, casacore::Vector< casacore::casacore::Vector< casacore::Double > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MVFrequency > >, casacore::Vector< Int64 >, casacore::Vector< casacore::casacore::MPosition >, casacore::Vector< casacore::MDirection >, casacore::Vector< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Vector< dbus::variant >, casacore::Vector< casacore::MFrequency >, casacore::Vector< casacore::RORecordFieldPtr< Double > >, casacore::Vector< casacore::casacore::Matrix< casacore::Double > >, casacore::Vector< casacore::Double >, casacore::Vector< Type >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::ArgType >, casacore::Vector< FType >, casacore::Vector< FitterType >, casacore::Vector< std::shared_ptr< casa::SIImageStore > >, casacore::Vector< Bool >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::String > >, casacore::Vector< typename casacore::casacore::NumericTraits< T >::ConjugateType >, casacore::Vector< std::map< std::pair< double, int >, int > >, casacore::Vector< casa::Flux< casacore::Double > >, casacore::Vector< casacore::casacore::RigidVector< casacore::Double, 3 > >, casacore::Vector< casacore::casacore::Vector< FuncTypes > >, casacore::Vector< typename casacore::FunctionTraits< T >::BaseType >, casacore::Vector< casacore::casacore::Matrix< casacore::Complex > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Array< casacore::DComplex > > >, casacore::Vector< std::pair< casacore::Quantity, casacore::Quantity > >, casacore::Vector< bool >, casacore::Vector< SAS >, casacore::Vector< typename casacore::FunctionTraits< T >::ArgType >, casacore::Vector< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Vector< casacore::casacore::PagedImage< casacore::Complex > * >, casacore::Vector< casacore::casacore::CountedPtr< casa::ResamplerWorklet > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Matrix< casacore::Double > > >, casacore::Vector< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Vector< casacore::casacore::SquareMatrix< casacore::Complex, 2 > >, casacore::Vector< casacore::casacore::MSSelection >, casacore::Vector< casacore::casacore::Vector< bool > >, casacore::Vector< casacore::Vector< casacore::Vector< casacore::Vector< casacore::Double > > > >, casacore::Vector< casacore::casacore::Stokes::StokesTypes >, casacore::Vector< casacore::casacore::Vector< casacore::uInt > >, casacore::Vector< casacore::Float * >, casacore::Vector< casacore::uInt >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MVAngle > >, casacore::Vector< ALMAAntennaType >, casacore::Vector< typename casacore::FunctionTraits< Float >::BaseType >, casacore::Vector< casacore::Vector >, casacore::Vector< casacore::Slicer * >, casacore::Vector< std::map< casacore::Double, casacore::casacore::MDirection > >, casacore::Vector< INTERPMETHOD >, casacore::Vector< casacore::casacore::RigidVector< casacore::Int, 2 > >, casacore::Vector< casacore::casacore::MDirection >, casacore::Vector< casacore::MeasComet * >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< T >::BaseType >::base > >, casacore::Vector< Domain >, casacore::Vector< casacore::Quantum< Double > >, casacore::Vector< casacore::Complex >, casacore::Vector< uInt >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Bool >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< casacore::Float >::BaseType >::base > >, casacore::Vector< vi::casa::vi::ViiLayerFactory * >, casacore::Vector< RFlagWord >, casacore::Vector< casacore::Vector< casacore::Complex > >, casacore::Vector< casa::BeamCalcGeometry >, casacore::Vector< casacore::String >, and casacore::Vector< ArgType >.
void casacore::Array< T >::putStorage | ( | T *& | storage, |
Bool | deleteAndCopy | ||
) |
putStorage() is normally called after a call to getStorage() (cf).
The "storage" pointer is set to zero.
Referenced by casa::SkyCal< DataType, CalDataType >::apply(), casa::SakuraArrayConverter::ConvertSakuraToCASA(), and casa::SkyCal< DataType, CalDataType >::flag().
|
virtual |
Reimplemented from casacore::ArrayBase.
|
virtual |
After invocation, this array and other reference the same storage.
That is, modifying an element through one will show up in the other. The arrays appear to be identical; they have the same shape.
Please note that this function makes it possible to reference a const Array, thus effectively it makes a const Array non-const. Although this may seem undesirable at first sight, it is necessary to be able to make references to temporary Array objects, in particular to Array slices. Otherwise one first needs to use the copy constructor.
Reimplemented in casacore::Vector< T >, casacore::Vector< casacore::casacore::MFrequency >, casacore::Vector< casacore::casacore::String >, casacore::Vector< casacore::casacore::Quantum >, casacore::Vector< Float >, casacore::Vector< Double >, casacore::Vector< casacore::DComplex >, casacore::Vector< casacore::Float >, casacore::Vector< Int >, casacore::Vector< Int64 >, casacore::Vector< casacore::Double >, casacore::Vector< FType >, casacore::Vector< Bool >, casacore::Vector< casacore::uInt >, casacore::Vector< casacore::casacore::MDirection >, casacore::Vector< casacore::Complex >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Bool >, casacore::Vector< casacore::String >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< Float >, casacore::Matrix< Double >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< casacore::Double >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< Complex >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, casacore::Cube< T >, casacore::Cube< Double >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, and casacore::Cube< casacore::Complex >.
Referenced by casacore::ValueHolder::getValue(), and casacore::RecordInterface::toArray().
Array<T> casacore::Array< T >::reform | ( | const IPosition & | shape | ) | const |
It is occasionally useful to have an array which access the same storage appear to have a different shape.
For example, turning an N-dimensional array into a Vector.
When the array data are contiguous, the array can be reshaped to any form as long as the number of elements stays the same. When not contiguous, it is only possible to remove or add axes with length 1.
Referenced by casa::CalStats::stats(), and casacore::TableExprNodeSet::toArray().
bool casacore::Array< T >::reformOrResize | ( | const IPosition & | newShape, |
uInt | resizePercentage = 0 , |
||
Bool | resizeIfNeeded = True |
||
) |
Having an array that can be reused without requiring reallocation can be useful for large arrays.
The method reformOrResize permits this usage.
The reformOrResize method first attempts to reform the matrix so that it reuses the existing storage for an array with a new shape. If the existing storage will not hold the new shape, then the method will resize the array when resizeIfNeeded is true; if a resize is needed and resizeIfNeeded is false, then an ArrayConformanceError is thrown. The copyDataIfNeeded parameter is passed to resize if resizing is performed. resizePercentage is the percent of additional storage to be addeed when a resize is performed; this allows the allocations to be amortized when the caller expects to be calling this method again in the future. The parameter is used to define an allocation shape which is larger than the newShape by increasing the last dimension by resizePercentage percent (i.e., lastDim = (lastDim * (100 + resizePercentage)) / 100). If resizePercentage <= 0 then resizing uses newShape as-is. Returns true if resizing (allocation) was performed.
To truncate the array so that it no longer holds additional storage, use the resize method.
Array may not be shared with another Array object during this call. Exception thrown if it is shared.
void casacore::Array< T >::removeDegenerate | ( | uInt | startingAxis = 0 , |
Bool | throwIfError = True |
||
) |
Remove degenerate axes from this Array object.
Note it does not make sense to use these functions on a derived object like Matrix, because it is not possible to remove axes from them.
Referenced by casa::CalStats::stats().
void casacore::Array< T >::removeDegenerate | ( | const IPosition & | ignoreAxes | ) |
|
virtual |
Make this array a different shape.
If copyValues==True
the old values are copied over to the new array. Copying is done on a per axis basis, thus a subsection with the minimum of the old and new shape is copied.
Resize without argument is equal to resize(IPosition()).
It is important to note that if multiple Array objects reference the same data storage, this Array object still references the same data storage as the other Array objects if the shape does not change. Otherwise this Array object references newly allocated storage, while the other Array objects still reference the existing data storage.
If you want to be sure that the data storage of this Array object is not referenced by other Array objects, the function unique should be called first.
Reimplemented in casacore::Vector< T >, casacore::Vector< casa::AsciiAnnotationFileLine >, casacore::Vector< typename casacore::FunctionTraits< T >::DiffType >, casacore::Vector< casacore::casacore::MFrequency >, casacore::Vector< casacore::Vector< casacore::Int > >, casacore::Vector< casacore::casacore::String >, casacore::Vector< casacore::casacore::IPosition >, casacore::Vector< casacore::SquareMatrix< Complex, 2 > >, casacore::Vector< casacore::casacore::CountedPtr< casa::VisibilityResamplerBase > >, casacore::Vector< casacore::MPosition >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Vector< casacore::casacore::Quantum >, casacore::Vector< CFStore >, casacore::Vector< CFStore2 >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::BaseType >, casacore::Vector< casacore::casacore::Array< casacore::Float > >, casacore::Vector< casacore::casacore::MeasurementSet::PredefinedColumns >, casacore::Vector< double >, casacore::Vector< Float >, casacore::Vector< casa::AnnotationBase::Keyword >, casacore::Vector< typename casacore::FunctionTraits< Float >::ArgType >, casacore::Vector< typename casacore::FunctionTraits< Float >::DiffType >, casacore::Vector< casacore::AutoDiff< Double > >, casacore::Vector< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Vector< QString >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MDirection > >, casacore::Vector< casacore::casacore::RegularFile >, casacore::Vector< casacore::casacore::RigidVector< double, 2 > >, casacore::Vector< casacore::casacore::CountedPtr< casa::SkyJones > >, casacore::Vector< float >, casacore::Vector< casacore::Quantum >, casacore::Vector< Double >, casacore::Vector< casacore::casacore::Quantum< casacore::Double > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Array< casacore::Complex > > >, casacore::Vector< casacore::Vector< Range > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::Double > > > >, casacore::Vector< casacore::DComplex >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Slice > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::Double > > >, casacore::Vector< int >, casacore::Vector< AutoDiff< T > >, casacore::Vector< casacore::Float >, casacore::Vector< Vector< Double > >, casacore::Vector< casacore::casacore::CountedPtr< casa::refim::SkyJones > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::DiffType >, casacore::Vector< casacore::casacore::Vector< int > >, casacore::Vector< std::shared_ptr< casacore::casacore::MVFrequency > >, casacore::Vector< casa::SynthesisParamsSelect >, casacore::Vector< casa::DisplayPoint3 >, casacore::Vector< casacore::casacore::Vector< casacore::Int > >, casacore::Vector< casacore::casacore::Matrix< casacore::Int > >, casacore::Vector< casacore::casacore::MVBaseline >, casacore::Vector< casacore::CountedPtr< CFBuffer > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Float >::BaseType >::base > >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Vector< casacore::uInt64 >, casacore::Vector< casacore::Int64 >, casacore::Vector< casacore::casacore::MEpoch >, casacore::Vector< casacore::casacore::Slice >, casacore::Vector< casacore::Unit >, casacore::Vector< Int >, casacore::Vector< casacore::casacore::Vector< casacore::Double > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MVFrequency > >, casacore::Vector< Int64 >, casacore::Vector< casacore::casacore::MPosition >, casacore::Vector< casacore::MDirection >, casacore::Vector< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Vector< dbus::variant >, casacore::Vector< casacore::MFrequency >, casacore::Vector< casacore::RORecordFieldPtr< Double > >, casacore::Vector< casacore::casacore::Matrix< casacore::Double > >, casacore::Vector< casacore::Double >, casacore::Vector< Type >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::ArgType >, casacore::Vector< FType >, casacore::Vector< FitterType >, casacore::Vector< std::shared_ptr< casa::SIImageStore > >, casacore::Vector< Bool >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::String > >, casacore::Vector< typename casacore::casacore::NumericTraits< T >::ConjugateType >, casacore::Vector< std::map< std::pair< double, int >, int > >, casacore::Vector< casa::Flux< casacore::Double > >, casacore::Vector< casacore::casacore::RigidVector< casacore::Double, 3 > >, casacore::Vector< casacore::casacore::Vector< FuncTypes > >, casacore::Vector< typename casacore::FunctionTraits< T >::BaseType >, casacore::Vector< casacore::casacore::Matrix< casacore::Complex > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Array< casacore::DComplex > > >, casacore::Vector< std::pair< casacore::Quantity, casacore::Quantity > >, casacore::Vector< bool >, casacore::Vector< SAS >, casacore::Vector< typename casacore::FunctionTraits< T >::ArgType >, casacore::Vector< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Vector< casacore::casacore::PagedImage< casacore::Complex > * >, casacore::Vector< casacore::casacore::CountedPtr< casa::ResamplerWorklet > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Matrix< casacore::Double > > >, casacore::Vector< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Vector< casacore::casacore::SquareMatrix< casacore::Complex, 2 > >, casacore::Vector< casacore::casacore::MSSelection >, casacore::Vector< casacore::casacore::Vector< bool > >, casacore::Vector< casacore::Vector< casacore::Vector< casacore::Vector< casacore::Double > > > >, casacore::Vector< casacore::casacore::Stokes::StokesTypes >, casacore::Vector< casacore::casacore::Vector< casacore::uInt > >, casacore::Vector< casacore::Float * >, casacore::Vector< casacore::uInt >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MVAngle > >, casacore::Vector< ALMAAntennaType >, casacore::Vector< typename casacore::FunctionTraits< Float >::BaseType >, casacore::Vector< casacore::Vector >, casacore::Vector< casacore::Slicer * >, casacore::Vector< std::map< casacore::Double, casacore::casacore::MDirection > >, casacore::Vector< INTERPMETHOD >, casacore::Vector< casacore::casacore::RigidVector< casacore::Int, 2 > >, casacore::Vector< casacore::casacore::MDirection >, casacore::Vector< casacore::MeasComet * >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< T >::BaseType >::base > >, casacore::Vector< Domain >, casacore::Vector< casacore::Quantum< Double > >, casacore::Vector< casacore::Complex >, casacore::Vector< uInt >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Bool >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< casacore::Float >::BaseType >::base > >, casacore::Vector< vi::casa::vi::ViiLayerFactory * >, casacore::Vector< RFlagWord >, casacore::Vector< casacore::Vector< casacore::Complex > >, casacore::Vector< casa::BeamCalcGeometry >, casacore::Vector< casacore::String >, casacore::Vector< ArgType >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< casacore::SquareMatrix< Complex, 2 > >, casacore::Matrix< std::shared_ptr< casacore::casacore::MVDirection > >, casacore::Matrix< Float >, casacore::Matrix< casacore::GaussianBeam >, casacore::Matrix< Double >, casacore::Matrix< casa::CalStats::OUT< T > >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< std::vector< bool > >, casacore::Matrix< casacore::Double >, casacore::Matrix< casa::CStokesVector >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< casacore::casacore::CountedPtr< casa::CFBuffer > >, casacore::Matrix< Complex >, casacore::Matrix< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, casacore::Matrix< casa::VBStore >, casacore::Cube< T >, casacore::Cube< casacore::casacore::Cube< casacore::Float > >, casacore::Cube< casacore::CountedPtr< CFCell > >, casacore::Cube< Double >, casacore::Cube< float >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::casacore::CountedPtr< casa::CFCell > >, casacore::Cube< casacore::casacore::Cube< casacore::Bool > >, casacore::Cube< casacore::casacore::RigidVector< casacore::Double, 2 > >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, casacore::Cube< casacore::Complex >, and casacore::Cube< casacore::RigidVector< Double, 2 > >.
Referenced by casa::vi::VbCacheItem< casacore::Int >::clearValue(), casacore::TableExprGroupAggr::getArray(), casacore::MArrayBase::removeMask(), casa::SynthesisUtils::SETVEC(), and casa::refim::SynthesisUtils::SETVEC().
|
virtual |
Resize the array and optionally copy the values.
The default implementation in ArrayBase throws an exception.
Reimplemented from casacore::ArrayBase.
|
virtual |
Resize the array and optionally copy the values.
The default implementation in ArrayBase throws an exception.
Reimplemented from casacore::ArrayBase.
Reimplemented in casacore::Vector< T >, casacore::Vector< casa::AsciiAnnotationFileLine >, casacore::Vector< typename casacore::FunctionTraits< T >::DiffType >, casacore::Vector< casacore::casacore::MFrequency >, casacore::Vector< casacore::Vector< casacore::Int > >, casacore::Vector< casacore::casacore::String >, casacore::Vector< casacore::casacore::IPosition >, casacore::Vector< casacore::SquareMatrix< Complex, 2 > >, casacore::Vector< casacore::casacore::CountedPtr< casa::VisibilityResamplerBase > >, casacore::Vector< casacore::MPosition >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Double >::BaseType >::base > >, casacore::Vector< casacore::casacore::Quantum >, casacore::Vector< CFStore >, casacore::Vector< CFStore2 >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::DiffType >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::BaseType >, casacore::Vector< casacore::casacore::Array< casacore::Float > >, casacore::Vector< casacore::casacore::MeasurementSet::PredefinedColumns >, casacore::Vector< double >, casacore::Vector< Float >, casacore::Vector< casa::AnnotationBase::Keyword >, casacore::Vector< typename casacore::FunctionTraits< Float >::ArgType >, casacore::Vector< typename casacore::FunctionTraits< Float >::DiffType >, casacore::Vector< casacore::AutoDiff< Double > >, casacore::Vector< typename casacore::FunctionTraits< Double >::DiffType >, casacore::Vector< QString >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MDirection > >, casacore::Vector< casacore::casacore::RegularFile >, casacore::Vector< casacore::casacore::RigidVector< double, 2 > >, casacore::Vector< casacore::casacore::CountedPtr< casa::SkyJones > >, casacore::Vector< float >, casacore::Vector< casacore::Quantum >, casacore::Vector< Double >, casacore::Vector< casacore::casacore::Quantum< casacore::Double > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Array< casacore::Complex > > >, casacore::Vector< casacore::Vector< Range > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::Double > > > >, casacore::Vector< casacore::DComplex >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Slice > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::Vector< casacore::Double > > >, casacore::Vector< int >, casacore::Vector< AutoDiff< T > >, casacore::Vector< casacore::Float >, casacore::Vector< Vector< Double > >, casacore::Vector< casacore::casacore::CountedPtr< casa::refim::SkyJones > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< DComplex >::BaseType >::base > >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::DiffType >, casacore::Vector< casacore::casacore::Vector< int > >, casacore::Vector< std::shared_ptr< casacore::casacore::MVFrequency > >, casacore::Vector< casa::SynthesisParamsSelect >, casacore::Vector< casa::DisplayPoint3 >, casacore::Vector< casacore::casacore::Vector< casacore::Int > >, casacore::Vector< casacore::casacore::Matrix< casacore::Int > >, casacore::Vector< casacore::casacore::MVBaseline >, casacore::Vector< casacore::CountedPtr< CFBuffer > >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< Float >::BaseType >::base > >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::ArgType >, casacore::Vector< casacore::uInt64 >, casacore::Vector< casacore::Int64 >, casacore::Vector< casacore::casacore::MEpoch >, casacore::Vector< casacore::casacore::Slice >, casacore::Vector< casacore::Unit >, casacore::Vector< Int >, casacore::Vector< casacore::casacore::Vector< casacore::Double > >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MVFrequency > >, casacore::Vector< Int64 >, casacore::Vector< casacore::casacore::MPosition >, casacore::Vector< casacore::MDirection >, casacore::Vector< typename casacore::FunctionTraits< Double >::ArgType >, casacore::Vector< dbus::variant >, casacore::Vector< casacore::MFrequency >, casacore::Vector< casacore::RORecordFieldPtr< Double > >, casacore::Vector< casacore::casacore::Matrix< casacore::Double > >, casacore::Vector< casacore::Double >, casacore::Vector< Type >, casacore::Vector< typename casacore::FunctionTraits< DComplex >::BaseType >, casacore::Vector< typename casacore::FunctionTraits< casacore::Float >::ArgType >, casacore::Vector< FType >, casacore::Vector< FitterType >, casacore::Vector< std::shared_ptr< casa::SIImageStore > >, casacore::Vector< Bool >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::String > >, casacore::Vector< typename casacore::casacore::NumericTraits< T >::ConjugateType >, casacore::Vector< std::map< std::pair< double, int >, int > >, casacore::Vector< casa::Flux< casacore::Double > >, casacore::Vector< casacore::casacore::RigidVector< casacore::Double, 3 > >, casacore::Vector< casacore::casacore::Vector< FuncTypes > >, casacore::Vector< typename casacore::FunctionTraits< T >::BaseType >, casacore::Vector< casacore::casacore::Matrix< casacore::Complex > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Array< casacore::DComplex > > >, casacore::Vector< std::pair< casacore::Quantity, casacore::Quantity > >, casacore::Vector< bool >, casacore::Vector< SAS >, casacore::Vector< typename casacore::FunctionTraits< T >::ArgType >, casacore::Vector< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Vector< casacore::casacore::PagedImage< casacore::Complex > * >, casacore::Vector< casacore::casacore::CountedPtr< casa::ResamplerWorklet > >, casacore::Vector< casacore::casacore::CountedPtr< casacore::casacore::Matrix< casacore::Double > > >, casacore::Vector< typename casacore::FunctionTraits< Double >::BaseType >, casacore::Vector< casacore::casacore::SquareMatrix< casacore::Complex, 2 > >, casacore::Vector< casacore::casacore::MSSelection >, casacore::Vector< casacore::casacore::Vector< bool > >, casacore::Vector< casacore::Vector< casacore::Vector< casacore::Vector< casacore::Double > > > >, casacore::Vector< casacore::casacore::Stokes::StokesTypes >, casacore::Vector< casacore::casacore::Vector< casacore::uInt > >, casacore::Vector< casacore::Float * >, casacore::Vector< casacore::uInt >, casacore::Vector< casacore::casacore::Vector< casacore::casacore::MVAngle > >, casacore::Vector< ALMAAntennaType >, casacore::Vector< typename casacore::FunctionTraits< Float >::BaseType >, casacore::Vector< casacore::Vector >, casacore::Vector< casacore::Slicer * >, casacore::Vector< std::map< casacore::Double, casacore::casacore::MDirection > >, casacore::Vector< INTERPMETHOD >, casacore::Vector< casacore::casacore::RigidVector< casacore::Int, 2 > >, casacore::Vector< casacore::casacore::MDirection >, casacore::Vector< casacore::MeasComet * >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< T >::BaseType >::base > >, casacore::Vector< Domain >, casacore::Vector< casacore::Quantum< Double > >, casacore::Vector< casacore::Complex >, casacore::Vector< uInt >, casacore::Vector< casacore::Int >, casacore::Vector< casacore::Bool >, casacore::Vector< casacore::Vector< typename casacore::LSQTraits< typename casacore::FunctionTraits< casacore::Float >::BaseType >::base > >, casacore::Vector< vi::casa::vi::ViiLayerFactory * >, casacore::Vector< RFlagWord >, casacore::Vector< casacore::Vector< casacore::Complex > >, casacore::Vector< casa::BeamCalcGeometry >, casacore::Vector< casacore::String >, casacore::Vector< ArgType >, casacore::Matrix< T >, casacore::Matrix< casacore::casacore::String >, casacore::Matrix< casacore::SquareMatrix< Complex, 2 > >, casacore::Matrix< std::shared_ptr< casacore::casacore::MVDirection > >, casacore::Matrix< Float >, casacore::Matrix< casacore::GaussianBeam >, casacore::Matrix< Double >, casacore::Matrix< casa::CalStats::OUT< T > >, casacore::Matrix< casacore::Float >, casacore::Matrix< Int >, casacore::Matrix< std::vector< bool > >, casacore::Matrix< casacore::Double >, casacore::Matrix< casa::CStokesVector >, casacore::Matrix< FType >, casacore::Matrix< Bool >, casacore::Matrix< casacore::casacore::CountedPtr< casa::CFBuffer > >, casacore::Matrix< Complex >, casacore::Matrix< casacore::casacore::CountedPtr< casa::refim::CFBuffer > >, casacore::Matrix< casacore::uInt >, casacore::Matrix< casacore::Bool >, casacore::Matrix< casacore::Int >, casacore::Matrix< casacore::Complex >, casacore::Matrix< casa::VBStore >, casacore::Cube< T >, casacore::Cube< casacore::casacore::Cube< casacore::Float > >, casacore::Cube< casacore::CountedPtr< CFCell > >, casacore::Cube< Double >, casacore::Cube< float >, casacore::Cube< casacore::DComplex >, casacore::Cube< casacore::Float >, casacore::Cube< casacore::Double >, casacore::Cube< casacore::casacore::CountedPtr< casa::CFCell > >, casacore::Cube< casacore::casacore::Cube< casacore::Bool > >, casacore::Cube< casacore::casacore::RigidVector< casacore::Double, 2 > >, casacore::Cube< casacore::Bool >, casacore::Cube< casacore::Int >, casacore::Cube< casacore::Complex >, and casacore::Cube< casacore::RigidVector< Double, 2 > >.
void casacore::Array< T >::set | ( | const T & | value | ) |
Set every element of the array to "value." Also could use the assignment operator which assigns an array from a scalar.
Referenced by casa::CTPatchedInterp::setDefFldMap().
|
inlineprotected |
Set the end iterator.
Definition at line 924 of file Array.h.
Referenced by casacore::Array< casacore::String >::makeSteps().
|
virtual |
Replace the data values with those in the pointer storage
.
The results are undefined if storage does not point at nelements() or more data elements. After takeStorage() is called, nrefs()
is 1.
If policy
is COPY
, storage of a new copy is allocated by DefaultAllocator<T>
. If policy
is TAKE_OVER
, storage
will be destructed and released by NewDelAllocator<T>
. It is strongly recommended to supply an appropriate allocator
argument explicitly whenever policy
== TAKE_OVER
to let Array
to know how to release the storage
.
Referenced by casa::sdfiller::DataRecord::operator=(), casa::sdfiller::MSDataRecord::operator=(), casa::ms::CachedPlane< casacore::Complex >::referenceMatrix(), casa::ms::CachedColumn< casacore::Float >::referenceVector(), casa::sdfiller::DataRecord::setDataSize(), casa::sdfiller::MSDataRecord::setDataSize(), casa::sdfiller::DataRecord::setTcalSize(), casa::sdfiller::MSDataRecord::setTcalSize(), casa::sdfiller::DataRecord::setTsysSize(), and casa::sdfiller::MSDataRecord::setTsysSize().
|
virtual |
If policy
is COPY
, storage of a new copy is allocated by allocator
.
If policy
is TAKE_OVER
, storage
will be destructed and released by allocator
. Otherwise, storage
is ignored.
|
virtual |
Since the pointer is const, a copy is always taken.
Storage of a new copy is allocated by DefaultAllocator<T>
.
|
virtual |
Since the pointer is const, a copy is always taken.
Storage of a new copy is allocated by the specified allocator.
void casacore::Array< T >::tovector | ( | vector< T, U > & | out | ) | const |
vector<T> casacore::Array< T >::tovector | ( | ) | const |
void casacore::Array< T >::unique | ( | ) |
This ensures that this array does not reference any other storage.
Tip: When a section is taken of an array with non-unity strides, storage can be wasted if the array, which originally contained all the data, goes away; unique() also reclaims storage; This is an optimization users don't normally need to understand;
|
friend |
Used to iterate through Arrays.
Derived classes VectorIterator and MatrixIterator are probably more useful.
|
friend |
Needed to be a friend for Matrix<T>::reference()
|
protected |
This pointer is adjusted to point to the first element of the array.
It is not necessarily the same thing as data->storage() since this array might be a section, e.g. have a blc which shifts us forward into the block.
Definition at line 913 of file Array.h.
Referenced by casacore::Cube< casacore::RigidVector< Double, 2 > >::at(), casacore::Array< casacore::String >::cbegin(), casacore::Array< casacore::String >::data(), casacore::Cube< casacore::RigidVector< Double, 2 > >::operator()(), casacore::Matrix< casa::VBStore >::operator()(), casacore::Vector< ArgType >::operator()(), casacore::Vector< ArgType >::operator[](), and casacore::Array< casacore::String >::setEndIter().
|
protected |
|
protected |
The end for an STL-style iteration.
Definition at line 916 of file Array.h.
Referenced by casacore::Array< casacore::String >::cend(), casacore::Array< casacore::String >::end(), and casacore::Array< casacore::String >::setEndIter().