Loading...
Searching...
No Matches
Mathematics_module
scimath package (libcasa_scimath)

More...

## Topics

| Mathematics_module_internal_classes
| Internal Mathematics_module classes and functions.

## Classes

class | casacore::AutoDiff< T >
| More...
class | casacore::AutoDiffA< T >
| More...
struct | casacore::AutoDiffIO_global_functions_AutoDiff_IO_operations
| More...
struct | casacore::AutoDiffMath_global_functions_AutoDiff_mathematical_operations
| More...
class | casacore::AutoDiffX< T >
| More...
class | casacore::Combinatorics
| More...
class | casacore::ConvolveGridder< Domain, Range >
| More...
class | casacore::Convolver< FType >
| Forward Declarations. More...
class | casacore::DFTError
| More...
class | casacore::DFTServer< T >
| Class containing methods for doing n-D slow Fourier transforms. More...
class | casacore::FFTPack
| More...
class | casacore::FFTEnums
| More...
class | casacore::FFTServer< T, S >
| A class with methods for Fast Fourier Transforms. More...
class | casacore::FFTW
| More...
class | casacore::GaussianBeam
| More...
class | casacore::Geometry
| More...
class | casacore::Gridder< Domain, Range >
| More...
class | casacore::Interpolate2D
| More...
class | casacore::InterpolateArray1D< Domain, Range >
| More...
class | casacore::MathFuncError
| More...
struct | casacore::MathFunc_global_functions_spheriodal_functions
| Fred Schwab function to calculate spheriodal functions. More...
struct | casacore::MathFunc_global_functions_FUNCTYPE_enum
| Enum used to identify function type for MathFunc class. More...
struct | casacore::FuncId
| Function ID, for use by MathFunc class. More...
class | casacore::MathFunc< T >
| A class to generate values of mathematical functions. More...
class | casacore::Unary< T >
| Unary. More...
class | casacore::GaussianConv< T >
| Gaussian. More...
class | casacore::KB_Conv< T >
| A Kaiser-Bessel function. More...
class | casacore::Mod_KB_Conv< T >
| A Kaiser-Bessel function multiplied by a Gaussian. More...
class | casacore::Sinc_Conv< T >
| Sine x / x function. More...
class | casacore::Sph_Conv< T >
| Spheroidal function. More...
class | casacore::ExpSincConv< T >
| Exponential times a Sinc. More...
struct | casacore::MatrixMathLA_global_functions_Linear_Algebra
| More...
class | casacore::MedianSlider
| More...
class | casacore::NNGridder< Domain, Range >
| More...
class | casacore::NumericTraits< T >
| More...
class | casacore::NumericTraits_F< Float >
| NumericTraits specialization for Float. More...
class | casacore::NumericTraits_D< Double >
| NumericTraits specialization for Double. More...
class | casacore::NumericTraits_C< Complex >
| NumericTraits specialization for Complex. More...
class | casacore::NumericTraits_DC< DComplex >
| NumericTraits specialization for DComplex. More...
class | casacore::NumericTraits< Float >
| More...
class | casacore::NumericTraits< Double >
| A specialisation for T=Double of the NumericTraits class. More...
class | casacore::NumericTraits< Complex >
| A specialisation for T=Complex of the NumericTraits class. More...
class | casacore::RigidVector< T, n >
| More...
struct | casacore::RigidVector_global_functions_math
| Mathematical operations involving RigidVectors . More...
class | casacore::SCSL
| More...
class | casacore::Smooth< T >
| More...
class | casacore::SparseDiff< T >
| More...
class | casacore::SparseDiffA< T >
| More...
struct | casacore::SparseDiffIO_global_functions_SparseDiff_IO_operations
| More...
struct | casacore::SparseDiffMath_global_functions_SparseDiff_mathematical_operations
| More...
class | casacore::SparseDiffX< T >
| More...
class | casacore::SquareMatrix< T, n >
| More...
struct | casacore::SquareMatrix_global_functions_SqM_global_functions
| Various global math and IO functions. More...
class | casacore::VanVleck
| More...
class | casacore::VectorKernel
| More...

## Functions

| casacore::HistAcc (const uInt nBuff)
| Makes a histogram from input values.
| casacore::StatAcc ()
| A statistics accumulator

## Detailed Description

Mathematical types, constants, operations

See below for an overview of the classes in this module.

### Prerequisite

- At least high school (and preferably undergraduate level) understanding of mathematics.

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25

### Etymology

Mathematicians may argue that everything is mathematics, and hence all of Casacore should be in this module. However this module will only contain core mathematical operations that are independent of astronomical applications.

### Synopsis

The Mathematics module has a variety of mathematical classes and functions. Not all numerical operations are found herein. Very complicated operations might be in their own module. such as deconvolution. Many whole array operations are in the (see (file="ArrayMath.h"))ArrayMath global functions (part of the Arrays module). Mathematical operations on Lattices are found in the Lattices module. A wide variety of special Mathematical functions is planned for the Functionals module.

The classes presently in this module fall into the following categories:

- A wrapper around the system math.h functions called (see (file="Math.h"))Math.h. This contains generic mathematical functions. It is required that you always include this file rather than the system math.h file as deficiencies in the system math.h file will be implemented here.
- (see (file=NumericTraits.h))Relationships between different numerical data types.
- Multi-dimensional Fourier transforms are done in the FFTServer class. This decomposes the transforms into a one-dimensional transforms.
- Numerical Convolution
  (both linear and circular) of multi-dimensional Arrays.
