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>
36class QVector;
37
39
40// <summary>
41// Specialization for Quantum<Vector<T> >
42// </summary>
43
44// <use visibility=export>
45//
46// <prerequisite>
47// <li> <linkto class=Quantum>Quantum</linkto>
48// </prerequisite>
49//
50// <etymology>
51// Vector of quantities.
52// </etymology>
53//
54// <synopsis>
55// Objects of type Quantum<Vector<Double> > are used often in our code.
56// We need a way to access individual elements easily
57// </synopsis>
58
59template <class T>
60class QVector : public Quantum<Vector<T>> {
61 public:
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 Quantum<T> min() const;
89
90 Quantum<T> max() const;
91};
92
93} // namespace casacore
94
95#ifndef CASACORE_NO_AUTO_TEMPLATES
96#include <casacore/casa/Quanta/QVector.tcc>
97#endif
98
99#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)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
QVector< Double > QVD
Definition QVector.h:38