TOPICS
Search

Thomas Algorithm


The Thomas algorithm is a specialized form of Gaussian elimination for solving a tridiagonal matrix system. For subdiagonal entries a_i, diagonal entries b_i, superdiagonal entries c_i, and right-hand side d_i, set c_1^'=c_1/b_1 and d_1^'=d_1/b_1. For i=2, ..., n-1, forward elimination computes

 c_i^'=(c_i)/(b_i-a_ic_(i-1)^').

For i=2, ..., n, it computes

 d_i^'=(d_i-a_id_(i-1)^')/(b_i-a_ic_(i-1)^').

Back substitution starts with x_n=d_n^' and continues with x_i=d_i^'-c_i^'x_(i+1) for i=n-1, ..., 1.

The algorithm requires only linear time and storage in the number of equations. Pivoting or a more general solver may be needed when an elimination denominator vanishes or is too small for stable floating-point computation.


See also

Gaussian Elimination, Tridiagonal Matrix

Explore with Wolfram|Alpha

References

Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th ed. Baltimore, MD: Johns Hopkins University Press, 2013.

Cite this as:

Weisstein, Eric W. "Thomas Algorithm." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/ThomasAlgorithm.html

Subject classifications