IBM Books

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

SGTNPS, DGTNPS, CGTNPS, and ZGTNPS--General Tridiagonal Matrix Solve with No Pivoting

These subroutines solve a tridiagonal system of equations using the factorization of matrix A, stored in tridiagonal storage mode, produced by SGTNPF, DGTNPF, CGTNPF, or ZGTNPF, respectively.

Table 113. Data Types

c, d, e, b, x Subroutine
Short-precision real SGTNPS
Long-precision real DGTNPS
Short-precision complex CGTNPS
Long-precision complex ZGTNPS
Note:
The input to these solve subroutines must be the output from the factorization subroutines SGTNPF, DGTNPF, CGTNPF, and ZGTNPF, respectively.

Syntax

Fortran CALL SGTNPS | DGTNPS | CGTNPS | ZGTNPS (n, c, d, e, bx)
C and C++ sgtnps | dgtnps | cgtnps | zgtnps (n, c, d, e, bx);
PL/I CALL SGTNPS | DGTNPS | CGTNPS | ZGTNPS (n, c, d, e, 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 SGTNPF, DGTNPF, CGTNPF, and ZGTNPF, 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 113.

d
is the vector d, containing part of the factorization of matrix A from SGTNPF, DGTNPF, CGTNPF, and ZGTNPF, 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 113.

e
is the vector e, containing part of the factorization of matrix A from SGTNPF, DGTNPF, CGTNPF, and ZGTNPF, 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 113.

bx
is the vector b, 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, containing numbers of the data type indicated in Table 113.

On Return

bx
is the solution vector x 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, containing numbers of the data type indicated in Table 113.

Note

For a description of how tridiagonal matrices are stored, see General Tridiagonal Matrix.

Function

The solution of tridiagonal system Ax = b is computed using the factorization produced by SGTNPF, DGTNPF, CGTNPF, or ZGTNPF, respectively. The factorization is based on Gaussian elimination. See reference [77].

Error Conditions

Computational Errors

None

Input-Argument Errors

n < 0

Example 1

This example finds the solution of tridiagonal system Ax = b, where matrix A is the same matrix factored in Example 1 for SGTNPF and DGTNPF. b is:

                    (2.0, 4.0, 5.0, 2.0)

and x is:

                    (1.0, 1.0, 1.0, 1.0)

Call Statement and Input
             N   C   D   E   BX
             |   |   |   |   |
CALL DGTNPS( 4 , C , D , E , BX )
 

C = (same as output C in Example 1)
D = (same as output D in Example 1)
E = (same as output E in Example 1)
BX = (2.0, 4.0, 5.0, 2.0)

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

Example 2

This example finds the solution of tridiagonal system Ax = b, where matrix A is the same matrix factored in Example 2 for CGTNPF and ZGTNPF. b is:

          ((-11.0,19.0), (-14.0,50.0), (-17.0,93.0), (-13.0,85.0))

and x is:

          ((0.0,1.0), (1.0,2.0), (2.0,3.0), (3.0,4.0))

Call Statement and Input
             N   C   D   E   BX
             |   |   |   |   |
CALL ZGTNPS( 4 , C , D , E , BX )
 

C = (same as output C in Example 2)
D = (same as output D in Example 2)
E = (same as output E in Example 2)
BX = ((-11.0, 19.0), (-14.0, 50.0), (-17.0, 93.0), (-13.0, 8))

Output
BX       =  ((0.0, 1.0), (1.0, 2.0), (2.0, 3.0), (3.0, 4.0))


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