TRIDIAGONAL - Functions to solve tridiagonal systems of equations Tu=r for u. tridif Solve a tridiagonal system of equations (float version) tridid Solve a tridiagonal system of equations (double version) tripd Solve a positive definite, symmetric tridiagonal system tripp Solve an unsymmetric tridiagonal system that uses Gaussian elimination with partial pivoting Function Prototypes: void tridif (int n, float a[], float b[], float c[], float r[], float u[]); void tridid (int n, double a[], double b[], double c[], double r[], double u[]); void tripd (float *d, float *e, float *b, int n); void tripp(int n, float *d, float *e, float *c, float *b); tridif, tridid: Input: n dimension of system a array[n] of lower sub-diagonal of T (a[0] ignored) b array[n] of diagonal of T c array[n] of upper super-diagonal of T (c[n-1] ignored) r array[n] of right-hand-side column vector Output: u array[n] of solution (left-hand-side) column vector tripd: Input: d array[n], the diagonal of A e array[n], the superdiagonal of A b array[n], the rhs column vector of Ax=b Output: b b is overwritten with the solution to Ax=b tripp: Input: d diagonal vector of matrix e upper-diagonal vector of matrix c lower-diagonal vector of matrix b right-hand vector n dimension of matrix Output: b solution vector Notes: For example, a tridiagonal system of dimension 4 is specified as: |b[0] c[0] 0 0 | |u[0]| |r[0]| |a[1] b[1] c[1] 0 | |u[1]| = |r[1]| | 0 a[2] b[2] c[2]| |u[2]| |r[2]| | 0 0 a[3] b[3]| |u[3]| |r[3]| The tridiagonal matrix is assumed to be non-singular. tripd: Given an n-by-n symmetric, tridiagonal, positive definite matrix A and n-vector b, following algorithm overwrites b with the solution to Ax = b Authors: tridif, tridid: Dave Hale, Colorado School of Mines, 10/03/89 tripd, tripp: Zhenyue Liu, Colorado School of Mines, 1992-1993