50 template<
class T>
class Matrix;
53 template<
class Domain,
class Range>
class Functional;
262 void apply(T (*
function)(T));
265 void apply(T (*
function)(
const T &));
376 void tovector(vector<T, U> &out)
const;
423 uInt resizePercentage = 0,
438 uInt resizePercentage = 0,
439 bool resizeIfNeeded =
True);
690 class BaseIteratorSTL
722 {
return const_cast<T*
>(
itsPos); }
725 { os << iter.
itsPos;
return os; }
774 {
return *this->
getPos(); }
776 {
return this->
getPos(); }
931 extern template class Array<Bool>;
932 extern template class Array<Char>;
933 extern template class Array<uChar>;
934 extern template class Array<Short>;
935 extern template class Array<uShort>;
936 extern template class Array<Int>;
937 extern template class Array<uInt>;
938 extern template class Array<Int64>;
939 extern template class Array<Float>;
940 extern template class Array<Double>;
941 extern template class Array<Complex>;
942 extern template class Array<DComplex>;
943 extern template class Array<String>;
948 #ifndef CASACORE_NO_AUTO_TEMPLATES
949 #include <casacore/casa/Arrays/Array.tcc>
950 #endif //# CASACORE_NO_AUTO_TEMPLATES
ConstIteratorSTL(const T *end=0)
Create the end const_iterator object for an Array.
Bool contiguous_p
Are the data contiguous?
A Vector of integers, for indexing into Array<T> objects.
ConstIteratorSTL operator++(int)
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
virtual Bool ok() const
Check to see if the Array is consistent.
virtual void assignBase(const ArrayBase &other, Bool checkType=True)
Assign the source array to this array.
const_iterator end() const
Non-templated base class for templated Array class.
void putStorage(T *&storage, Bool deleteAndCopy)
putStorage() is normally called after a call to getStorage() (cf).
static ArrayInitPolicy defaultArrayInitPolicy()
static void copyToContiguousStorage(T *dst, Array< T > const &src, ArrayInitPolicy policy)
const_iterator begin() const
Array< T > diagonals(uInt firstAxis=0, Int64 diag=0) const
Get the diagonal of each matrix part in the full array.
virtual void preTakeStorage(const IPosition &)
pre/post processing hook of takeStorage() for subclasses.
Map a domain object into a range object via operator().
IteratorSTL(Array< T > &arr)
Create the begin iterator object for an Array.
Allocator_private::BulkAllocator< T > * nonNewDelAllocator() const
If the current allocator is NewDelAllocator<T>, BulkAllocator for DefaultAllocator<T> is returned...
static constexpr ArrayInitPolicy NO_INIT
Don't initialize elements in the array.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
ConstIteratorSTL(const IteratorSTL &iter)
Create from a non-const iterator.
IPosition steps_p
Used to hold the step to next element in each dimension.
Array< T > nonDegenerate(uInt startingAxis=0, Bool throwIfError=True) const
These member functions remove degenerate (ie.
const value_type & reference
const_contiter cbegin() const
bool adjustLastAxis(const IPosition &newShape, uInt resizePercentage=0, bool resizeIfNeeded=True)
Use this method to extend or reduce the last dimension of an array.
virtual ~Array()
Frees up storage only if this array was the last reference to it.
ptrdiff_t difference_type
size_t nels_p
Number of elements in the array.
void makeSteps()
Fill the steps and the end for a derived class.
static bool init_anyway()
const value_type * pointer
virtual void * getVStorage(Bool &deleteIt)
The following functions behave the same as the corresponding getStorage functions in the derived temp...
See the function begin() and end() for a detailed description of the STL iterator capability...
A 2-D Specialization of the Array class.
iterator begin()
Get the begin iterator object for any array.
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
virtual void assign(const Array< T > &other)
Assign the other array to this array.
Array< T > copy(ArrayInitPolicy policy=ArrayInitPolicies::NO_INIT) const
This makes a copy of the array and returns it.
void copyMatchingPart(const Array< T > &from)
This function copies the matching part of from array to this array.
contiter cbegin()
Get the begin iterator object for a contiguous array.
A global enum used by some Array/Block constructors.
Iterate an Array cursor through another Array.
virtual CountedPtr< ArrayPositionIterator > makeIterator(uInt byDim) const
Create an ArrayIterator object of the correct type.
virtual void reference(const Array< T > &other)
After invocation, this array and other reference the same storage.
IPosition length_p
Used to hold the shape, increment into the underlying storage and originalLength of the array...
Bool conform(const Array< T > &other) const
Are the shapes identical?
virtual void doNonDegenerate(const Array< T > &other, const IPosition &ignoreAxes)
Remove the degenerate axes from the Array object.
friend ostream & operator<<(ostream &os, const BaseIteratorSTL &iter)
T * data()
Get a pointer to the beginning of the array.
Class for masking an Array for operations on that Array.
T * getStorage(Bool &deleteIt)
Generally use of this should be shunned, except to use a FORTRAN routine or something similar...
virtual void resize()
Make this array a different shape.
bool operator!=(const BaseIteratorSTL &other) const
virtual CountedPtr< ArrayBase > getSection(const Slicer &) const
Get a reference to a section of an array.
Array< T > operator[](size_t i) const
Get the subset given by the i-th value of the last axis.
void increment()
Increment iterator for a non-contiguous array.
Referenced counted pointer for constant data.
T value_type
Define the STL-style iterator functions (only forward iterator).
uInt ndim() const
The dimensionality of this array.
bool operator==(const BaseIteratorSTL &other) const
const Array< T > * itsArray
virtual Array< T > & operator=(const Array< T > &other)
Copy the values in other to this.
std::forward_iterator_tag iterator_category
BaseIteratorSTL(const Array< T > &)
Create the begin const_iterator object for an Array.
ptrdiff_t difference_type
void nonDegenerate(const Array< T > &other, const IPosition &ignoreAxes)
Array()
Result has dimensionality of zero, and nelements is zero.
IteratorSTL operator++(int)
T * end_p
The end for an STL-style iteration.
T & operator()(const IPosition &)
Access a single element of the array.
ConstIteratorSTL(const Array< T > &arr)
Create the begin const_iterator object for an Array.
const_contiter cend() const
vector< T > tovector() const
bool Bool
Define the standard types used by Casacore.
const IteratorSTL & operator++()
void removeDegenerate(uInt startingAxis=0, Bool throwIfError=True)
Remove degenerate axes from this Array object.
static constexpr ArrayInitPolicy INIT
Initialize all elements in the array with the default value.
T * begin_p
This pointer is adjusted to point to the first element of the array.
void apply(T(*function)(T))
Apply the function to every element of the array.
void setEndIter()
Set the end iterator.
std::forward_iterator_tag iterator_category
virtual void postTakeStorage()
template <class T, class U> class vector;
void baseMakeSteps()
Make the indexing step sizes.
Specify which elements to extract from an n-dimensional array.
Bool conform2(const ArrayBase &other) const
Are the shapes identical?
void throwIfError(int errorCode, const casacore::String &prefix, const casacore::String &file, int line, const casacore::String &func=casacore::String())
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...
void set(const T &value)
Set every element of the array to "value." Also could use the assignment operator which assigns an ar...
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 s...
const T & operator*() const
virtual void takeStorage(const IPosition &shape, T *storage, StorageInitPolicy policy=COPY)
Replace the data values with those in the pointer storage.
CountedPtr< Block< T > > data_p
Reference counted block that contains the storage.
virtual CountedPtr< ArrayBase > makeArray() const
Make an empty array of the same template type.
String: the storage and methods of handling collections of characters.
const ConstIteratorSTL & operator++()
const Array< T > addDegenerate(uInt numAxes) const
This member function returns an Array reference with the specified number of extra axes...
COPY is used when an internal copy of the storage is to be made.
StorageInitPolicy
A global enum used by some Array constructors.
void unique()
This ensures that this array does not reference any other storage.
uInt nrefs() const
The number of references the underlying storage has assigned to it.
void freeStorage(const T *&storage, Bool deleteIt) const
If deleteIt is set, delete "storage".
void freeVStorage(const void *&storage, Bool deleteIt) const
const T * getStorage(Bool &deleteIt) const
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
size_t capacity() const
Returns the number of elements allocated.
const IPosition & shape() const
The length of each axis.
ConstIteratorSTL const_iterator
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.
IteratorSTL(const T *end=0)
Create the end iterator object for an Array.
virtual void putVStorage(void *&storage, Bool deleteAndCopy)