|
|
◆ z_qmr()
| void z_qmr |
( |
int |
n, |
|
|
void(*)(int, const doublecomplex[], doublecomplex[]) |
matvec, |
|
|
void(*)(int, const doublecomplex[], doublecomplex[]) |
matvectrans, |
|
|
void(*)(int, const doublecomplex[], doublecomplex[]) |
psolve, |
|
|
void(*)(int, const doublecomplex[], doublecomplex[]) |
psolvetrans, |
|
|
void(*)(int, const doublecomplex[], double, int, int *) |
chkconv, |
|
|
const doublecomplex |
b[], |
|
|
doublecomplex |
x[], |
|
|
int |
maxiter, |
|
|
int * |
iter, |
|
|
double * |
res, |
|
|
int |
lwork, |
|
|
doublecomplex |
work[], |
|
|
int * |
info |
|
) |
| |
Solution of linear system Ax = b using quasi minimum residual (QMR) method (Complex matrices)
- Purpose
- This routine solves the linear system Ax = b using the quasi minimum residual (QMR) iterative method with preconditioning.
- Parameters
-
| [in] | n | Dimension of the matrix. (n >= 0) (if n = 0, returns without computation) |
| [in] | matvec | User supplied subroutine which calculates the matrix and vector product as follows.
void matvec(int n, const doublecomplex x[], doublecomplex y[])
{
Compute A*x, and return result in y[].
}
|
| [in] | matvectrans | User supplied subroutine which calculates the conjugate transposed matrix and vector product as follows.
void matvectrans(int n, const doublecomplex x[], doublecomplex y[])
{
Compute A**H*x, and return result in y[].
}
|
| [in] | psolve | User supplied subroutine which perform the preconditioner solve routine for the linear system M*x = b as follows, where M is a preconditioner metrix.
void psolve(int n, const doublecomplex b[], doublecomplex x[])
{
Solve M*x = b, and return solution in x[].
}
|
| [in] | psolvetrans | User supplied subroutine which perform the preconditioner solve routine for the linear system M**H*x = b as follows, where M is a preconditioner metrix.
void psolvetrans(int n, const doublecomplex b[], doublecomplex x[])
{
Solve M**H*x = b, and return solution in x[].
}
|
| [in] | chkconv | User supplied subroutine which is called on every iteration for the convergence test as follows, where x[] is the current approximate solution, res is the current residual norm norm(b - A*x), and iter is the current number of iterations. This routine can also be used to output the intermediate results.
void chkconv(int n, const doublecomplex x[], double res, int iter, int *ichk)
{
Set *ichk = 1 if converged. Otherwise, set *ichk = 0.
}
|
| [in] | b[] | Array b[lb] (lb >= n)
Right hand side vector b. |
| [in,out] | x[] | Array x[lx] (lx >= n)
[in] Initial guess of solution.
[out] Obtained approximate solution. |
| [in] | maxiter | Maximum number of iterations. (maxiter > 0) |
| [out] | iter | Final number of iterations. |
| [out] | res | Final residual norm norm(b - A*x). |
| [in] | lwork | Size of array work[]. (lwork >= 15*n) |
| [out] | work[] | Array work[lwork]
Work array. |
| [out] | info | = 0: Successful exit
< 0: The (-info)-th argument is invalid.
= 11: Maximum number of iterations exceeded.
= 12, 13, 14, 15: Breakdown occurred. |
|