Class ForwardSubstitution
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.linearsystem.ForwardSubstitution
-
public class ForwardSubstitution extends 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 until xn. Note that some diagonal entries in L can be 0s, provided that the system of equations is consistent. For example, \[ \begin{bmatrix} 0 & 0 & 0\\ 2 & 0 & 0\\ 4 & 5 & 6 \end{bmatrix} \times \begin{bmatrix} 0\\ 0\\ 30 \end{bmatrix} = \begin{bmatrix} 0\\ 0\\ 30 \end{bmatrix} \]- See Also:
- Wikipedia: Forward substitution
-
-
Constructor Summary
Constructors Constructor Description ForwardSubstitution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Matrix
solve(LowerTriangularMatrix L, Matrix B)
Matrix
solve(LowerTriangularMatrix L, Matrix B, double epsilon)
Vector
solve(LowerTriangularMatrix L, Vector b)
Solve Lx = b.Vector
solve(LowerTriangularMatrix L, Vector b, double epsilon)
-
-
-
Method Detail
-
solve
public Vector solve(LowerTriangularMatrix L, Vector b)
Solve Lx = b.- Parameters:
L
- a lower triangular matrix, representing the system of linear equations (the homogeneous part)b
- a vector- Returns:
- a solution x such that Lx = b
- Throws:
LinearSystemSolver.NoSolution
- if there is no solution to the system
-
solve
public Vector solve(LowerTriangularMatrix L, Vector b, double epsilon)
-
solve
public Matrix solve(LowerTriangularMatrix L, Matrix B)
-
solve
public Matrix solve(LowerTriangularMatrix L, Matrix B, double epsilon)
-
-