casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::QVector< T > Class Template Reference

Specialization for Quantum<Vector<T> > More...

#include <QVector.h>

Inheritance diagram for casacore::QVector< T >:
casacore::Quantum< Vector< T > > casacore::QBase

Public Member Functions

 QVector ()
 zero elements More...
 
 QVector (const Vector< T > &v, const Unit &u)
 
 QVector (const Vector< Quantum< T > > &q)
 convert a Vector of Quanta to a QVector. More...
 
Quantum< T > operator[] (uInt index) const
 access single element More...
 
size_t size () const
 
size_t nelements () const
 
void scale (T d)
 
QVector< T > operator+ (const QVector< T > &d) const
 add operators as needed More...
 
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'. More...
 
 Quantum (const Quantum< Vector< T > > &other)
 Copy constructor (deep copy) More...
 
 Quantum (const Vector< T > &factor)
 Construct undimensioned quantum (i.e. More...
 
 Quantum (const Vector< T > &factor, const Unit &s)
 Construct dimensioned quantum (e.g. More...
 
 Quantum (const Vector< T > &factor, const QBase &other)
 Construct quantum with unit copied from existing quantum. More...
 
Quantum< Vector< T > > & operator= (const Quantum< Vector< T > > &other)
 Assignment (deep copy) More...
 
const Quantum< Vector< T > > & operator+ () const
 Unary operations. More...
 
Quantum< Vector< T > > operator+ (const Quantum< Vector< T > > &other) const
 Arithmetic operators: return Quantum<T> More...
 
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. More...
 
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. More...
 
Vector< T > & getValue ()
 
Vector< T > getValue (const Unit &other, Bool requireConform=False) const
 Get value in specified units. More...
 
Vector< T > getBaseValue () const
 Get value in canonical base units. More...
 
virtual const UnitgetFullUnit () const
 Get the unit (as Unit) that is attached to the Quantum. More...
 
void convert ()
 Convert a Quantum to specified units. More...
 
void convert (const Unit &s)
 Convert to specified units; any remainder will be expressed in canonical units. More...
 
void convert (const Quantum< Vector< T > > &other)
 Convert a Quantum to units from specified quantum (ibid example) More...
 
virtual QBaseclone () const
 Get a copy of Quantum. More...
 
virtual void print (ostream &os) const
 Print a Quantum. More...
 
virtual uInt type () const
 Get the type (using QuantumType) of derived Quantum (faster than Strings) More...
 
void scale (const Vector< T > &factor)
 Re-specify parts of a quantum. More...
 
void setValue (const Vector< T > &val)
 Set the value without changing units. More...
 
Bool check (const UnitVal &uv) const
 Check if of specified type. More...
 
void assure (const UnitVal &uv) const
 Assert correct kind. More...
 
Quantum< Vector< T > > get () const
 Return a Quantum converted to specified units. More...
 
Quantum< Vector< T > > get (const Unit &s) const
 Convert to specified units; any remainder will be expressed in canonical units. More...
 
Quantum< Vector< T > > get (const Quantum< Vector< T > > &other) const
 Convert a Quantum to units from specified quantum (ibid example) More...
 
- Public Member Functions inherited from casacore::QBase
 QBase ()
 Default constructor, generates "". More...
 
 QBase (const Unit &s)
 Construct dimensioned QBase (e.g. More...
 
virtual ~QBase ()
 Destructor. More...
 
const StringgetUnit () const
 Get units of QBase. More...
 
void setUnit (const Unit &s)
 Re-specify parts of a QBase. More...
 
void setUnit (const QBase &other)
 Set new unit, copied from specified QBase, without changing value. More...
 
Bool isConform (const Unit &s) const
 Check for conformal matching units (e.g. More...
 
Bool isConform (const QBase &other) const
 Using units specified in QBase. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from casacore::Quantum< Vector< T > >
static uInt myType ()
 
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
More...
 
static Bool read (Quantity &res, MUString &in)
 
- 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 37 of file QVector.h.

Constructor & Destructor Documentation

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

zero elements

template<class T>
casacore::QVector< T >::QVector ( const Vector< T > &  v,
const Unit u 
)
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

template<class T>
Quantum<T> casacore::QVector< T >::max ( ) const
template<class T>
Quantum<T> casacore::QVector< T >::min ( ) const
template<class T>
size_t casacore::QVector< T >::nelements ( ) const
template<class T>
QVector<T> casacore::QVector< T >::operator+ ( const QVector< T > &  d) const

add operators as needed

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

access single element

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

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