26#ifndef CASA_VECTOR_2_H
27#define CASA_VECTOR_2_H
96 Vector(
size_t Length,
const T &initialValue);
109 Vector(
const std::vector<T> &other,
long long nr);
113 explicit Vector(
const std::vector<T> &other);
136 template<
typename InputIterator>
137 Vector(InputIterator startIter, InputIterator endIter);
144 template <
typename U,
typename V>
145 explicit Vector(
const std::vector<U, V> &other);
153 template<
typename Iterator>
164 void resize(
size_t len,
bool copyValues=
false)
189 using Array<T>::operator=;
217#if defined(AIPS_ARRAY_INDEX_CHECK)
225#if defined(AIPS_ARRAY_INDEX_CHECK)
303 virtual bool ok() const final override;
310 const
IPosition &ignoreAxes) final override;
325 template<
typename InputIterator>
326 Vector(InputIterator startIter, InputIterator endIter, std::false_type );
328 template<
typename InputIterator>
329 Vector(InputIterator startIter, InputIterator endIter, std::true_type );
335#include "Vector2.tcc"
void validateIndex(const IPosition &) const
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
bool contiguous_p
Are the data contiguous?
IPosition length_p
Used to hold the shape, increment into the underlying storage and originalLength of the array.
T * begin_p
This pointer is adjusted to point to the first element of the array.
T & operator()(const IPosition &)
Access a single element of the array.
void resize()
Make this array a different shape.
Vector< T > & assign_conforming(const Array< T > &source)
source must be a 1-dimensional array.
Vector< T > & assign_conforming(Array< T > &&source)
Vector< T > & assign_conforming(const Vector< T > &source)
const Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr) const
Vector< T > & assign_conforming_implementation(const Vector< T > &v, std::false_type isCopyable)
Vector(Vector< T > &&source) noexcept
Move.
Vector(const std::vector< T > &other, long long nr)
Create a Vector from the given std::vector "other." Make it length "nr" and copy over that many eleme...
Vector(std::initializer_list< T > list)
Create a Vector from an initializer list.
const Array< T > operator()(const IPosition &blc, const IPosition &trc) const
virtual void resize(const IPosition &len, bool copyValues=false) final override
Resize the array and optionally copy the values.
Vector(const Array< T > &other)
Create a reference to the other array.
Vector< T > operator()(const Slice &slice)
Take a slice of this vector.
void resize(size_t len, bool copyValues=false)
T & operator[](size_t index)
Convert a Vector to a Block, resizing the block and copying values.
Vector(const IPosition &shape, const T *storage)
Create an Vector of a given shape from a pointer.
const T & operator()(const IPosition &i) const
const Array< T > operator()(const Slicer &slicer) const
void initVector(const std::vector< T > &, long long nr)
Helper functions for constructors.
Vector< T > & operator=(const Vector< T > &source)
Vector(size_t Length)
A Vector with a defined length and origin of zero.
virtual size_t fixedDimensionality() const final override
Subclasses can return their dimensionality.
Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr)
Slice using IPositions.
Vector(const IPosition &Length)
Vector< T > & assign_conforming_implementation(const Vector< T > &v, std::true_type isCopyable)
Array< T > operator()(const Slicer &slicer)
const T & operator()(size_t index) const
Vector< T > & operator=(Vector< T > &&source)
Vector(InputIterator startIter, InputIterator endIter, std::false_type)
The following two constructors are used to make distinguish between Vector<literal>(literal size,...
Vector(Iterator first, size_t size, int dummy)
Create a Vector from a container iterator and its length.
Vector< T > & operator=(const Array< T > &source)
Vector(InputIterator startIter, InputIterator endIter, std::true_type)
Vector< T > & assign_conforming(Vector< T > &&source)
Vector(const std::vector< T > &other)
Create a Vector of length other.size() and copy over its values.
const T & operator[](size_t index) const
void shape(int &Shape) const
Vector(const IPosition &shape, T *storage, StorageInitPolicy policy=COPY)
Create an Vector of a given shape from a pointer.
const Vector< T > operator()(const Slice &slice) const
Vector(const IPosition &Length, const T &initialValue)
virtual void doNonDegenerate(const Array< T > &other, const IPosition &ignoreAxes) final override
Remove the degenerate axes from other and store result in this vector.
T & operator()(size_t index)
Vector(InputIterator startIter, InputIterator endIter)
virtual bool ok() const final override
Verify that dimensionality is 1 and then call Array<T>::ok()
Vector()
A zero-length Vector.
Vector(const IPosition &Length, typename Array< T >::uninitializedType)
Vector(const std::vector< U, V > &other)
Create a Vector from an STL vector (see tovector() in Array for the reverse operation).
Vector(size_t Length, const T &initialValue)
A Vector with a defined length and origin of zero.
Vector< T > & operator=(Array< T > &&source)
T & operator()(const IPosition &i)
Vector(const Vector< T > &other)
Create a reference to other.
Vector(size_t Length, typename Array< T >::uninitializedType)
An uninitialized Vector with a defined length.
const IPosition & shape() const
The length of the Vector.
Array< T > operator()(const IPosition &blc, const IPosition &trc)
@ COPY
COPY is used when an internal copy of the storage is to be made.
this file contains all the compiler specific defines
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
This is a tag for the constructor that may be used to construct an uninitialized Array.