casacore
Loading...
Searching...
No Matches
QVector.h
Go to the documentation of this file.
1//# Quantum.h: class to manipulate physical, dimensioned quantities
2//# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: casa-feedback@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25
26#ifndef CASA_QVECTOR_H
27#define CASA_QVECTOR_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Quanta/Quantum.h>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35template <class T> class QVector;
36
38
39// <summary>
40// Specialization for Quantum<Vector<T> >
41// </summary>
42
43// <use visibility=export>
44//
45// <prerequisite>
46// <li> <linkto class=Quantum>Quantum</linkto>
47// </prerequisite>
48//
49// <etymology>
50// Vector of quantities.
51// </etymology>
52//
53// <synopsis>
54// Objects of type Quantum<Vector<Double> > are used often in our code.
55// We need a way to access individual elements easily
56// </synopsis>
57
58template <class T> class QVector : public Quantum<Vector<T> > {
59
60 public:
61
62 // zero elements
64
65 QVector(const Vector<T>& v, const Unit& u);
66
67 // convert a Vector of Quanta to a QVector. Useful
68 // when reading a table column of Quanta. All elements in
69 // q will be converted to units of the first element in q.
70 // An exception will be thrown if not all elements in q conform
71 // to the same unit.
73
74 // access single element
76
77 size_t size() const;
78
79 size_t nelements() const;
80
81 void scale(T d);
82
83 // add operators as needed
87
88
89 Quantum<T> min() const;
90
91 Quantum<T> max() const;
92
93};
94
95}
96
97#ifndef CASACORE_NO_AUTO_TEMPLATES
98#include <casacore/casa/Quanta/QVector.tcc>
99#endif
100
101#endif
size_t nelements() const
QVector< T > operator+(const QVector< T > &d) const
add operators as needed
Quantum< T > min() const
Quantum< T > operator[](uInt index) const
access single element
size_t size() const
QVector(const Vector< Quantum< T > > &q)
convert a Vector of Quanta to a QVector.
Quantum< T > max() const
QVector< T > operator-(const QVector< T > &d) const
QVector()
zero elements
QVector< T > operator/(T d) const
QVector(const Vector< T > &v, const Unit &u)
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
QVector< Double > QVD
Definition QVector.h:37