1
subroutine dgesl(a,lda,n,ipvt,b,job)
2
integer lda,n,ipvt(1),job
3
double precision a(lda,1),b(1)
5
c dgesl solves the double precision system
6
c a * x = b or trans(a) * x = b
7
c using the factors computed by dgeco or dgefa.
11
c a double precision(lda, n)
12
c the output from dgeco or dgefa.
15
c the leading dimension of the array a .
18
c the order of the matrix a .
21
c the pivot vector from dgeco or dgefa.
23
c b double precision(n)
24
c the right hand side vector.
27
c = 0 to solve a*x = b ,
28
c = nonzero to solve trans(a)*x = b where
29
c trans(a) is the transpose.
33
c b the solution vector x .
37
c a division by zero will occur if the input factor contains a
38
c zero on the diagonal. technically this indicates singularity
39
c but it is often caused by improper arguments or improper
40
c setting of lda . it will not occur if the subroutines are
41
c called correctly and if dgeco has set rcond .gt. 0.0
42
c or dgefa has set info .eq. 0 .
44
c to compute inverse(a) * c where c is a matrix
46
c call dgeco(a,lda,n,ipvt,rcond,z)
47
c if (rcond is too small) go to ...
49
c call dgesl(a,lda,n,ipvt,c(1,j),0)
52
c linpack. this version dated 08/14/78 .
53
c cleve moler, university of new mexico, argonne national lab.
55
c subroutines and functions
61
double precision ddot,t
65
if (job .ne. 0) go to 50
67
c job = 0 , solve a * x = b
70
if (nm1 .lt. 1) go to 30
74
if (l .eq. k) go to 10
78
call daxpy(n-k,t,a(k+1,k),1,b(k+1),1)
88
call daxpy(k-1,t,a(1,k),1,b(1),1)
93
c job = nonzero, solve trans(a) * x = b
94
c first solve trans(u)*y = b
97
t = ddot(k-1,a(1,k),1,b(1),1)
98
b(k) = (b(k) - t)/a(k,k)
101
c now solve trans(l)*x = y
103
if (nm1 .lt. 1) go to 90
106
b(k) = b(k) + ddot(n-k,a(k+1,k),1,b(k+1),1)
108
if (l .eq. k) go to 70