Quantity( Double value, String unit); // or: Unit unit Quantum<Type> ( Type value, String unit) // or: Unit unit
A unit is a string of known unit fields separated by 'space' or '.' (to indicate multiply) or '/' (to indicate divide). See the Unit class for details. Example: km/s/(Mpc.s)2 is identical to km.s-1.Mpc-2.s-2
This file defines the logical operations that can be done on Quantum<T>.
They can be subdivided into various groupings:
Straight comparisons: unequal if non-conforming units or different values
if units made equal. I.e. 1in != 1m ,
1in != 1s , 36in == 1yd ./
Near-ness tests: unequal if non-conforming units. In other cases the
tolerance is in the units of the first argument, with the second argument
converted, if necessary, to the same units as the first.
Note (SUN?) compiler does not accept default arguments in template functions
Comparisons. The comparisons are done on values at equal units with
transparent conversion if necessary.
Special make Bool routines to cater for array comparisons
Bool near(const Quantum<Qtype> &left, const Quantum<Qtype> &other)
Bool near(const Quantum<Qtype> &left, const Quantum<Qtype> &other, Double tol)
Bool near(const Quantum<Qtype> &left, const Qtype &other)
Bool near(const Quantum<Qtype> &left, const Qtype &other, Double tol)
Bool near(const Qtype &left, const Quantum<Qtype> &other)
Bool near(const Qtype &left, const Quantum<Qtype> &other, Double tol)
Bool nearAbs(const Quantum<Qtype> &left, const Quantum<Qtype> &other)
Bool nearAbs(const Quantum<Qtype> &left, const Quantum<Qtype> &other, Double tol)
Bool nearAbs(const Quantum<Qtype> &left, const Qtype &other)
Bool nearAbs(const Quantum<Qtype> &left, const Qtype &other, Double tol)
Bool nearAbs(const Qtype &left, const Quantum<Qtype> &other)
Bool nearAbs(const Qtype &left, const Quantum<Qtype> &other, Double tol)
Bool operator<(const Quantum<Qtype> &left, const Quantum<Qtype> &other)
Bool operator<(const Quantum<Qtype> &left, const Qtype &other)
Bool operator<(const Qtype &left, const Quantum<Qtype> &other)
Bool operator>(const Quantum<Qtype> &left, const Quantum<Qtype> &other)
Bool operator>(const Quantum<Qtype> &left, const Qtype &other)
Bool operator>(const Qtype &left, const Quantum<Qtype> &other)
Bool operator<=(const Quantum<Qtype> &left, const Quantum<Qtype> &other)
Bool operator<=(const Quantum<Qtype> &left, const Qtype &other)
Bool operator<=(const Qtype &left, const Quantum<Qtype> &other)
Bool operator>=(const Quantum<Qtype> &left, const Quantum<Qtype> &other)
Bool operator>=(const Quantum<Qtype> &left, const Qtype &other)
Bool operator>=(const Qtype &left, const Quantum<Qtype> &other)
Thrown Exceptions
Bool QMakeBool(Int val)
Bool QMakeBool(const LogicalArray &val)