IBM Books

Engineering and Scientific Subroutine Library for AIX Version 3 Release 3: Guide and Reference

SGTS and DGTS--General Tridiagonal Matrix Solve

These subroutines solve a tridiagonal system of linear equations using the factorization of tridiagonal matrix A, stored in tridiagonal storage mode, produced by SGTF or DGTF, respectively.

Table 110. Data Types

c, d, e, f, b, x Subroutine
Short-precision real SGTS
Long-precision real DGTS
Note:
The input to these solve subroutines must be the output from the factorization subroutines SGTF and DGTF, respectively.

Syntax

Fortran CALL SGTS | DGTS (n, c, d, e, f, ipvt, bx)
C and C++ sgts | dgts (n, c, d, e, f, ipvt, bx);
PL/I CALL SGTS | DGTS (n, c, d, e, f, ipvt, bx);

On Entry

n
is the order n of tridiagonal matrix A. Specified as: a fullword integer; n >= 0.

c
is the vector c, containing part of the factorization of matrix A from SGTF or DGTF, respectively, in an array, referred to as C. Specified as: a one-dimensional array of (at least) length n, containing numbers of the data type indicated in Table 110.

d
is the vector d, containing part of the factorization of matrix A from SGTF or DGTF, respectively, in an array, referred to as D. Specified as: a one-dimensional array of (at least) length n, containing numbers of the data type indicated in Table 110.

e
is the vector e, containing part of the factorization of matrix A from SGTF or DGTF, respectively, in an array, referred to as E. Specified as: a one-dimensional array of (at least) length n, containing numbers of the data type indicated in Table 110.

f
is the vector f, containing part of the factorization of matrix A from SGTF or DGTF, respectively, in an array, referred to as F. Specified as: a one-dimensional array of (at least) length n, containing numbers of the data type indicated in Table 110.

ipvt
is the integer vector ipvt of length n, containing the pivot information, produced by a preceding call to SGTF and DGTF, respectively. Specified as: a one-dimensional array of (at least) length n, containing fullword integers.

bx
is the vector b of length n, containing the right-hand side of the system in the first n positions in an array, referred to as BX. Specified as: a one-dimensional array of (at least) length n+1, containing numbers of the data type indicated in Table 110. For details on specifying the length, see Notes.

On Return

bx
is the solution vector x (at least) of length n, containing the solution of the tridiagonal system in the first n positions in an array, referred to as BX. Returned as: a one-dimensional array, of (at least) length (n+1), containing numbers of the data type indicated in Table 110. For details about the length, see Notes.

Notes
  1. For a description of how tridiagonal matrices are stored, see General Tridiagonal Matrix.
  2. Array BX can have a length of n if memory location BX(n+1) is addressable--that is, not in read-protected storage. If it is in read-protected storage, array BX must have a length of n+1. In both cases, the vector b (on input) and vector x (on output) reside in positions 1 through n in array BX. Array location BX(n+1) is not altered by these subroutines.

Function

Given the factorization produced by SGTF or DGTF, respectively, these subroutines use the standard forward elimination and back substitution to solve the tridiagonal system Ax = b, where A is a general tridiagonal matrix. See references [43], [54], [55], and [90].

Error Conditions

Computational Errors

None

Input-Argument Errors

n < 0

Example

This example solves the tridiagonal system Ax = b, where matrix A is the same matrix factored in Example for SGTF and DGTF, and where:
b = (4.0, 6.0, 6.0, 4.0)
x = (1.0, 1.0, 1.0, 1.0)

Call Statement and Input
           N   C   D   E   F   IPVT   BX
           |   |   |   |   |    |     |
CALL DGTS( 4 , C , D , E , F , IPVT , BX )
 

C = (same as output C in Example)
D = (same as output D in Example)
E = (same as output E in Example)
F = (same as output F in Example)
IPVT = (same as output IPVT in Example)
BX = (4.0, 6.0, 6.0, 4.0, . )

Output
BX       =  (1.0, 1.0, 1.0, 1.0, . )


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]