Loading...
Searching...
No Matches
casacore::NNLSMatrixSolver Class Reference
scimath package (libcasa_scimath) » Mathematics_module » Mathematics_module_internal_classes

More...

`#include <NNLSMatrixSolver.h>`

## Public Member Functions

| NNLSMatrixSolver ()
| Default Constructor.
| NNLSMatrixSolver (const NNLSMatrixSolver &other)
| Copy Constructor.
| NNLSMatrixSolver (const Matrix< FType > &A, const Vector< FType > &B)
| Create a NNLSMatrixSolver from a matrix A and a Vector B Warning: A and B are accessed by reference, so don't modify them during the lifetime of the NNLSMatrixSolver .
| ~NNLSMatrixSolver ()
| Destructor.
Bool | solve ()
| Solve for the X vector.
Public Member Functions inherited from casacore::MatrixSolver
| MatrixSolver ()
| Default Constructor.
| MatrixSolver (const MatrixSolver &other)
| Copy Constructor.
| MatrixSolver (const Matrix< FType > &A, const Vector< FType > &B)
| Create a MatrixSolver from a matrix A and a Vector B Warning: A and B are accessed by reference, so do not modify them during the lifetime of the MatrixSolver .
virtual | ~MatrixSolver ()
| Virtual destructor: calls all derived class destructors.
MatrixSolver & | operator= (const MatrixSolver &other)
| Assignment operator: uses reference semantics, i.e., it references the internal arrays of other.
void | setAB (const Matrix< FType > &A, const Vector< FType > &B)
| Set A matrix and B vector.
void | setX (const Vector< FType > &X)
| Set initial value of X.
Bool | accurateSolution ()
| Is the current solution good enough?
const Vector< FType > & | getResidual ()
| Return residual vector B-AX.
const Vector< FType > & | getSolution ()
| Return solution vector.
void | setTolerance (FType tol)
| Set the tolerance for solution.
FType | Tolerance ()
| Return the tolerance for solution.
void | setMaxIters (uInt maxiters)
| Set the maximum number of iterations.
uInt | MaxIters ()
| Return the maximum number of iterations.
void | setGain (FType g)
| Set the gain for solution.
FType | Gain ()
| Return the gain for solution.
void | setSolved (Bool s)
| Set status of solution.
Bool | Solved ()
| Return status of solution.
FType | getNorm ()
| Return norm of solution i.e.

## Additional Inherited Members

Protected Member Functions inherited from casacore::MatrixSolver
virtual LogSink & | logSink ()
Protected Attributes inherited from casacore::MatrixSolver
LogSink | logSink_p
Matrix< FType > | AMatrix
| the A matrix data member
Vector< FType > | BVector
| the constraint vector data member
Vector< FType > | RVector
| The residual vector data member.
Vector< FType > | XVector
| The solution vector data member.
FType | RNorm
| The solution norm i.e.
FType | BNorm
| The data norm i.e.

## Detailed Description

NNLSMatrixSolver.h: the base class for NNLS solvers of linear equations AX=B

### Intended use:

Internal

### Review Status

Date Reviewed:
  ",

### Prerequisite

- Matrix, Vector

### Etymology

NNLS stands for Projection Onto Convex Sets. The idea is very simple: to find a solution to AX=B simply take the residual vector B-AX and operate on it to keep only the bits that obey some constraint e.g. positivity. Add this part to the current estimate of the solution vector and iterate. Both CLEAN and Gerchberg-Saxon are NNLS algorithms. If the projection Operators are convex then the process is guaranteed to converge (Youla, 1970).

### Synopsis

NNLSMatrixSolver is a complete class. To use it, simply add Operators

1. I do not know how to do this yet but it should look something like NNLSMatrixSolver NNLS(amatrix, bvector);NNLS.addOperator(foo);

### To Do

- Add list of operators

Definition at line 69 of file NNLSMatrixSolver.h.

## Constructor & Destructor Documentation

## NNLSMatrixSolver() [1/3]

casacore::NNLSMatrixSolver::NNLSMatrixSolver | ( |  | ) |

Default Constructor.

Referenced by NNLSMatrixSolver().

## NNLSMatrixSolver() [2/3]

casacore::NNLSMatrixSolver::NNLSMatrixSolver | ( | const NNLSMatrixSolver & | other | ) |

Copy Constructor.

References NNLSMatrixSolver().

## NNLSMatrixSolver() [3/3]

casacore::NNLSMatrixSolver::NNLSMatrixSolver | ( | const Matrix< FType > & | A,
|  | const Vector< FType > & | B )

Create a NNLSMatrixSolver from a matrix A and a Vector B
Warning: A and B are accessed by reference, so don't modify them during the lifetime of the NNLSMatrixSolver
.

## ~NNLSMatrixSolver()

casacore::NNLSMatrixSolver::~NNLSMatrixSolver | ( |  | ) |

Destructor.

## Member Function Documentation

## solve()

Bool casacore::NNLSMatrixSolver::solve | ( |  | ) |

virtual

Solve for the X vector.

Reimplemented from casacore::MatrixSolver.

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

- scimath/Mathematics/NNLSMatrixSolver.h