The first stage is
Because , this consists of independent tridiagonal systems of dimension . The Thomas algorithm solves each in operations, for a total of .
The second stage,
is multiplication by a matrix with only nonzero entries, so it also costs . Hence one complete step uses at most
arithmetic operations.
Tridiagonal matrix Created 2026-09-25 Updated 2026-09-28
A tridiagonal matrix has zero entries outside its main diagonal and the two adjacent diagonals. Linear systems with a nonsingular tridiagonal coefficient matrix can be solved in linear time by the Thomas algorithm.