casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
casacore::Vector< T > Class Template Reference

A 1-D Specialization of the Array class. More...

#include <VLALogicalRecord.h>

Inheritance diagram for casacore::Vector< T >:
casacore::Array< T > casacore::ArrayBase

Public Member Functions

 Vector ()
 A zero-length Vector. More...
 
 Vector (size_t Length)
 A Vector with a defined length and origin of zero. More...
 
 Vector (size_t Length, ArrayInitPolicy initPolicy)
 
 Vector (const IPosition &Length)
 
 Vector (const IPosition &Length, ArrayInitPolicy initPolicy)
 
 Vector (size_t Length, const T &initialValue)
 A Vector with a defined length and origin of zero. More...
 
 Vector (const IPosition &Length, const T &initialValue)
 
 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. More...
 
 Vector (const Block< T > &other)
 Create a Vector of length other.nelements() and copy over its values. More...
 
 Vector (const Vector< T > &other)
 Create a reference to other. More...
 
 Vector (const Array< T > &other)
 Create a reference to the other array. More...
 
 Vector (const IPosition &shape, T *storage, StorageInitPolicy policy=COPY)
 Create an Vector of a given shape from a pointer. More...
 
 Vector (const IPosition &shape, T *storage, StorageInitPolicy policy, AbstractAllocator< T > const &allocator)
 Create an Vector of a given shape from a pointer. More...
 
 Vector (const IPosition &shape, const T *storage)
 Create an Vector of a given shape from a pointer. More...
 
template<class U , class V >
 Vector (const vector< U, V > &other)
 Create a Vector from an STL vector (see tovector() in Array for the reverse operation). More...
 
template<typename Iterator >
 Vector (Iterator first, size_t size, int dummy)
 Create a Vector from a container iterator and its length. More...
 
virtual ~Vector ()
 Define a destructor, otherwise the compiler makes a static one. More...
 
virtual void assign (const Array< T > &other)
 Assign the other array (which must be of dimension one) to this vector. More...
 
virtual void reference (const Array< T > &other)
 Create a reference to "other", which must be of dimension one. More...
 
void resize (size_t len, Bool copyValues=False)
 
void resize (size_t len, Bool copyValues, ArrayInitPolicy policy)
 
virtual void resize ()
 Make this array a different shape. More...
 
virtual void resize (const IPosition &len, Bool copyValues, ArrayInitPolicy policy)
 Resize the array and optionally copy the values. More...
 
Vector< T > & operator= (const Vector< T > &other)
 Assign to this Vector. More...
 
virtual Array< T > & operator= (const Array< T > &other)
 Other must be a 1-dimensional array. More...
 
Array< T > & operator= (const T &val)
 Set every element of this Vector to Val. More...
 
Vector< T > & operator= (const MaskedArray< T > &marray)
 Copy to this those values in marray whose corresponding elements in marray's mask are True. More...
 
void toBlock (Block< T > &other) const
 Convert a Vector to a Block, resizing the block and copying values. More...
 
T & operator[] (size_t index)
 Single-pixel addressing. More...
 
const T & operator[] (size_t index) const
 
T & operator() (const IPosition &i)
 
const T & operator() (const IPosition &i) const
 
T & operator() (size_t index)
 
const T & operator() (size_t index) const
 
Vector< T > operator() (const Slice &slice)
 Take a slice of this vector. More...
 
const Vector< T > operator() (const Slice &slice) const
 
Array< T > operator() (const IPosition &blc, const IPosition &trc, const IPosition &incr)
 Slice using IPositions. More...
 
const Array< T > operator() (const IPosition &blc, const IPosition &trc, const IPosition &incr) const
 
Array< T > operator() (const IPosition &blc, const IPosition &trc)
 
const Array< T > operator() (const IPosition &blc, const IPosition &trc) const
 
Array< T > operator() (const Slicer &slicer)
 
const Array< T > operator() (const Slicer &slicer) const
 
MaskedArray< T > operator() (const LogicalArray &mask) const
 The array is masked by the input LogicalArray. More...
 
MaskedArray< T > operator() (const LogicalArray &mask)
 Return a MaskedArray. More...
 
