Go to the documentation of this file.
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Arrays/Array.h>
37 #include <casacore/casa/stdvector.h>
88 template<
class T>
class Vector :
public Array<T>
105 Vector(
size_t Length,
const T &initialValue);
137 template <
class U,
class V>
146 template<
typename Iterator>
204 {
return (this->contiguous_p ? this->begin_p[index] : this->begin_p[index*this->inc_p(0)]); }
206 {
return (this->contiguous_p ? this->begin_p[index] : this->begin_p[index*this->inc_p(0)]); }
213 #if defined(AIPS_ARRAY_INDEX_CHECK)
214 this->validateIndex(index);
216 return *(this->begin_p + index*this->inc_p(0));
221 #if defined(AIPS_ARRAY_INDEX_CHECK)
222 this->validateIndex(index);
224 return *(this->begin_p + index*this->inc_p(0));
294 {
return this->length_p; }
296 { Shape = this->length_p(0); }
332 #ifndef CASACORE_NO_AUTO_TEMPLATES
333 #include <casacore/casa/Arrays/Vector.tcc>
334 #include <casacore/casa/Arrays/Vector2.tcc>
335 #endif //# CASACORE_NO_AUTO_TEMPLATES
Array< T > & operator=(const T &val)
Set every element of this Vector to Val.
Specify which elements to extract from an n-dimensional array.
Vector(const Array< T > &other)
Create a reference to the other array.
void shape(Int &Shape) const
virtual ~Vector()
Define a destructor, otherwise the compiler makes a static one.
Vector< T > & operator=(const Vector< T > &other)
Assign to this Vector.
Vector< T > operator()(const Slice &slice)
Take a slice of this vector.
A Vector of integers, for indexing into Array<T> objects.
Vector(const Block< T > &other)
Create a Vector of length other.nelements() and copy over its values.
void toBlock(Block< T > &other) const
Convert a Vector to a Block, resizing the block and copying values.
T & operator()(size_t index)
StorageInitPolicy
A global enum used by some Array constructors.
Vector(size_t Length, ArrayInitPolicy initPolicy)
const Array< T > operator()(const Slicer &slicer) const
const Array< T > operator()(const IPosition &blc, const IPosition &trc) const
virtual void preTakeStorage(const IPosition &shape)
Vector(size_t Length, const T &initialValue)
A Vector with a defined length and origin of zero.
Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr)
Slice using IPositions.
const T & operator()(size_t index) const
LatticeExprNode nelements(const LatticeExprNode &expr)
1-argument function to get the number of elements in a lattice.
A global enum used by some Array/Block constructors.
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.
Vector(const vector< U, V > &other)
Create a Vector from an STL vector (see tovector() in Array for the reverse operation).
Vector(const IPosition &shape, const T *storage)
Create an Vector of a given shape from a pointer.
void initVector(const Block< T > &, Int64 nr)
Helper functions for constructors.
Vector(size_t Length)
A Vector with a defined length and origin of zero.
const IPosition & shape() const
The length of the Vector.
virtual void resize(const IPosition &len, Bool copyValues, ArrayInitPolicy policy)
const Vector< T > operator()(const Slice &slice) const
T & operator()(const IPosition &i)
Array< T > operator()(const Slicer &slicer)
Vector(Iterator first, size_t size, int dummy)
Create a Vector from a container iterator and its length.
T & operator()(const IPosition &)
Access a single element of the array.
Vector(const IPosition &shape, T *storage, StorageInitPolicy policy=COPY)
Create an Vector of a given shape from a pointer.
@ COPY
COPY is used when an internal copy of the storage is to be made.
virtual Array< T > & operator=(const Array< T > &other)
Copy the values in other to this.
define a (start,length,increment) along an axis
Vector(const IPosition &Length, ArrayInitPolicy initPolicy)
this file contains all the compiler specific defines
const Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr) const
void resize(size_t len, Bool copyValues, ArrayInitPolicy policy)
Vector(const IPosition &Length)
Class for masking an Array for operations on that Array.
Vector(const IPosition &shape, T *storage, StorageInitPolicy policy, AbstractAllocator< T > const &allocator)
Create an Vector of a given shape from a pointer.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
Vector(const IPosition &Length, const T &initialValue)
Vector(const Vector< T > &other)
Create a reference to other.
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
const T & operator[](size_t index) const
virtual Bool ok() const
Verify that dimensionality is 1 and then call Array<T>::ok()
template <class T, class U> class vector;
const T & operator()(const IPosition &i) const
T & operator[](size_t index)
Single-pixel addressing.
bool Bool
Define the standard types used by Casacore.
Vector()
A zero-length Vector.
A 1-D Specialization of the Array class.
virtual void assign(const Array< T > &other)
Assign the other array (which must be of dimension one) to this vector.
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.
Vector(const Block< T > &other, Int64 nr)
Create a Vector from the given Block "other." Make it length "nr" and copy over that many elements.
virtual Array< T > & operator=(const Array< T > &other)
Other must be a 1-dimensional array.