Class JacobiPreconditioner
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.solver.iterative.preconditioner.JacobiPreconditioner
-
- All Implemented Interfaces:
Preconditioner
public class JacobiPreconditioner extends Object implements Preconditioner
The Jacobi (or diagonal) preconditioner is one of the simplest forms of preconditioning, such that the preconditioner is the diagonal of the coefficient matrix, i.e., P = diag(A).
-
-
Constructor Summary
Constructors Constructor Description JacobiPreconditioner(Matrix A)
Construct a Jacobi preconditioner.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector
solve(Vector x)
Return P-1x, where P is the diagonal matrix of A.Vector
transposeSolve(Vector x)
Pt = P-1 for Jacobi preconditioner.
-
-
-
Constructor Detail
-
JacobiPreconditioner
public JacobiPreconditioner(Matrix A)
Construct a Jacobi preconditioner.- Parameters:
A
- a coefficient matrix
-
-
Method Detail
-
solve
public Vector solve(Vector x)
Return P-1x, where P is the diagonal matrix of A. The output vector v has entries:vi = xi / Ai,i
- Specified by:
solve
in interfacePreconditioner
- Parameters:
x
- a vector- Returns:
- P-1x
-
transposeSolve
public Vector transposeSolve(Vector x)
Pt = P-1 for Jacobi preconditioner.- Specified by:
transposeSolve
in interfacePreconditioner
- Parameters:
x
- a vector- Returns:
- P-1x
-
-