MaskedArray< T > operator() (const MaskedLogicalArray &mask) const
 The array is masked by the input MaskedLogicalArray. More...
 
MaskedArray< T > operator() (const MaskedLogicalArray &mask)
 Return a MaskedArray. More...
 
const IPositionshape () const
 The length of the Vector. More...
 
void shape (Int &Shape) const
 
virtual Bool ok () const
 Verify that dimensionality is 1 and then call Array<T>::ok() More...
 
- Public Member Functions inherited from casacore::Array< T >
 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< ArrayBasemakeArray () const
 Make an empty array of the same template type. 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...
 
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 (const IPosition &newShape, Bool copyValues=False)
 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< ArrayBasegetSection (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...
 
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...
 
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
 
- 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...
 
ArrayBaseoperator= (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 IPositionshape () const
 The length of each axis. More...
 
IPosition endPosition () const
 A convenience function: endPosition(i) = shape(i) - 1; i.e. More...
 
const IPositionsteps () 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
 

Protected Member Functions

virtual void preTakeStorage (const IPosition &shape)
 pre/post processing hook of takeStorage() for subclasses. More...
 
virtual void doNonDegenerate (const Array< T > &other, const IPosition &ignoreAxes)
 Remove the degenerate axes from other and store result in this vector. More...
 
- Protected Member Functions inherited from casacore::Array< T >
virtual void postTakeStorage ()
 
void makeSteps ()
 Fill the steps and the end for a derived class. More...
 
void setEndIter ()
 Set the end iterator. 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...
 

Private Member Functions

void initVector (const Block< T > &, Int64 nr)
 Helper functions for constructors. More...
 

Additional Inherited Members

- Public Types inherited from casacore::Array< T >
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
 
- Static Public Member Functions inherited from casacore::ArrayBase
static uInt arrayVersion ()
 Array version for major change (used by ArrayIO). More...
 
- Static Protected Member Functions inherited from casacore::Array< T >
static ArrayInitPolicy defaultArrayInitPolicy ()
 
static void copyToContiguousStorage (T *dst, Array< T > const &src, ArrayInitPolicy policy)
 
- Protected Attributes inherited from casacore::Array< T >
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...
 
- 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...
 

Detailed Description

template<class T>
class casacore::Vector< T >

A 1-D Specialization of the Array class.

forward declaration

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Vector objects are one-dimensional specializations (e.g., more convenient and efficient indexing) of the general Array class. You might also want to look at the Array documentation to see inherited functionality.

Generally the member functions of Array are also available in Vector versions which take an integer where the array needs an IPosition. Since the Vector is one-dimensional, the IPositions are overkill, although you may use those versions if you want to.

Vector<Int> vi(100); // Vector 100 elements long.
vi.resize(50); // Now only 50 long.

Slices may be taken with the Slice class. To take a slice, one "indexes" with Slice(start, length, inc) where end and inc are optional.

Vector<Float> vf(100);
//..\.
vf(Slice(0,50,2)) = vf(Slice(1,50,2)); // Copy values from odd onto even
Vector<Float> firstHalf, secondHalf;
firstHalf.reference(vf(Slice(0,50)));
secondHalf.reference(vf(Slice(50,50)));
// Now we have aliases for two slices into the Vector

Element-by-element arithmetic and logical operations are available (in aips/ArrayMath.h and aips/ArrayLogical.h) as well as dot and cross products (in aips/MatrixMath.h).

A Vector can be constructed from an STL vector. The reverse operation (Array::tovector()) can construct an STL vector from any Array.
Tip: To create any other STL container from an Array (or the reverse), always create from/to a vector, and use the range constructor to create from/to others (like set, list, deque);

As with the Arrays, if the preprocessor symbol AIPS_DEBUG is defined at compile time invariants will be checked on entry to most member functions. Additionally, if AIPS_ARRAY_INDEX_CHECK is defined index operations will be bounds-checked. Neither of these should be defined for production code.

Definition at line 44 of file VLALogicalRecord.h.

Constructor & Destructor Documentation

template<class T>
casacore::Vector< T >::Vector ( )

A zero-length Vector.

template<class T>
casacore::Vector< T >::Vector ( size_t  Length)
explicit

A Vector with a defined length and origin of zero.

template<class T>
casacore::Vector< T >::Vector ( size_t  Length,
ArrayInitPolicy  initPolicy 
)
template<class T>
casacore::Vector< T >::Vector ( const IPosition Length)
explicit
template<class T>
casacore::Vector< T >::Vector ( const IPosition Length,
ArrayInitPolicy  initPolicy 
)
template<class T>
casacore::Vector< T >::Vector ( size_t  Length,
const T &  initialValue 
)

A Vector with a defined length and origin of zero.

Fill it with the initial value.

template<class T>
casacore::Vector< T >::Vector ( const IPosition Length,
const T &  initialValue 
)
template<class T>
casacore::Vector< T >::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.

template<class T>
casacore::Vector< T >::Vector ( const Block< T > &  other)
explicit

Create a Vector of length other.nelements() and copy over its values.

template<class T>
casacore::Vector< T >::Vector ( const Vector< T > &  other)

Create a reference to other.

template<class T>
casacore::Vector< T >::Vector ( const Array< T > &  other)

Create a reference to the other array.

It is always possible if the array has zero or one axes. If it has > 1 axes, it is only possible if the array has at most one axis with length > 1. In that case the degenerated axes are removed.

template<class T>
casacore::Vector< T >::Vector ( const IPosition shape,
T *  storage,
StorageInitPolicy  policy = COPY 
)

Create an Vector of a given shape from a pointer.

template<class T>
casacore::Vector< T >::Vector ( const IPosition shape,
T *  storage,
StorageInitPolicy  policy,
AbstractAllocator< T > const &  allocator 
)

Create an Vector of a given shape from a pointer.

template<class T>
casacore::Vector< T >::Vector ( const IPosition shape,
const T *  storage 
)

Create an Vector of a given shape from a pointer.

Because the pointer is const, a copy is always made.

template<class T>
template<class U , class V >
casacore::Vector< T >::Vector ( const vector< U, V > &  other)

Create a Vector from an STL vector (see tovector() in Array for the reverse operation).


Tip: Both this constructor and the tovector() are defined in Vector2;cc;
It does implicit promotion/demotion of the type U if different from T.

template<class T>
template<typename Iterator >
casacore::Vector< T >::Vector ( Iterator  first,
size_t  size,
int  dummy 
)

Create a Vector from a container iterator and its length.


Note: The length is used instead of last, because the distance function needed to calculate the length can be expensive;
A third dummy argument is unfortunately needed to avoid ambiguity with another Vector constructor (taking two uInts);

template<class T>
virtual casacore::Vector< T >::~Vector ( )
virtual

Define a destructor, otherwise the compiler makes a static one.

Member Function Documentation

template<class T>
virtual void casacore::Vector< T >::assign ( const Array< T > &  other)
virtual
template<class T>
virtual void casacore::Vector< T >::doNonDegenerate ( const Array< T > &  other,
const IPosition ignoreAxes 
)
protectedvirtual

Remove the degenerate axes from other and store result in this vector.

An exception is thrown if removing degenerate axes does not result in a vector.

Reimplemented from casacore::Array< T >.

template<class T>
void casacore::Vector< T >::initVector ( const Block< T > &  ,
Int64  nr 
)
private

Helper functions for constructors.

template<class T>
virtual Bool casacore::Vector< T >::ok ( ) const
virtual

Verify that dimensionality is 1 and then call Array<T>::ok()

Reimplemented from casacore::Array< T >.

template<class T>
T& casacore::Vector< T >::operator() ( const IPosition i)
inline

Definition at line 207 of file Vector.h.

template<class T>
const T& casacore::Vector< T >::operator() ( const IPosition i) const
inline

Definition at line 209 of file Vector.h.

template<class T>
T& casacore::Vector< T >::operator() ( size_t  index)
inline

Definition at line 211 of file Vector.h.

template<class T>
const T& casacore::Vector< T >::operator() ( size_t  index) const
inline

Definition at line 219 of file Vector.h.

template<class T>
Vector<T> casacore::Vector< T >::operator() ( const Slice slice)

Take a slice of this vector.

Slices are always indexed starting at zero. This uses reference semantics, i.e. changing a value in the slice changes the original.

Vector<Double> vd(100);
//..\.
vd(Slice(0,10)) = -1.0; // First 10 elements of vd set to -1
template<class T>
const Vector<T> casacore::Vector< T >::operator() ( const Slice slice) const
template<class T>
Array<T> casacore::Vector< T >::operator() ( const IPosition blc,
const IPosition trc,
const IPosition incr 
)
inline

Slice using IPositions.

Required to be defined, otherwise the base class versions are hidden.

Definition at line 244 of file Vector.h.

template<class T>
const Array<T> casacore::Vector< T >::operator() ( const IPosition blc,
const IPosition trc,
const IPosition incr 
) const
inline

Definition at line 247 of file Vector.h.

template<class T>
Array<T> casacore::Vector< T >::operator() ( const IPosition blc,
const IPosition trc 
)
inline

Definition at line 250 of file Vector.h.

template<class T>
const Array<T> casacore::Vector< T >::operator() ( const IPosition blc,
const IPosition trc 
) const
inline

Definition at line 252 of file Vector.h.

template<class T>
Array<T> casacore::Vector< T >::operator() ( const Slicer slicer)
inline

Definition at line 254 of file Vector.h.

template<class T>
const Array<T> casacore::Vector< T >::operator() ( const Slicer slicer) const
inline

Definition at line 256 of file Vector.h.

template<class T>
MaskedArray<T> casacore::Vector< T >::operator() ( const LogicalArray &  mask) const
inline

The array is masked by the input LogicalArray.

This mask must conform to the array.

Return a MaskedArray.

Definition at line 265 of file Vector.h.

template<class T>
MaskedArray<T> casacore::Vector< T >::operator() ( const LogicalArray &  mask)
inline

Return a MaskedArray.

Definition at line 269 of file Vector.h.

template<class T>
MaskedArray<T> casacore::Vector< T >::operator() ( const MaskedLogicalArray &  mask) const
inline

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.

Return a MaskedArray.

Definition at line 282 of file Vector.h.

template<class T>
MaskedArray<T> casacore::Vector< T >::operator() ( const MaskedLogicalArray &  mask)
inline

Return a MaskedArray.

Definition at line 286 of file Vector.h.

template<class T>
Vector<T>& casacore::Vector< T >::operator= ( const Vector< T > &  other)

Assign to this Vector.

If this Vector is zero-length, then resize to be the same size as other. Otherwise this and other have to be conformant (same size).
Note that the assign function can be used to assign a non-conforming vector.

template<class T>
virtual Array<T>& casacore::Vector< T >::operator= ( const Array< T > &  other)
virtual

Other must be a 1-dimensional array.

Reimplemented from casacore::Array< T >.

template<class T>
Array<T>& casacore::Vector< T >::operator= ( const T &  val)
inline

Set every element of this Vector to Val.

Definition at line 187 of file Vector.h.

template<class T>
Vector<T>& casacore::Vector< T >::operator= ( const MaskedArray< T > &  marray)
inline

Copy to this those values in marray whose corresponding elements in marray's mask are True.

Definition at line 192 of file Vector.h.

template<class T>
T& casacore::Vector< T >::operator[] ( size_t  index)
inline

Single-pixel addressing.

If AIPS_ARRAY_INDEX_CHECK is defined, bounds checking is performed (not for [])..

Definition at line 203 of file Vector.h.

template<class T>
const T& casacore::Vector< T >::operator[] ( size_t  index) const
inline

Definition at line 205 of file Vector.h.

template<class T>
virtual void casacore::Vector< T >::preTakeStorage ( const IPosition )
protectedvirtual

pre/post processing hook of takeStorage() for subclasses.

Reimplemented from casacore::Array< T >.

template<class T>
virtual void casacore::Vector< T >::reference ( const Array< T > &  other)
virtual
template<class T>
void casacore::Vector< T >::resize ( size_t  len,
Bool  copyValues = False 
)
inline

Definition at line 167 of file Vector.h.

Referenced by asdm::ASDM_TABLE_BASE::_2CASAString1D(), asdm::ASDM_TABLE_BASE::at2CASA1D(), casa::refim::AWVisResampler::AWVisResampler(), asdm::ASDM_TABLE_BASE::basic2CASA1D(), casa::VisibilityResamplerBase::cacheAxisIncrements(), casa::refim::VisibilityResamplerBase::cacheAxisIncrements(), casa::denoising::GslMultifitLinearBase::calcFitModelStdCore(), casa::sdfiller::ObservationRecord::clear(), casa::sdfiller::SysCalRecord::clear(), casa::sdfiller::SourceRecord::clear(), asdm::ASDM_TABLE_BASE::enum2CASA1D(), asdm::ASDM_TABLE_BASE::ext2CASA1D(), casacore::LSQaips::getErrors(), casa::denoising::GslMultifitLinearBase::getFitCoeff(), MirSource::getMotion(), casa::EVLAAperture::getPolMap(), casa::refim::EVLAAperture::getPolMap(), casa::ALMAAperture::getPolMap(), casa::CFTerms::getPolMap(), casa::refim::CFTerms::getPolMap(), casa::ATerm::getPolMap(), casa::refim::ATerm::getPolMap(), casa::spwInfo::initialize(), asdm::ASDM_TABLE_BASE::interval2CASA1D(), casa::ProtoVR::ProtoVR(), casacore::MSPolnParse::reset(), casacore::MSStateParse::reset(), casacore::MSUvDistParse::reset(), casacore::MSScanParse::reset(), casacore::MSArrayParse::reset(), casacore::MSObservationParse::reset(), casacore::MSSpwParse::reset(), casa::ALMAAperture::resetAntTypeMap(), casa::spwInfo::resize(), DataLoadingBuf::resizeForNpol(), casa::ScantableSourceIterator::ScantableSourceIterator(), casa::CTPatchedInterp::setDefAntMap(), casa::CTPatchedInterp::setDefFldMap(), casa::CTPatchedInterp::setDefSpwMap(), casa::ALMAAperture::setPolMap(), casa::CFTerms::setPolMap(), casa::ATerm::setPolMap(), casa::SynthesisUtils::SETVEC(), casa::refim::SynthesisUtils::SETVEC(), casa::refim::AWVisResampler::SETVEC(), casa::AWVisResampler::SETVEC(), casa::ProtoVR::SETVEC(), casacore::LSQaips::solve(), casa::CalAnalysis::stats(), casacore::TableExprNodeSet::toArray(), casa::CalAnalysis::unique(), casa::EVLAAperture::vbRow2CFKeyMap(), casa::refim::EVLAAperture::vbRow2CFKeyMap(), casa::ATerm::vbRow2CFKeyMap(), and casa::refim::ATerm::vbRow2CFKeyMap().

template<class T>
void casacore::Vector< T >::resize ( size_t  len,
Bool  copyValues,
ArrayInitPolicy  policy 
)
inline

Definition at line 169 of file Vector.h.

template<class T>
virtual void casacore::Vector< T >::resize ( )
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 from casacore::Array< T >.

Referenced by casacore::Vector< ArgType >::resize().

template<class T>
virtual void casacore::Vector< T >::resize ( const IPosition newShape,
Bool  copyValues,
ArrayInitPolicy  policy 
)
virtual

Resize the array and optionally copy the values.


The default implementation in ArrayBase throws an exception.

Reimplemented from casacore::Array< T >.

template<class T>
const IPosition& casacore::Vector< T >::shape ( ) const
inline
template<class T>
void casacore::Vector< T >::shape ( Int Shape) const
inline

Definition at line 295 of file Vector.h.

template<class T>
void casacore::Vector< T >::toBlock ( Block< T > &  other) const

Convert a Vector to a Block, resizing the block and copying values.

This is done this way to avoid having the simpler Block class containing dependencies on the Vector class.


The documentation for this class was generated from the following files: