public class SuccessiveOverrelaxationSolver extends Object implements IterativeLinearSystemSolver
ωopt = 2 / (1 + sqrt(1 - ρ2))This is seldom done, since calculating the spectral radius of the Jacobi matrix requires an impractical amount of computation. However, relatively inexpensive rough estimates of ρ can yield reasonable estimates for the optimal value of ω. This implementation does not support preconditioning.
IterativeLinearSystemSolver.Solution
Constructor and Description |
---|
SuccessiveOverrelaxationSolver(double omega,
int maxIteration,
Tolerance tolerance)
Construct a SOR solver with the extrapolation factor ω.
|
Modifier and Type | Method and 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.
|
public SuccessiveOverrelaxationSolver(double omega, int maxIteration, Tolerance tolerance)
omega
- the extrapolation factormaxIteration
- the maximum number of iterationstolerance
- the convergence thresholdpublic IterativeLinearSystemSolver.Solution solve(LSProblem problem) throws ConvergenceFailure
ConvergenceFailure
public IterativeLinearSystemSolver.Solution solve(LSProblem problem, IterationMonitor<Vector> monitor) throws ConvergenceFailure
IterativeLinearSystemSolver
Ax = buntil the solution converges, i.e., the norm of residual (b - Ax) is less than or equal to the threshold.
solve
in interface IterativeLinearSystemSolver
problem
- a system of linear equationsmonitor
- an iteration monitorConvergenceFailure
- if the algorithm fails to convergeCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.