casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::QMath_global_functions_Quantum_mathematical_operations Struct Reference

Mathematical operations for the Quantum class. More...

#include <QMath.h>

Public Member Functions

template<class Qtype >
Quantum< Qtype > min (const Quantum< Qtype > &left, const Quantum< Qtype > &other)
 min and max More...
 
template<class Qtype >
Quantum< Qtype > max (const Quantum< Qtype > &left, const Quantum< Qtype > &other)
 
template<class Qtype >
Quantum< Qtype > operator+ (const Quantum< Qtype > &left, const Qtype &other)
 Unary operations. More...
 
template<class Qtype >
Quantum< Qtype > operator+ (const Qtype &left, const Quantum< Qtype > &other)
 
template<class Qtype >
Quantum< Qtype > operator- (const Quantum< Qtype > &left, const Qtype &other)
 
template<class Qtype >
Quantum< Qtype > operator- (const Qtype &left, const Quantum< Qtype > &other)
 
template<class Qtype >
Quantum< Qtype > operator* (const Quantum< Qtype > &left, const Qtype &other)
 
template<class Qtype >
Quantum< Qtype > operator* (const Qtype &left, const Quantum< Qtype > &other)
 
template<class Qtype >
Quantum< Qtype > operator/ (const Quantum< Qtype > &left, const Qtype &other)
 
template<class Qtype >
Quantum< Qtype > operator/ (const Qtype &left, const Quantum< Qtype > &other)
 
template<class Qtype >
Quantum< Qtype > pow (const Quantum< Qtype > &left, Int p)
 Some useful arithmetic (linear) functions. More...
 
template<class Qtype >
Quantum< Qtype > root (const Quantum< Qtype > &left, Int p)
 
