XLPack 7.0
Python API Reference Manual
Loading...
Searching...
No Matches

◆ bicg1()

def bicg1 ( ,
val  ,
rowptr  ,
colind  ,
,
,
tol  = 1.0e-10,
maxiter  = 500 
)

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.
Returns
(info, iter, res)

info (int):
= 0: Successful exit.
= i < 0: The (-i)-th argument is invalid.
= 11: Maximum number of iterations exceeded.
= 12: Breakdown occurred.

iter (int):
Final number of iterations.

res (float):
Final residual norm norm(b - A*x).
Parameters
[in]nDimension of the matrix. (n >= 0) (If n = 0, returns without computation)
[in]valNumpy ndarray (1-dimensional, float, nnz)
Values of nonzero elements of matrix A (where nnz is the number of nonzero elements).
[in]rowptrNumpy ndarray (1-dimensional, int32, n + 1)
Row pointers of matrix A.
[in]colindNumpy ndarray (1-dimensional, int32, nnz)
Column indices of matrix A (where nnz is the number of nonzero elements).
[in]bNumpy ndarray (1-dimensional, float, n)
Right hand side vector b.
[in,out]xNumpy ndarray (1-dimensional, float, n)
[in] Initial guess of solution.
[out] Obtained approximate solution.
[in]tol(Optional)
Tolerance for convergence test. (default = 1.0e-10)
Assumed to be converged if norm(b - A*x) <= tol*norm(b).
If tol < eps (machine epsilon), tol = eps is assumed.
[in]maxiter(Optional)
Maximum number of iterations. (maxiter > 0) (default = 500)