- (see (file="Random.h"))Random numbers in a wide variety of distributions.
- Interpolation in one dimension is performed by the Interpolate1D class in the Functionals module

## Function Documentation

## HistAcc()

casacore::HistAcc | ( | const uInt | nBuff | ) |

Makes a histogram from input values.

### Review Status

Test programs:
  tHistAcc

### Prerequisite

- module Arrays
- Arrays module

### Etymology

HistAcc stands for `Histogram Accumulator'.

### Template Type Argument Requirements (T)

- The accepted input types are real, i.e. Int, uInt, Float, Double, but not Complex.

### Synopsis

Makes a histogram from input values. The histogram bin parameters may be defined, or determined from the first n input values. The input values are fed to HistAcc via the member function `put'. They can be fed individually, or in the form of an Array.

The histogram `bins' can be defined via the constructor in the form of loop variables: low bin, high bin, bin-width. It is also possible to let the bin parameters be determined automatically from the first n (e.g. n=50) input values. If the actual nr of input values is less than n when the histogram is interrogated in some way, the bin parameters will be determined from what is available.

### Example

It is usually convenient to let the bins be defined automatically:

Matrix<T> vv(30,100); // an array of input values
vv =... // fill the array
HistAcc<T> h(25); // use the first 25 values to define bins
h.put(vv); // accumulate values into histogram
h.printHistogram(cout,"vv"); // print the histogram of vv
Fallible<Double> median = h1.getMedian(); // return the median
casacore::Fallible
Mark a value as valid or invalid.
Definition Fallible.h:121
casacore::Matrix
Definition Matrix.h:87
casacore::HistAcc
HistAcc(const uInt nBuff)
Makes a histogram from input values.
casacore::median
LatticeExprNode median(const LatticeExprNode &expr)

In some cases the bin parameters are pre-defined:

Vector<T> vv(100,0); // a vector (array) of values
vv =... // fill the vector
HistAcc<T> h(-10,20,3); // bins with width 3, between -10 and 20
h.put(vv); // accumulate values into histogram
uInt n = h.getSpurious(l,h);// get the number outside the bins
casacore::Vector
Definition Vector.h:82
casacore::uInt
unsigned int uInt
Definition aipstype.h:49

The internal statistics accumulator can be interrogated explicitly or implicitly:

StatAcc<T> s = h.getStatistics(); // return the internal StatAcc
Fallible<Double> mean = s.getMean(); // get the mean of the input values
Fallible<Double> mean = h.getStatistics().getMean(); // alternative
casacore::StatAcc
StatAcc()
A statistics accumulator
casacore::mean
LatticeExprNode mean(const LatticeExprNode &expr)

### Motivation

*/ template<class T> class HistAcc { public: /** Constructors and destructor. If the bin-parameters low, high and width (for lowest and highest bin, and binwidth) are not specified, they will be determined automatically from the first nBuff input values (which are stored in a temporary buffer).

Referenced by copy(), HistAcc(), and operator=().

## StatAcc()

casacore::StatAcc | ( |  | ) |

A statistics accumulator

### Review Status

Test programs:
  tStatAcc

### Prerequisite

- module Arrays
- Arrays module

### Etymology

StatAcc stands for `Statistics Accumulator'.

### Template Type Argument Requirements (T)

- A statistics accumulator accepts (weighted) input values and calculates simple statistice (min, max, weighted mean, rms etc). The accepted input types are real, i.e. Int, uInt, Float, Double, but not Complex. The reason for this is that the < operator of Complex (needed for min/max) works on the norm in any case, and the sqrt function (needed for rms) yields an ambiguous result.

  Restriction to real types also allows the internal arithmetic type to be Double rather than the input type. The latter would give all kinds of complications with weighting, accuracy and overflow if the input type would be Int or uInt.

### Synopsis

The (weighted) values are fed to StatAcc via the member function `put'. They can be fed individually, or in the form of an Array. The weights are optional (default = 1) and always have type Float.

Asking for a result does not change the internal state. The type of the returned results is always Fallible<Double>. A result is invalid if no input values with non-zero weight have been accumulated yet.

The accumulator can be re-initialised with the function `reset'. Accumulators can be added to each other, which is as if their combined values had been accumulated in the same accumulator.

Some functions have been provided to display a summary of the statistics results. One may choose between a one-line format (with an optional associated header line), and a list.

### Example

StatAcc<T> s; // T is Float, Double, Int etc
Matrix<T> vv(2,5); // a matrix (array) of input values
Matrix<Float> wgt(2,5); // an associated matrix of weights
.... fill vv and wgt with values and individual weights..\.
s.put(vv,wgt); // accumulate the weighted values
Fallible<Double> min = s.getMin(); // return the minimum value
s.reset(); // re-initialise
s.put(vv); // if wgt omitted, default = 1.0
if (s.getRms().isValid() { // check validity of rms
... use it..\.
}
casacore::min
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)

### Motivation

One often needs simple statistics of a series of values, which may occur by themselves or in arrays at various points in a program.
Sincs it is a pain to have to assign accumulation variables, and to write statistics evaluation code (including exceptions), this helper class is provided.

*/ template<class T> class StatAcc { public: /** constructors and destructor.

Referenced by copy(), getStatistics(), operator+(), operator+=(), operator=(), and StatAcc().