LSQaips.h

Classes

LSQaips -- Interface for aips++ Vectors in least squares fitting (full description)

class LSQaips : public LSQFit

Interface

Public Members
LSQaips(uInt nUnknowns, uInt nConstraints=0) : s(nUnknowns, nConstraints)
LSQaips(uInt nUnknowns, const LSQReal &, uInt nConstraints=0) : LSQFit(nUnknowns, LSQReal(), nConstraints)
LSQaips(uInt nUnknowns, const LSQComplex &, uInt nConstraints=0) : LSQFit(nUnknowns, LSQComplex(), nConstraints)
LSQaips() : LSQFit()
LSQaips(const LSQaips &other) : LSQFit(other)
LSQaips &operator=(const LSQaips &other)
~LSQaips()
template <class U> void solve(U *sol)
template <class U> void solve(std::complex<U> *sol)
template <class U> void solve(U &sol)
template <class U> void solve(U<U> &sol)
template <class U> Bool solveLoop(uInt &nRank, U *sol, Bool doSVD=False)
template <class U> Bool solveLoop(uInt &nRank, std::complex<U> *sol, Bool doSVD=False)
template <class U> Bool solveLoop(uInt &nRank, U &sol, Bool doSVD=False)
template <class U> Bool solveLoop(uInt &nRank, U<U> &sol, Bool doSVD=False)
template <class U> Bool solveLoop(Double &fit, uInt &nRank, U *sol, Bool doSVD=False)
template <class U> Bool solveLoop(Double &fit, uInt &nRank, std::complex<U> *sol, Bool doSVD=False)
template <class U> Bool solveLoop(Double &fit, uInt &nRank, U &sol, Bool doSVD=False)
template <class U> Bool solveLoop(Double &fit, uInt &nRank, U<U> &sol, Bool doSVD=False)
template <class U> Bool getCovariance(U *covar)
template <class U> Bool getCovariance(std::complex<U> *covar)
template <class U> Bool getCovariance(U<U> &covar)
template <class U> Bool getErrors(U *errors)
template <class U> Bool getErrors(std::complex<U> *errors)
template <class U> Bool getErrors(U &errors)
template <class U> Bool getErrors(U<U> &errors)

Description

Prerequisite

Etymology

From Least SQuares and aips++

Synopsis

The interface used in the LSQaips class is in terms of aips++ Vectors directly, rather than an STL iterator (like VectorSTLIterator) based on it.

Its functionality is identical to that of the LSQFit class, although it will be faster to use the iterator interface directly, since constructing of temporary iterators can be avoided

Example

See the tLSQaips.cc program for extensive examples. Note: this class is in an interim state.

Motivation

The class was written to enable easy tranistion from the current Vector to the Vector::iterator interface.

To Do

Member Description

LSQaips(uInt nUnknowns, uInt nConstraints=0) : s(nUnknowns, nConstraints)

Construct an object with the number of unknown, knowns and constraints, and type, using the default collinearity factor and the default Levenberg-Marquardt adjustment factor

Assume real

LSQaips(uInt nUnknowns, const LSQReal &, uInt nConstraints=0) : LSQFit(nUnknowns, LSQReal(), nConstraints)
LSQaips(uInt nUnknowns, const LSQComplex &, uInt nConstraints=0) : LSQFit(nUnknowns, LSQComplex(), nConstraints)

Construct an object with the number of unknown, knowns and constraints, and type, using the default collinearity factor and the default Levenberg-Marquardt adjustment factor

LSQaips() : LSQFit()

Default constructor (empty, real, only usable after a set(nUnknowns))

LSQaips(const LSQaips &other) : LSQFit(other)

Copy constructor (deep copy)

LSQaips &operator=(const LSQaips &other)

Assignment (deep copy)

~LSQaips()

template <class U> void solve(U *sol)
template <class U> void solve(std::complex<U> *sol)
template <class U> void solve(U &sol)
template <class U> void solve(U<U> &sol)

Solve normal equations. The solution will be given in sol.

template <class U> Bool solveLoop(uInt &nRank, U *sol, Bool doSVD=False)
template <class U> Bool solveLoop(uInt &nRank, std::complex<U> *sol, Bool doSVD=False)
template <class U> Bool solveLoop(uInt &nRank, U &sol, Bool doSVD=False)
template <class U> Bool solveLoop(uInt &nRank, U<U> &sol, Bool doSVD=False)
template <class U> Bool solveLoop(Double &fit, uInt &nRank, U *sol, Bool doSVD=False)
template <class U> Bool solveLoop(Double &fit, uInt &nRank, std::complex<U> *sol, Bool doSVD=False)
template <class U> Bool solveLoop(Double &fit, uInt &nRank, U &sol, Bool doSVD=False)
template <class U> Bool solveLoop(Double &fit, uInt &nRank, U<U> &sol, Bool doSVD=False)

Solve a Levenberg-Marquardt loop. Note that the solution sol is used both and input and output. No check on the size is done.

template <class U> Bool getCovariance(U *covar)
template <class U> Bool getCovariance(std::complex<U> *covar)
template <class U> Bool getCovariance(U<U> &covar)

Get the covariance matrix. False if an error occurred (of size nUnknowns * nUnknowns)

template <class U> Bool getErrors(U *errors)
template <class U> Bool getErrors(std::complex<U> *errors)
template <class U> Bool getErrors(U &errors)
template <class U> Bool getErrors(U<U> &errors)

Get main diagonal of covariance function (of size nUnknowns)