These subroutines factor tridiagonal matrix A, stored in
tridiagonal storage mode, using Gaussian elimination. To solve a
tridiagonal system of linear equations with one or more right-hand sides,
follow the call to these subroutines with one or more calls to SGTNPS, DGTNPS,
CGTNPS, or ZGTNPS, respectively.
c, d, e | Subroutine |
Short-precision real | SGTNPF |
Long-precision real | DGTNPF |
Short-precision complex | CGTNPF |
Long-precision complex | ZGTNPF |
Notes:
Fortran | CALL SGTNPF | DGTNPF | CGTNPF | ZGTNPF (n, c, d, e, iopt) |
C and C++ | sgtnpf | dgtnpf | cgtnpf | zgtnpf (n, c, d, e, iopt); |
PL/I | CALL SGTNPF | DGTNPF | CGTNPF | ZGTNPF (n, c, d, e, iopt); |
Specified as: a fullword integer; iopt = 0 or 1.
For a description of how tridiagonal matrices are stored, see General Tridiagonal Matrix.
The factorization of a diagonally-dominant tridiagonal matrix A is computed using Gaussian elimination, This factorization can then be used by SGTNPS, DGTNPS, CGTNPS, or ZGTNPS respectively, to solve the tridiagonal systems of linear equations. See reference [77].
No pivoting is done by these subroutines. Therefore, these subroutines should not be used when pivoting is necessary to maintain the numerical accuracy of the solution. Overflow may occur if small main diagonal elements are generated. Underflow or accuracy loss may occur if large main diagonal elements are generated.
For performance reasons, complex divides are done without scaling. Computing the inverse in this way restricts the range of numbers for which ZGTNPF works properly.
For performance reasons, divides are done in a way that reduces the effective exponent range for which DGTNPF and ZGTNPF work properly; therefore, you may want to scale your problem, such that the diagonal elements are close to 1.0 for DGTNPF and (1.0, 0.0) for ZGTNPF.
None
This example shows a factorization of the tridiagonal matrix A, of order 4:
* * | 1.0 1.0 0.0 0.0 | | 1.0 2.0 1.0 0.0 | | 0.0 1.0 3.0 1.0 | | 0.0 0.0 1.0 1.0 | * *
N C D E IOPT | | | | | CALL DGTNPF( 4 , C , D , E , 0 ) C = ( . , 1.0, 1.0, 1.0) D = (1.0, 2.0, 3.0, 1.0) E = (1.0, 1.0, 1.0, . )
C = ( . , -1.0, -1.0, 1.0) D = (-1.0, -1.0, -1.0, -1.0) E = (1.0, 1.0, -1.0, . )
This example shows a factorization of the tridiagonal matrix A, of order 4:
* * | (7.0, 7.0) (4.0, 4.0) (0.0, 0.0) (0.0, 0.0) | | (1.0, 1.0) (8.0, 8.0) (5.0, 5.0) (0.0, 0.0) | | (0.0, 0.0) (2.0, 2.0) (9.0, 9.0) (6.0, 6.0) | | (0.0, 0.0) (0.0, 0.0) (3.0, 3.0) (10.0, 10.0) | * *
N C D E IOPT | | | | | CALL ZGTNPF( 4 , C , D , E , 0 ) C = ( . , (1.0, 1.0), (2.0, 2.0), (3.0, 3.0)) D = ((7.0, 7.0), (8.0, 8.0), (9.0, 9.0), (10.0, 10.0)) E = ((4.0, 4.0), (5.0, 5.0), (6.0, 6.0), . )
C = ( . , (-0.142, 0.0), (-0.269, 0.0), (3.0, 3.0)) D = ((-0.0714, 0.0714), (-0.0673, 0.0673), (-0.0854, 0.0854), (-0.05, 0.05)) E = ((4.0, 4.0), (5.0, 5.0), (-0.6, 0.0), . )