# Class BackwardSubstitution

java.lang.Object
dev.nm.algebra.linear.matrix.doubles.linearsystem.BackwardSubstitution

public class BackwardSubstitution extends Object
Backward substitution solves a matrix equation in the form Ux = b by an iterative process for an upper triangular matrix U. The process is so called because for an upper triangular matrix, one first computes xn, then substitutes that backward into the next equation to solve for xn-1, and repeats until x1. Note that some diagonal entries in U can be 0s, provided that the system of equations is consistent. For example, $\begin{bmatrix} 1 invalid input: '&' 2 invalid input: '&' 3\\ 0 invalid input: '&' 0 invalid input: '&' 5\\ 0 invalid input: '&' 0 invalid input: '&' 0 \end{bmatrix} \times \begin{bmatrix} 10\\ 0\\ 0 \end{bmatrix} = \begin{bmatrix} 10\\ 0\\ 0 \end{bmatrix}$
• ## Constructor Summary

Constructors
Constructor
Description
BackwardSubstitution()

• ## Method Summary

Modifier and Type
Method
Description
Matrix
solve(UpperTriangularMatrix U, Matrix B)

Matrix
solve(UpperTriangularMatrix U, Matrix B, double epsilon)

Vector
solve(UpperTriangularMatrix U, Vector b)
Solve Ux = b.
Vector
solve(UpperTriangularMatrix U, Vector b, double epsilon)

### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ## Constructor Details

• ### BackwardSubstitution

public BackwardSubstitution()
• ## Method Details

• ### solve

public Vector solve
Solve Ux = b.
Parameters:
U - an upper triangular matrix, representing the system of linear equations (the homogeneous part)
b - a vector
Returns:
a solution x such that Ux = b
Throws:
LinearSystemSolver.NoSolution - if there is no solution to the system
• ### solve

public Vector solve(UpperTriangularMatrix U, Vector b, double epsilon)
• ### solve

public Matrix solve
• ### solve

public Matrix solve(UpperTriangularMatrix U, Matrix B, double epsilon)