FV3 Bundle
|
GMRESR solver for Ax=b. More...
#include <cmath>
#include <vector>
#include "oops/util/dot_product.h"
#include "oops/util/formats.h"
#include "oops/util/Logger.h"
Go to the source code of this file.
Namespaces | |
oops | |
The namespace for the main oops code. | |
Functions | |
template<typename VECTOR , typename AMATRIX , typename PMATRIX > | |
double | oops::GMRESR (VECTOR &xx, const VECTOR &bb, const AMATRIX &A, const PMATRIX &precond, const int maxiter, const double tolerance) |
GMRESR solver for Ax=b.
GMRESR solver for Ax=b. (H.A. Van der Vorst and C. Vuik, 1994, Numerical Linear Algebra with Applications, 1(4), 369-386.) A must be square, but need not be symmetric. (For a symmetric matrix, and constant preconditioner, GMRESR is simply PCG with full orthogonalisation.) A preconditioner must be supplied that, given a vector q, returns an approximate solution of Ap=q. The preconditioner can be variable.
On entry:
On exit, x will contain the solution. The return value is the achieved reduction in residual norm.
Iteration will stop if the maximum iteration limit "maxiter" is reached or if the residual norm reduces by a factor of "tolerance".
VECTOR must implement:
AMATRIX and PMATRIX must implement a method:
which applies the matrix to the first argument, and returns the matrix-vector product in the second. (Note: the const is optional, but recommended.)
Definition in file GMRESR.h.