The LA_TRIDC procedure computes the LU decomposition of a tridiagonal (*n* x *n*) array as *Array *= *L U*, where *L* is a product of permutation and unit lower bidiagonal arrays, and *U* is upper triangular with nonzero elements only in the main diagonal and the first two superdiagonals.

LA_TRIDC is based on the following LAPACK routines:

Output Type |
LAPACK Routine |

Float |
sgttrf |

Double |
dgttrf |

Complex |
cgttrf |

Double complex |
zgttrf |

## Examples

The example la_tridc_doc.pro computes the LU decomposition of a tridiagonal array. This example file is installed in the IDL installation’s /examples/doc/language directory. To view the example code, enter .edit la_tridc_doc.pro at the IDL command line. To execute the code, enter la_tridc_doc at the IDL command line.

When this program is compiled and run, IDL prints:

LA_TRIDC error: 1.50427e-008

## Syntax

LA_TRIDC, *AL*, *A*, *AU*, *U2*, *Index* [, /DOUBLE] [, STATUS=*variable*]

## Arguments

### AL

A named vector of length (*n* - 1) containing the subdiagonal elements of an array. This procedure returns *AL* as the (*n* - 1) elements of the lower bidiagonal array from the LU decomposition.

### A

A named vector of length *n* containing the main diagonal elements of an array. This procedure returns *A* as the *n* diagonal elements of the upper array from the LU decomposition.

### AU

A named vector of length (*n* - 1) containing the superdiagonal elements of an array. This procedure returns *AU* as the (*n* - 1) superdiagonal elements of the upper array.

### U2

An output vector that contains the (*n* - 2) elements of the second superdiagonal of the upper array.

### Index

An output vector that records the row permutations which occurred as a result of partial pivoting. For 1 < *j *< *n*, row *j* of the matrix was interchanged with row *Index*[*j*].

*Note: *Row numbers within *Index* start at one rather than zero.

## Keywords

### DOUBLE

Set this keyword to use double-precision for computations and to return a double-precision (real or complex) result. Set DOUBLE = 0 to use single-precision for computations and to return a single-precision (real or complex) result. The default is /DOUBLE if *AL* is double precision, otherwise the default is DOUBLE = 0.

### STATUS

Set this keyword to a named variable that will contain the status of the computation. Possible values are:

- STATUS = 0: The computation was successful.
- STATUS > 0: One of the diagonal elements of
*U*is zero. The STATUS value specifies which value along the diagonal (starting at one) is zero.

*Note: *If STATUS is not specified, any error messages will output to the screen.

## Version History

5.6 |
Introduced |

## Resources and References

For more details, see Anderson et al., *LAPACK Users' Guide*, 3rd ed., SIAM, 1999.