1
subroutine dgtsl(n,c,d,e,b,info)
3
double precision c(1),d(1),e(1),b(1)
5
c dgtsl given a general tridiagonal matrix and a right hand
6
c side will find the solution.
11
c is the order of the tridiagonal matrix.
13
c c double precision(n)
14
c is the subdiagonal of the tridiagonal matrix.
15
c c(2) through c(n) should contain the subdiagonal.
16
c on output c is destroyed.
18
c d double precision(n)
19
c is the diagonal of the tridiagonal matrix.
20
c on output d is destroyed.
22
c e double precision(n)
23
c is the superdiagonal of the tridiagonal matrix.
24
c e(1) through e(n-1) should contain the superdiagonal.
25
c on output e is destroyed.
27
c b double precision(n)
28
c is the right hand side vector.
32
c b is the solution vector.
36
c = k if the k-th element of the diagonal becomes
37
c exactly zero. the subroutine returns when
40
c linpack. this version dated 08/14/78 .
41
c jack dongarra, argonne national laboratory.
48
integer k,kb,kp1,nm1,nm2
50
c begin block permitting ...exits to 100
55
if (nm1 .lt. 1) go to 40
63
c find the largest of the two rows
65
if (dabs(c(kp1)) .lt. dabs(c(k))) go to 10
85
if (c(k) .ne. 0.0d0) go to 20
91
c(kp1) = d(kp1) + t*d(k)
92
d(kp1) = e(kp1) + t*e(k)
94
b(kp1) = b(kp1) + t*b(k)
97
if (c(n) .ne. 0.0d0) go to 50
106
if (n .eq. 1) go to 80
107
b(nm1) = (b(nm1) - d(nm1)*b(n))/c(nm1)
108
if (nm2 .lt. 1) go to 70
111
b(k) = (b(k) - d(k)*b(k+1) - e(k)*b(k+2))/c(k)