Interface BiconjugateGradient
public interface BiconjugateGradient
The biconjugate gradient method to solve systems of linear equations.
-
Field Summary
Fields -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic double
Solves A * x = b by iterative biconjugate gradient method with Jacobi preconditioner matrix.static double
solve
(Matrix A, Vector b, Vector x, Preconditioner P, double tol, int itol, int maxIter) Solves A * x = b by iterative biconjugate gradient method.
-
Field Details
-
logger
static final org.slf4j.Logger logger
-
-
Method Details
-
solve
Solves A * x = b by iterative biconjugate gradient method with Jacobi preconditioner matrix.- Parameters:
A
- the linear system.b
- the right hand side of linear equations.x
- on input, x should be set to an initial guess of the solution (or all zeros). On output, x is set to the improved solution.- Returns:
- the estimated error.
-
solve
static double solve(Matrix A, Vector b, Vector x, Preconditioner P, double tol, int itol, int maxIter) Solves A * x = b by iterative biconjugate gradient method.- Parameters:
A
- the linear system.b
- the right hand side of linear equations.x
- on input, x should be set to an initial guess of the solution (or all zeros). On output, x is set to the improved solution.P
- The preconditioner matrix.tol
- The desired convergence tolerance.itol
- Which convergence test is applied. If itol = 1, iteration stops when |Ax - b| / |b| is less than the parameter tolerance. If itol = 2, the stop criterion is that |A-1 (Ax - b)| / |A-1b| is less than tolerance. If tol = 3, |xk+1 - xk|2 is less than tolerance. The setting of tol = 4 is same as tol = 3 except that the L∞ norm instead of L2.maxIter
- The maximum number of iterations.- Returns:
- the estimated error.
-