SuanShu, a Java numerical and statistical library

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

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.stationary.SorSweep

public class SorSweep
extends java.lang.Object

This is a building block for SOR and SSOR to perform forward or backward sweep. That is, solving n equations in Ax = b sequentially (forward or backward), while using the updated components of x as soon as they are available.


Constructor Summary
SorSweep(Matrix A, Vector b, double omega)
          Construct an instance to perform forward or backward sweep for a linear system Ax = b.
 
Method Summary
 Vector backward(Vector x)
          Perform a backward sweep.
 Vector forward(Vector x)
          Perform a forward sweep.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SorSweep

public SorSweep(Matrix A,
                Vector b,
                double omega)
Construct an instance to perform forward or backward sweep for a linear system Ax = b.

Parameters:
A - the coefficient matrix
b - the right hand side
omega - the extrapolation factor
Method Detail

forward

public Vector forward(Vector x)
Perform a forward sweep.

Parameters:
x - the original iterate
Returns:
the next iterate

backward

public Vector backward(Vector x)
Perform a backward sweep.

Parameters:
x - the original iterate
Returns:
the next iterate

SuanShu, a Java numerical and statistical library

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