qmr Programmers Guide Contents | Index |  Search

Category:itl,algorithms Component type:function
Prototype
template <class Matrix, class Vector, class VectorB, class Precond1, class Precond2, class Iteration>
int qmr(const Matrix &A, Vector &x, const VectorB &b, const Precond1 &M1, const Precond2 &M2, Iteration& iter) ;
Description
This routine solves the unsymmetric linear system Ax = b using the Quasi-Minimal Residual method.
 return value meaning 0 convergence within maximum iterations 1 no convergence after maximum iterations 2 breakdown in rho 3 breakdown in beta 4 breakdown in gamma 5 breakdown in delta 6 breakdown in ep 7 breakdown in xi
See: R. W. Freund and N. M. Nachtigal, A quasi-minimal residual method for non-Hermitian linear systems, Numerical Math., 60(1991), pp. 315-339
Definition
qmr.h
Preconditions
Complexity
Example
In qmr.cc:
```  Matrix A(5, 5);
// Fill matrix...
dense1D<Type> x(A.nrows(), Type(0));
dense1D<Type> b(A.ncols());
for (dense1D<Type>::iterator i=b.begin(); i!=b.end(); i++)
*i = 1.;

//SSOR preconditioner
SSOR<Matrix> precond(A);
//iteration
noisy_iteration<double> iter(b, max_iter, 1e-6);
//qmr algorithm
qmr(A, x, b, precond.left(), precond.right(), iter);

```
Notes