template<class Qtype >
Quantum< Qtype > sqrt (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > abs (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > ceil (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > floor (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > sin (const Quantum< Qtype > &left)
 Trigonometric and exponential functions For direct functions input should be in angles, output will be empty units. More...
 
template<class Qtype >
Quantum< Qtype > cos (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > tan (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > asin (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > acos (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > atan (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > atan2 (const Quantum< Qtype > &left, const Quantum< Qtype > &other)
 
template<class Qtype >
Quantum< Qtype > atan2 (const Quantum< Qtype > &left, const Qtype &other)
 
template<class Qtype >
Quantum< Qtype > atan2 (const Qtype &left, const Quantum< Qtype > &other)
 
template<class Qtype >
Quantum< Qtype > log (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > log10 (const Quantum< Qtype > &left)
 
template<class Qtype >
Quantum< Qtype > exp (const Quantum< Qtype > &left)
 
Int ceil (const Int &val)
 Functions to implement integer ceil/floor and others. More...
 
Int floor (const Int &val)
 
Array< Complex > operator* (const Array< Complex > &in, Double f)
 
Array< Complex > operator/ (const Array< Complex > &in, Double f)
 
Array< DComplex > operator* (const Array< DComplex > &in, Double f)
 
Array< DComplex > operator/ (const Array< DComplex > &in, Double f)
 
Array< Floatoperator* (const Array< Float > &in, Double f)
 
Array< Floatoperator/ (const Array< Float > &in, Double f)
 
Array< Intoperator* (const Array< Int > &in, Double f)
 
Array< Intoperator/ (const Array< Int > &in, Double f)
 

Detailed Description

Mathematical operations for the Quantum class.

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tQuantum

Prerequisite

Etymology

QMath derived from Quantum Mathematical functions

Synopsis

Quantities are values with a unit. Their basic specification can be one of two forms:

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 mathematical operations that can be done on Quantum<T>.

They can be subdivided into various groupings:

The operations/functions defined are:


Warning: Some operators are implemented as member functions, and can be found in the Quantum class;

Motivation

To separate the mathematical operations from Quantum.

To Do

Definition at line 120 of file QMath.h.

Member Function Documentation

template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::abs ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::acos ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::asin ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::atan ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::atan2 ( const Quantum< Qtype > &  left,
const Quantum< Qtype > &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::atan2 ( const Quantum< Qtype > &  left,
const Qtype &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::atan2 ( const Qtype &  left,
const Quantum< Qtype > &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::ceil ( const Quantum< Qtype > &  left)
Int casacore::QMath_global_functions_Quantum_mathematical_operations::ceil ( const Int val)

Functions to implement integer ceil/floor and others.

template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::cos ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::exp ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::floor ( const Quantum< Qtype > &  left)
Int casacore::QMath_global_functions_Quantum_mathematical_operations::floor ( const Int val)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::log ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::log10 ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::max ( const Quantum< Qtype > &  left,
const Quantum< Qtype > &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::min ( const Quantum< Qtype > &  left,
const Quantum< Qtype > &  other 
)

min and max

template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::operator* ( const Quantum< Qtype > &  left,
const Qtype &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::operator* ( const Qtype &  left,
const Quantum< Qtype > &  other 
)
Array<Complex> casacore::QMath_global_functions_Quantum_mathematical_operations::operator* ( const Array< Complex > &  in,
Double  f 
)
Array<DComplex> casacore::QMath_global_functions_Quantum_mathematical_operations::operator* ( const Array< DComplex > &  in,
Double  f 
)
Array<Float> casacore::QMath_global_functions_Quantum_mathematical_operations::operator* ( const Array< Float > &  in,
Double  f 
)
Array<Int> casacore::QMath_global_functions_Quantum_mathematical_operations::operator* ( const Array< Int > &  in,
Double  f 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::operator+ ( const Quantum< Qtype > &  left,
const Qtype &  other 
)

Unary operations.

See Quantum class In place arithmetic functions: left hand side changed in place

Thrown Exceptions

  • AipsError if non-conforming units (+ and -)
  • AipsError if illegal result unit (* and /; programming error)

See Quantum class Arithmetic operators: return Quantum<T>

Thrown Exceptions

  • AipsError if non-conforming units (+ and -)

See Quantum class for equal argument types

template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::operator+ ( const Qtype &  left,
const Quantum< Qtype > &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::operator- ( const Quantum< Qtype > &  left,
const Qtype &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::operator- ( const Qtype &  left,
const Quantum< Qtype > &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::operator/ ( const Quantum< Qtype > &  left,
const Qtype &  other 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::operator/ ( const Qtype &  left,
const Quantum< Qtype > &  other 
)
Array<Complex> casacore::QMath_global_functions_Quantum_mathematical_operations::operator/ ( const Array< Complex > &  in,
Double  f 
)
Array<DComplex> casacore::QMath_global_functions_Quantum_mathematical_operations::operator/ ( const Array< DComplex > &  in,
Double  f 
)
Array<Float> casacore::QMath_global_functions_Quantum_mathematical_operations::operator/ ( const Array< Float > &  in,
Double  f 
)
Array<Int> casacore::QMath_global_functions_Quantum_mathematical_operations::operator/ ( const Array< Int > &  in,
Double  f 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::pow ( const Quantum< Qtype > &  left,
Int  p 
)

Some useful arithmetic (linear) functions.

Return the Quantum raised to specified power; take the (integer) root; and integerization

Thrown Exceptions

template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::root ( const Quantum< Qtype > &  left,
Int  p 
)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::sin ( const Quantum< Qtype > &  left)

Trigonometric and exponential functions For direct functions input should be in angles, output will be empty units.

For inverse functions input should be empty, output in radians

Thrown Exceptions

  • AipsError if incorrect units. I.e. non-angle for direct functions, non-empty for inverse functions; non-empty for exp and log

template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::sqrt ( const Quantum< Qtype > &  left)
template<class Qtype >
Quantum<Qtype> casacore::QMath_global_functions_Quantum_mathematical_operations::tan ( const Quantum< Qtype > &  left)

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