# ?gtts2

Solves a system of linear equations with a tridiagonal matrix using the LU factorization computed by ?gttrf.

## Syntax

call sgtts2( itrans, n, nrhs, dl, d, du, du2, ipiv, b, ldb )

call dgtts2( itrans, n, nrhs, dl, d, du, du2, ipiv, b, ldb )

call cgtts2( itrans, n, nrhs, dl, d, du, du2, ipiv, b, ldb )

call zgtts2( itrans, n, nrhs, dl, d, du, du2, ipiv, b, ldb )

## Description

This routine solves for X one of the following systems of linear equations with multiple right hand sides:

`A*X = B, AT*X = B, or AH*X = B` (for complex matrices only), with a tridiagonal matrix A using the LU factorization computed by ?gttrf.

## Input Parameters

itrans

  INTEGER. Must be 0, 1, or 2.

  Indicates the form of the equations to be solved:

  If `itrans = 0`, then `A*X = B` (no transpose).

  If `itrans = 1`, then `AT*X = B` (transpose).

  If `itrans = 2`, then `AH*X = B` (conjugate transpose).

n

  INTEGER. The order of the matrix A (`n ≥ 0`).

nrhs

  INTEGER. The number of right-hand sides, i.e., the number of columns in B (`nrhs ≥ 0`).

dl,d,du,du2,b

  REAL for sgtts2

  DOUBLE PRECISION for dgtts2

  COMPLEX for cgtts2

  COMPLEX*16 for zgtts2.

  Arrays: `dl(n - 1)`, `d(n )`, `du(n - 1)`, `du2(n - 2)`, `b(ldb,nrhs)`.

  The array dl contains the (n - 1) multipliers that define the matrix L from the LU factorization of A.

  The array d contains the n diagonal elements of the upper triangular matrix U from the LU factorization of A.

  The array du contains the (n - 1) elements of the first super-diagonal of U.

  The array du2 contains the (n - 2) elements of the second super-diagonal of U.

  The array b contains the matrix B whose columns are the right-hand sides for the systems of equations.

ldb

  INTEGER. The leading dimension of b; must be `ldb ≥ max(1, n)`.

ipiv

  INTEGER.

  Array, DIMENSION (n).

  The pivot indices array, as returned by ?gttrf.

## Output Parameters

b

  Overwritten by the solution matrix X.

Parent topic: Auxiliary Routines