casacore
Loading...
Searching...
No Matches
Public Member Functions | List of all members
casacore::QVector< T > Class Template Reference

More...

#include <QVector.h>

Public Member Functions

 QVector ()
 zero elements
 
 QVector (const Vector< T > &v, const Unit &u)
 
 QVector (const Vector< Quantum< T > > &q)
 convert a Vector of Quanta to a QVector.
 
Quantum< T > operator[] (uInt index) const
 access single element
 
size_t size () const
 
size_t nelements () const
 
void scale (T d)
 
QVector< T > operator+ (const QVector< T > &d) const
 add operators as needed
 
QVector< T > operator- (const QVector< T > &d) const
 
QVector< T > operator/ (T d) const
 
Quantum< T > min () const
 
Quantum< T > max () const
 
- Public Member Functions inherited from casacore::Quantum< Vector< T > >
 Quantum ()
 Default constructor, generates '0'.
 
 Quantum (const Quantum< Vector< T > > &other)
 Copy constructor (deep copy)
 
 Quantum (const Vector< T > &factor)
 Construct undimensioned quantum (i.e.
 
 Quantum (const Vector< T > &factor, const Unit &s)
 Construct dimensioned quantum (e.g.
 
 Quantum (const Vector< T > &factor, const QBase &other)
 Construct quantum with unit copied from existing quantum.
 
Quantum< Vector< T > > & operator= (const Quantum< Vector< T > > &other)
 Assignment (deep copy)
 
const Quantum< Vector< T > > & operator+ () const
 Unary operations.
 
Quantum< Vector< T > > operator+ (const Quantum< Vector< T > > &other) const
 Arithmetic operators: return Quantum<T>
 
Quantum< Vector< T > > operator- () const
 
Quantum< Vector< T > > operator- (const Quantum< Vector< T > > &other) const
 
Quantum< Vector< T > > & operator+= (const Quantum< Vector< T > > &other)
 In place arithmetic functions: left hand side changed in place.
 
Quantum< Vector< T > > & operator+= (const Vector< T > &other)
 
Quantum< Vector< T > > & operator-= (const Quantum< Vector< T > > &other)
 
Quantum< Vector< T > > & operator-= (const Vector< T > &other)
 
Quantum< Vector< T > > & operator*= (const Quantum< Vector< T > > &other)
 
Quantum< Vector< T > > & operator*= (const Vector< T > &other)
 
Quantum< Vector< T > > & operator/= (const Quantum< Vector< T > > &other)
 
Quantum< Vector< T > > & operator/= (const Vector< T > &other)
 
Quantum< Vector< T > > operator* (const Quantum< Vector< T > > &other) const
 
Quantum< Vector< T > > operator/ (const Quantum< Vector< T > > &other) const
 
const Vector< T > & getValue () const
 Get value of quantum in current units (i.e.
 
Vector< T > & getValue ()
 
Vector< T > getValue (const Unit &other, Bool requireConform=False) const
 Get value in specified units.
 
Vector< T > getBaseValue () const
 Get value in canonical base units.
 
virtual const UnitgetFullUnit () const
 Get the unit (as Unit) that is attached to the Quantum.
 
void scale (const Vector< T > &factor)
 Re-specify parts of a quantum

 
void setValue (const Vector< T > &val)
 Set the value without changing units.
 
Bool check (const UnitVal &uv) const
 Check if of specified type.
 
void assure (const UnitVal &uv) const
 Assert correct kind.
 
Quantum< Vector< T > > get () const
 Return a Quantum converted to specified units

 
Quantum< Vector< T > > get (const Unit &s) const
 Convert to specified units; any remainder will be expressed in canonical units.
 
Quantum< Vector< T > > get (const Quantum< Vector< T > > &other) const
 Convert a Quantum to units from specified quantum (ibid example)
 
void convert ()
 Convert a Quantum to specified units.
 
void convert (const Unit &s)
 Convert to specified units; any remainder will be expressed in canonical units.
 
void convert (const Quantum< Vector< T > > &other)
 Convert a Quantum to units from specified quantum (ibid example)
 
virtual QBaseclone () const
 Get a copy of Quantum.
 
virtual void print (ostream &os) const
 Print a Quantum.
 
virtual uInt type () const
 Get the type (using QuantumType) of derived Quantum (faster than Strings)
 
- Public Member Functions inherited from casacore::QBase
 QBase ()
 Default constructor, generates "".
 
 QBase (const Unit &s)
 Construct dimensioned QBase (e.g.
 
virtual ~QBase ()
 Destructor.
 
const StringgetUnit () const
 Get units of QBase

 
void setUnit (const Unit &s)
 Re-specify parts of a QBase

 
void setUnit (const QBase &other)
 Set new unit, copied from specified QBase, without changing value.
 
Bool isConform (const Unit &s) const
 Check for conformal matching units (e.g.
 
Bool isConform (const QBase &other) const
 Using units specified in QBase.
 

Additional Inherited Members

- Static Public Member Functions inherited from casacore::Quantum< Vector< T > >
static Bool read (Quantity &res, const String &in)
 Set the value and unit deduced from input string
Caution: At the moment the implementation can only convert scalars to the appropiate Quantum; If format for Array input defined, it could easily be changed; In addition recognition of date/time/angle still has to be added

 
static Bool read (Quantity &res, MUString &in)
 
static uInt myType ()
 
- Protected Attributes inherited from casacore::QBase
Unit qUnit
 

Detailed Description

template<class T>
class casacore::QVector< T >

Specialization for Quantum<Vector<T> >

Intended use:

Public interface

Prerequisite

Etymology

Vector of quantities.

Synopsis

Objects of type Quantum<Vector<Double> > are used often in our code. We need a way to access individual elements easily

Definition at line 58 of file QVector.h.

Constructor & Destructor Documentation

◆ QVector() [1/3]

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

zero elements

◆ QVector() [2/3]

template<class T >
casacore::QVector< T >::QVector ( const Vector< T > &  v,
const Unit u 
)

◆ QVector() [3/3]

template<class T >
casacore::QVector< T >::QVector ( const Vector< Quantum< T > > &  q)

convert a Vector of Quanta to a QVector.

Useful when reading a table column of Quanta. All elements in q will be converted to units of the first element in q. An exception will be thrown if not all elements in q conform to the same unit.

Member Function Documentation

◆ max()

template<class T >
Quantum< T > casacore::QVector< T >::max ( ) const

◆ min()

template<class T >
Quantum< T > casacore::QVector< T >::min ( ) const

◆ nelements()

template<class T >
size_t casacore::QVector< T >::nelements ( ) const

◆ operator+()

template<class T >
QVector< T > casacore::QVector< T >::operator+ ( const QVector< T > &  d) const

add operators as needed

◆ operator-()

template<class T >
QVector< T > casacore::QVector< T >::operator- ( const QVector< T > &  d) const

◆ operator/()

template<class T >
QVector< T > casacore::QVector< T >::operator/ ( d) const

◆ operator[]()

template<class T >
Quantum< T > casacore::QVector< T >::operator[] ( uInt  index) const

access single element

◆ scale()

template<class T >
void casacore::QVector< T >::scale ( d)

◆ size()

template<class T >
size_t casacore::QVector< T >::size ( ) const

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