32 #include <casacore/casa/aips.h> 33 #include <casacore/casa/Arrays/Array.h> 37 #if defined(WHATEVER_VECTOR_FORWARD_DEC) 40 #include <casacore/casa/stdvector.h> 92 template<
class T>
class Vector :
public Array<T>
100 explicit Vector(
size_t Length);
101 Vector(
size_t Length, ArrayInitPolicy initPolicy);
102 explicit Vector(
const IPosition& Length);
103 Vector(
const IPosition& Length, ArrayInitPolicy initPolicy);
109 Vector(
size_t Length,
const T &initialValue);
110 Vector(
const IPosition& Length,
const T &initialValue);
117 explicit Vector(
const Block<T> &other);
120 Vector(
const Vector<T> &other);
126 Vector(
const Array<T> &other);
141 template <
class U,
class V>
142 Vector(
const vector<U, V> &other);
150 template<
typename Iterator>
158 virtual void assign (
const Array<T>& other);
161 virtual void reference(
const Array<T> &other);
197 {
Array<T> (*this) = marray;
return *
this; }
217 #if defined(AIPS_ARRAY_INDEX_CHECK) 225 #if defined(AIPS_ARRAY_INDEX_CHECK) 338 #ifndef CASACORE_NO_AUTO_TEMPLATES 339 #include <casacore/casa/Arrays/Vector.tcc> 340 #include <casacore/casa/Arrays/Vector2.tcc> 341 #endif //# CASACORE_NO_AUTO_TEMPLATES Bool contiguous_p
Are the data contiguous?
A Vector of integers, for indexing into Array<T> objects.
const IPosition & shape() const
The length of the Vector.
T & operator[](size_t index)
Single-pixel addressing.
A 1-D Specialization of the Array class.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Vector()
A zero-length Vector.
const Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr) const
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
StorageInitPolicy
A global enum used by some Array constructors.
const T & operator()(const IPosition &i) const
const T & operator[](size_t index) const
#define WHATEVER_VECTOR_FORWARD_DEC
A global enum used by some Array/Block constructors.
IPosition length_p
Used to hold the shape, increment into the underlying storage and originalLength of the array...
Array< T > operator()(const IPosition &blc, const IPosition &trc)
virtual void doNonDegenerate(const Array< T > &other, const IPosition &ignoreAxes)
Remove the degenerate axes from other and store result in this vector.
Class for masking an Array for operations on that Array.
virtual void resize()
Make this array a different shape.
const T & operator()(size_t index) const
Array< T > & operator=(const T &val)
Set every element of this Vector to Val.
Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr)
Slice using IPositions.
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
Vector< T > & operator=(const Vector< T > &other)
Assign to this Vector.
virtual void assign(const Array< T > &other)
Assign the other array (which must be of dimension one) to this vector.
define a (start,length,increment) along an axis
virtual Array< T > & operator=(const Array< T > &other)
Copy the values in other to this.
void shape(Int &Shape) const
void initVector(const Block< T > &, Int64 nr)
Helper functions for constructors.
T & operator()(const IPosition &)
Access a single element of the array.
virtual Bool ok() const
Verify that dimensionality is 1 and then call Array<T>::ok()
T & operator()(size_t index)
bool Bool
Define the standard types used by Casacore.
virtual ~Vector()
Define a destructor, otherwise the compiler makes a static one.
virtual void resize()
Make this array a different shape.
T * begin_p
This pointer is adjusted to point to the first element of the array.
virtual void preTakeStorage(const IPosition &shape)
pre/post processing hook of takeStorage() for subclasses.
template <class T, class U> class vector;
Array< T > operator()(const Slicer &slicer)
Specify which elements to extract from an n-dimensional array.
COPY is used when an internal copy of the storage is to be made.
const Array< T > operator()(const IPosition &blc, const IPosition &trc) const
void resize(size_t len, Bool copyValues, ArrayInitPolicy policy)
void resize(size_t len, Bool copyValues=False)
virtual void reference(const Array< T > &other)
Create a reference to "other", which must be of dimension one.
void validateIndex(const IPosition &) const
void toBlock(Block< T > &other) const
Convert a Vector to a Block, resizing the block and copying values.
this file contains all the compiler specific defines
T & operator()(const IPosition &i)
const Array< T > operator()(const Slicer &slicer) const