|
|
◆ bicg1()
| void bicg1 |
( |
int |
n, |
|
|
const double |
val[], |
|
|
const int |
rowptr[], |
|
|
const int |
colind[], |
|
|
const double |
b[], |
|
|
double |
x[], |
|
|
double |
tol, |
|
|
int |
maxiter, |
|
|
int * |
iter, |
|
|
double * |
res, |
|
|
int |
lwork, |
|
|
double |
work[], |
|
|
int * |
info |
|
) |
| |
Solution of linear system Ax = b using bi-conjugate gradient (BICG) method (Simple driver)
- Purpose
- This routine solves the linear system Ax = b using the bi-conjugate gradient (BICG) iterative method. Matrix A is represented in CSR format.
- Parameters
-
| [in] | n | Dimension of the matrix. (n >= 0) (If n = 0, returns without computation) |
| [in] | val[] | Array val[lval] (lval >= nnz)
Values of nonzero elements of matrix A (where nnz is the number of nonzero elements). |
| [in] | rowptr[] | Array rowptr[lrowptr] (lrowptr >= n + 1)
Row pointers of matrix A. |
| [in] | colind[] | Array colind[lcolind] (lcolind >= nnz)
Column indices of matrix A (where nnz is the number of nonzero elements). |
| [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] | tol | Tolerance for convergence test.
Assumed to be converged if norm(b - A*x) <= tol*norm(b).
If tol < eps (machine epsilon), tol = eps is assumed. |
| [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 >= 8*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: Breakdown occurred. |
|