public class BiconjugateGradient
extends java.lang.Object
| Constructor and Description |
|---|
BiconjugateGradient() |
| Modifier and Type | Method and Description |
|---|---|
static Preconditioner |
Jacobi(DMatrix A)
Returns a simple preconditioner matrix that is the
trivial diagonal part of A in some cases.
|
static double |
solve(DMatrix A,
double[] b,
double[] x)
Solves A * x = b by iterative biconjugate gradient method with Jacobi
preconditioner matrix.
|
static double |
solve(DMatrix A,
double[] b,
double[] x,
Preconditioner preconditioner,
double tol,
int itol,
int maxIter)
Solves A * x = b by iterative biconjugate gradient method.
|
public static Preconditioner Jacobi(DMatrix A)
public static double solve(DMatrix A, double[] b, double[] x)
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 reset to the improved solution.public static double solve(DMatrix A, double[] b, double[] x, Preconditioner preconditioner, double tol, int itol, int maxIter)
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 reset to the improved solution.preconditioner - 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.