SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.stationary
Class SuccessiveOverrelaxationSolver

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.stationary.SuccessiveOverrelaxationSolver
All Implemented Interfaces:
IterativeSolver

public class SuccessiveOverrelaxationSolver
extends java.lang.Object
implements IterativeSolver

The Successive Overrelaxation method (SOR), is devised by applying extrapolation to the Gauss-Seidel method. This extrapolation takes the form of a weighted average between the previous iterate and the computed Gauss-Seidel iterate successively for each component.

If the weight ω is chosen optimally, SOR may converge faster than the Gauss-Seidel method by an order of magnitude.

If the coefficient matrix A is symmetric positive definite, SOR is guaranteed to converge for any value of ω between 0 and 2, though the choice of ω can significantly affect the rate of convergence.

In principle, given the spectral radius ρ of the Jacobi iteration matrix, one can determine a priori the theoretically optimal value of ω for SOR:

ω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 ω.

Preconditioning is not supported in this solver.

See Also:
Wikipedia: Successive over-relaxation method

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.IterativeSolver
IterativeSolver.ConvergenceFailure, IterativeSolver.Problem
 
Constructor Summary
SuccessiveOverrelaxationSolver(double omega)
          Construct a SOR solver with the extrapolation factor ω.
 
Method Summary
 Vector solve(IterativeSolver.Problem problem)
          Solve iteratively Ax = b until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.
 Vector solve(IterativeSolver.Problem problem, IterationMonitor monitor)
          Solve iteratively Ax = b until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuccessiveOverrelaxationSolver

public SuccessiveOverrelaxationSolver(double omega)
Construct a SOR solver with the extrapolation factor ω. Usually, ω is chosen inside the interval (0, 2). Technically, if ω is within (0, 1), the method becomes underrelaxation. It is shown that SOR fails to converge if ω is outside the interval (0, 2).

If ω equals to 1, SOR simplifies to the Gauss-Seidel method.

Parameters:
omega - the extrapolation factor
Method Detail

solve

public Vector solve(IterativeSolver.Problem problem)
             throws IterativeSolver.ConvergenceFailure
Description copied from interface: IterativeSolver
Solve iteratively
Ax = b
until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.

Specified by:
solve in interface IterativeSolver
Parameters:
problem - the problem of solving Ax = b
Returns:
the computed solution for the problem
Throws:
IterativeSolver.ConvergenceFailure - if the algorithm fails to converge

solve

public Vector solve(IterativeSolver.Problem problem,
                    IterationMonitor monitor)
             throws IterativeSolver.ConvergenceFailure
Description copied from interface: IterativeSolver
Solve iteratively
Ax = b
until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.

In each iteration, the newly computed iterate is added to the IterationMonitor for statistics or diagnostic purpose.

Specified by:
solve in interface IterativeSolver
Parameters:
problem - the problem of solving Ax = b
monitor - an IterationMonitor instance
Returns:
the computed solution for the problem
Throws:
IterativeSolver.ConvergenceFailure - if the algorithm fails to converge

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.