MatrixSolver.h
Classes
- MatrixSolver -- MatrixSolver.h: the base class for solvers of linear equations AX=B (full description)
Interface
- Public Members
- MatrixSolver()
- MatrixSolver(const MatrixSolver & other)
- MatrixSolver(const Matrix<FType> & A, const Vector<FType> & B)
- virtual ~MatrixSolver()
- MatrixSolver & operator=(const MatrixSolver & other)
- void setAB(const Matrix<FType> & A, const Vector<FType> & B)
- void setX(const Vector<FType> & X)
- virtual Bool solve()
- Bool accurateSolution()
- const Vector<FType> & getResidual()
- const Vector<FType> & getSolution()
- void setTolerance(FType tol)
- FType Tolerance()
- void setMaxIters(uInt maxiters)
- uInt MaxIters()
- void setGain(FType g)
- FType Gain()
- void setSolved(Bool s)
- Bool Solved()
- FType getNorm()
- Protected Members
- virtual LogSink& logSink()
Review Status
- Date Reviewed:
- ",
Prerequisite
Etymology
The MatrixSolver class name reflects its use as the base class for solving
Linear Equations of the form AX=B. This class is purely virtual
and provides the essential implementation for derived solvers
classes.
Synopsis
The MatrixSolver class is a purely virtual base class. The programmer needs
to define the following functions in a class derived from MatrixSolver:
- the derived destructor.
- void setImageAndPsf(const Array<FType> & image, const
Array<FType> & psf); Set the image and the Point Spread Function
(beam). Setting this should reset the internal state, e.g.
CurrentIter()==0.
- Bool solve(); Perform solution of AX=B.
Returns True if algorithm has converged or stop criterium reached.
To Do
Member Description
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
A and B are accessed by reference, so do not
modify them during the lifetime of the 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
virtual Bool solve()
Solve for the X vector.
Is the current solution good enough?
Return residual vector B-AX
Return solution vector
Set the tolerance for solution
Return the tolerance for solution
Set the maximum number of iterations.
Return the maximum number of iterations.
Set the gain for solution
Return the gain for solution
Set status of solution
Return status of solution
Return norm of solution i.e. ||B-AX||