quadrants.linalg.sparse_cg#
Classes#
Conjugate-gradient solver built for SparseMatrix. |
Module Contents#
- class quadrants.linalg.sparse_cg.SparseCG(A, b, x0=None, max_iter=50, atol=1e-06)[source]#
Conjugate-gradient solver built for SparseMatrix.
Use conjugate-gradient method to solve the linear system Ax = b, where A is SparseMatrix.
- Parameters:
A (SparseMatrix) – The coefficient matrix A of the linear system.
b (numpy ndarray, quadrants Ndarray) – The right-hand side of the linear system.
x0 (numpy ndarray, quadrants Ndarray) – The initial guess for the solution.
max_iter (int) – Maximum number of iterations.
atol – Tolerance(absolute) for convergence.