org.jutil.math.matrix
Class AbstractSolver

java.lang.Object
  |
  +--org.jutil.math.matrix.AbstractSolver
Direct Known Subclasses:
LULinSolver, QRLeastSquaresSolver, QRLinSolver

public abstract class AbstractSolver
extends java.lang.Object

A helper class for classes that solve systems of equations using matrices. That often involves solve a triangular system at the end.

Version:
$Revision: 1.2 $
Author:
Marko van Dooren

Constructor Summary
AbstractSolver()
           
 
Method Summary
 Column backSubstitute(Matrix R, Column b)
          public behavior

pre R != null;
pre b != null;
pre R.isSquare();
pre R.isUpperTriangular;
pre b.size() == R.getNbRows();
pre (* R is nonsingular *);

post (* R.times(\result).equals(b) *);
 Column forwardSubstitute(Matrix R, Column b)
          public behavior

pre L!= null;
pre b != null;
pre L.isSquare();
pre L.isLowerTriangular;
pre b.size() == L.getNbRows();
pre (* L is nonsingular *);

post (* L.times(\result).equals(b) *);
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSolver

public AbstractSolver()
Method Detail

backSubstitute

public Column backSubstitute(Matrix R,
                             Column b)
public behavior

pre R != null;
pre b != null;
pre R.isSquare();
pre R.isUpperTriangular;
pre b.size() == R.getNbRows();
pre (* R is nonsingular *);

post (* R.times(\result).equals(b) *);

Solve the uppertriangular linear system of equations defined by R * x = b

Parameters:
R - The uppertriangular matrix containing the coefficients of the equations.
b - A column containing the right-hand sides of the equations.

forwardSubstitute

public Column forwardSubstitute(Matrix R,
                                Column b)
public behavior

pre L!= null;
pre b != null;
pre L.isSquare();
pre L.isLowerTriangular;
pre b.size() == L.getNbRows();
pre (* L is nonsingular *);

post (* L.times(\result).equals(b) *);

Solve the lowertriangular linear system of equations defined by L * x = b

Parameters:
L - The lowertriangular matrix containing the coefficients of the equations.
b - A column containing the right-hand sides of the equations.