SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.linearsystem
Class ForwardSubstitution

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.linearsystem.ForwardSubstitution

public class ForwardSubstitution
extends java.lang.Object

Forward substitution solves a matrix equation in the form

Lx = b
by an iterative process for a lower triangular matrix L.

The process is so called because for a lower triangular matrix, one first computes x1, then substitutes that forward into the next equation to solve for x2, and repeats onto xn.

Note that some diagonal entries in L can be 0s, provided that the system of equations is consistent. E.g.,

 | 0 0 0 |     |  0 |   |  0 |
 | 2 0 0 | %*% |  0 | = |  0 |
 | 4 5 6 |     | 30 |   | 30 |
 

See Also:
Wikipedia: Forward substitution

Field Summary
 LowerTriangularMatrix L
          the system of linear equations (the homogeneous part)
 
Constructor Summary
ForwardSubstitution(LowerTriangularMatrix L)
          Construct a ForwardSubstitution instance to solve for different Vector b's.
 
Method Summary
 Vector solve(Vector b)
          Solve Lx = b
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L

public final LowerTriangularMatrix L
the system of linear equations (the homogeneous part)

Constructor Detail

ForwardSubstitution

public ForwardSubstitution(LowerTriangularMatrix L)
Construct a ForwardSubstitution instance to solve for different Vector b's.

Parameters:
L - a lower triangular matrix
Method Detail

solve

public Vector solve(Vector b)
Solve
Lx = b

Parameters:
b - a vector
Returns:
x such that
Lx = b
Throws:
Solver.NoSolution - if there is no solution to this system

SuanShu, a Java numerical and statistical library

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