Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
gmres.h
1 #ifndef __GMRES_H
2 #define __GMRES_H
3 
4 #include "mathlib.h"
5 
6 // =====================================================================
7 // GMRES(restart) algorithm according to
8 //
9 // R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. Donato, J. Dongarra,
10 // V. Eijkhout, R. Pozo, Ch. Romine, H. van der Vorst
11 // Templates for the Solution of Linear Systems:
12 // Building Blocks for Iterative Solvers
13 // SIAM, Philadelphia, 1994
14 // =====================================================================
15 
16 template<class MT>
17 int gmres (int restart, const TMatrix<MT> &A, const TVector<MT> &b,
18  TVector<MT> &x, TPreconditioner<MT> *precon, double &elim, int maxit,
19  void (*clbk)(void*) = 0);
20 // Solve Ax = b with generalised minimal residual method
21 
22 template<class MT>
23 int gmres (int restart, TVector<MT> (*Av_clbk)(const TVector<MT> &v,
24  void *context), const TVector<MT> &b, TVector<MT> &x,
25  TPreconditioner<MT> *precon, double &elim, int maxit, void *context);
26 // This "matrix-less" version of gmres can be used whenever matrix A is
27 // not available in explicit form. The user provides a callback function
28 // (Av_clbk) which is called whenever the product of the matrix with a
29 // vector v is required.
30 
31 #endif // !__GMRES_H
Definition: gsmatrix.h:48
Virtual base class for all matrix types (dense and sparse)
Definition: matrix.h:43