MVDouble.h

Classes

MVDouble -- Class to distinguish external and Measure internal Double (full description)

class MVDouble : public MeasValue

Interface

Public Members
MVDouble()
MVDouble(const MVDouble &other)
MVDouble &operator=(const MVDouble &other)
MVDouble(Double d)
MVDouble(const Quantity &other)
MVDouble(const Quantum<Vector<Double> > &other)
MVDouble(const Vector<Double> &other)
MVDouble(const Vector<Quantity> &other)
~MVDouble()
operator Double() const
MVDouble &operator+=(const MVDouble &other)
MVDouble &operator-=(const MVDouble &other)
Bool operator==(const MVDouble &other) const
Bool operator!=(const MVDouble &other) const
Bool near(const MVDouble &other, Double tol = 1e-13) const
Bool nearAbs(const MVDouble &other, Double tol = 1e-13) const
virtual uInt type() const
static void assure(const MeasValue &in)
virtual void print(ostream &os) const
virtual MeasValue *clone() const
virtual Vector<Double> getVector() const
virtual void putVector(const Vector<Double> &in)
virtual Vector<Quantum<Double> > getRecordValue() const
virtual Bool putValue(const Vector<Quantum<Double> > &in)

Description

Review Status

Reviewed By:
tcornwel
Date Reviewed:
1996/02/23
Programs:
Tests:

Prerequisite

Etymology

From Measure, Value and Double

Synopsis

An MVDouble is a simple Double, to be used in simple, single value Measures. Requirements can be found in the MeasValue base class.
The only reasonable constructor is (but all MeasValue constructors are present) MVDouble(Double); and an operator Double takes care of all other possibilities. Its external use is for MeasConvert, to distinguish between input in internal Measure units, and values which have to have units applied.

Example

See e.g. MFrequency

Motivation

To aid coordinate transformations possibilities

To Do

Member Description

MVDouble()

Default constructor: generate a zero value

MVDouble(const MVDouble &other)

Copy constructor

MVDouble &operator=(const MVDouble &other)

Copy assignment

MVDouble(Double d)

Constructor from Double

MVDouble(const Quantity &other)
MVDouble(const Quantum<Vector<Double> > &other)

Constructor from Quantum : value taken will be the canonical value

MVDouble(const Vector<Double> &other)
MVDouble(const Vector<Quantity> &other)

Constructor from Vector. A zero value will be taken for an empty vector, the canonical value for a quantum vector.

Thrown Exceptions

~MVDouble()

Destructor

operator Double() const

Conversion operator

MVDouble &operator+=(const MVDouble &other)
MVDouble &operator-=(const MVDouble &other)

Addition

Bool operator==(const MVDouble &other) const
Bool operator!=(const MVDouble &other) const
Bool near(const MVDouble &other, Double tol = 1e-13) const
Bool nearAbs(const MVDouble &other, Double tol = 1e-13) const

Comparisons

virtual uInt type() const
static void assure(const MeasValue &in)

Tell me your type

virtual void print(ostream &os) const

Print data

virtual MeasValue *clone() const

Clone

virtual Vector<Double> getVector() const

Adjust value: taken from base class, a NOP. Get the value in internal units

virtual void putVector(const Vector<Double> &in)

Set the value from internal units (set 0 for empty vector)

virtual Vector<Quantum<Double> > getRecordValue() const

Get the internal value as a Vector<Quantity>. Usable in records. The getXRecordValue() gets additional information for records. Note that the Vectors could be empty.

virtual Bool putValue(const Vector<Quantum<Double> > &in)

Set the internal value if correct values and dimensions