Class BiconjugateGradientStabilizedSolver
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary.BiconjugateGradientStabilizedSolver
-
- All Implemented Interfaces:
IterativeLinearSystemSolver
public class BiconjugateGradientStabilizedSolver extends Object implements IterativeLinearSystemSolver
The Biconjugate Gradient Stabilized (BiCGSTAB) method is useful for solving non-symmetric n-by-n linear systems. Like CGS, this algorithm is a transpose-free variant of BiCG, but uses a different update for the At-sequence to obtain a smoother convergence than CGS does. Only left preconditioning is supported in this implementation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.solver.iterative.IterativeLinearSystemSolver
IterativeLinearSystemSolver.Solution
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_RESIDUAL_REFRESH_RATE
The algorithm recomputes the residual as b - Axi once per this number of iterations
-
Constructor Summary
Constructors Constructor Description BiconjugateGradientStabilizedSolver(int maxIteration, Tolerance tolerance)
Construct a Biconjugate Gradient Stabilized solver (BiCGSTAB) .BiconjugateGradientStabilizedSolver(PreconditionerFactory leftPreconditionerFactory, int residualRefreshRate, int maxIteration, Tolerance tolerance)
Construct a Biconjugate Gradient Stabilized solver (BiCGSTAB) .
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IterativeLinearSystemSolver.Solution
solve(LSProblem problem)
IterativeLinearSystemSolver.Solution
solve(LSProblem problem, IterationMonitor<Vector> monitor)
Solves iteratively Ax = b until the solution converges, i.e., the norm of residual (b - Ax) is less than or equal to the threshold.
-
-
-
Field Detail
-
DEFAULT_RESIDUAL_REFRESH_RATE
public static final int DEFAULT_RESIDUAL_REFRESH_RATE
The algorithm recomputes the residual as b - Axi once per this number of iterations- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BiconjugateGradientStabilizedSolver
public BiconjugateGradientStabilizedSolver(PreconditionerFactory leftPreconditionerFactory, int residualRefreshRate, int maxIteration, Tolerance tolerance)
Construct a Biconjugate Gradient Stabilized solver (BiCGSTAB) .- Parameters:
leftPreconditionerFactory
- constructs a new left preconditionerresidualRefreshRate
- the number of iterations before the next refreshmaxIteration
- the maximum number of iterationstolerance
- the convergence threshold
-
BiconjugateGradientStabilizedSolver
public BiconjugateGradientStabilizedSolver(int maxIteration, Tolerance tolerance)
Construct a Biconjugate Gradient Stabilized solver (BiCGSTAB) .- Parameters:
maxIteration
- the maximum number of iterationstolerance
- the convergence threshold
-
-
Method Detail
-
solve
public IterativeLinearSystemSolver.Solution solve(LSProblem problem) throws ConvergenceFailure
- Throws:
ConvergenceFailure
-
solve
public IterativeLinearSystemSolver.Solution solve(LSProblem problem, IterationMonitor<Vector> monitor) throws ConvergenceFailure
Description copied from interface:IterativeLinearSystemSolver
Solves iterativelyAx = b
until the solution converges, i.e., the norm of residual (b - Ax) is less than or equal to the threshold.- Specified by:
solve
in interfaceIterativeLinearSystemSolver
- Parameters:
problem
- a system of linear equationsmonitor
- an iteration monitor- Returns:
- an (approximate) solution to the linear problem
- Throws:
ConvergenceFailure
- if the algorithm fails to converge
-
-