TRIDAG Procedure

Solves tridiagonal systems of linear equations.

Usage

TRIDAG, a, b, c, r, u

Input Parameters

a—An n-element vector containing n – 1 subdiagonal elements. Element a0 is ignored.

b—An n-element vector containing n diagonal elements.

c—An n-element vector containing n – 1 superdiagonal elements. Element cn–1 is ignored.

r—An n-element vector containing the right-hand side of the equation ATu = r.

Output Parameters

u—An n-element floating-point vector containing the solution for tridiagonal systems of linear equations.

Keywords

None.

Discussion

The input vectors a, b, c, and r are not modified by TRIDAG. They contain, respectively, the subdiagonal, diagonal, and superdiagonal elements of A, and the right-hand side of the equation:

ATu = r

The solution is stored in the variable u.

Note:

Because PV-WAVE subscripts are in column-row order, the above equation is written as ATu = r, rather than as Au = r.

See Also

LUBKSB,  LUDCMP,  MPROVE,  SVBKSB

TRIDAG is based on a routine of the same name in Numerical Recipes in C: The Art of Scientific Computing, by Flannery, Press, Teukolsky, and Vetterling, Cambridge University Press, Cambridge, MA, 1988, and is used by permission.