2 SUBROUTINE DGBSL
(ABD
, LDA
, N
, ML
, MU
, IPVT
, B
, JOB
)
3 C***BEGIN PROLOGUE DGBSL
4 C***PURPOSE Solve the real band system A*X=B or TRANS(A)*X=B using
5 C the factors computed by DGBCO or DGBFA.
7 C***TYPE DOUBLE PRECISION (SGBSL-S, DGBSL-D, CGBSL-C)
8 C***KEYWORDS BANDED, LINEAR ALGEBRA, LINPACK, MATRIX, SOLVE
9 C***AUTHOR Moler, C. B., (U. of New Mexico)
12 C DGBSL solves the double precision band system
13 C A * X = B or TRANS(A) * X = B
14 C using the factors computed by DGBCO or DGBFA.
18 C ABD DOUBLE PRECISION(LDA, N)
19 C the output from DGBCO or DGBFA.
22 C the leading dimension of the array ABD .
25 C the order of the original matrix.
28 C number of diagonals below the main diagonal.
31 C number of diagonals above the main diagonal.
34 C the pivot vector from DGBCO or DGBFA.
36 C B DOUBLE PRECISION(N)
37 C the right hand side vector.
40 C = 0 to solve A*X = B ,
41 C = nonzero to solve TRANS(A)*X = B , where
42 C TRANS(A) is the transpose.
46 C B the solution vector X .
50 C A division by zero will occur if the input factor contains a
51 C zero on the diagonal. Technically this indicates singularity
52 C but it is often caused by improper arguments or improper
53 C setting of LDA . It will not occur if the subroutines are
54 C called correctly and if DGBCO has set RCOND .GT. 0.0
55 C or DGBFA has set INFO .EQ. 0 .
57 C To compute INVERSE(A) * C where C is a matrix
59 C CALL DGBCO(ABD,LDA,N,ML,MU,IPVT,RCOND,Z)
60 C IF (RCOND is too small) GO TO ...
62 C CALL DGBSL(ABD,LDA,N,ML,MU,IPVT,C(1,J),0)
65 C***REFERENCES J. J. Dongarra, J. R. Bunch, C. B. Moler, and G. W.
66 C Stewart, LINPACK Users' Guide, SIAM, 1979.
67 C***ROUTINES CALLED DAXPY, DDOT
68 C***REVISION HISTORY (YYMMDD)
70 C 890531 Changed all specific intrinsics to generic. (WRB)
71 C 890831 Modified array declarations. (WRB)
72 C 890831 REVISION DATE from Version 3.2
73 C 891214 Prologue converted to Version 4.0 format. (BAB)
74 C 900326 Removed duplicate information from DESCRIPTION section.
76 C 920501 Reformatted the REFERENCES section. (WRB)
77 C***END PROLOGUE DGBSL
78 INTEGER LDA
,N
,ML
,MU
,IPVT
(*),JOB
79 DOUBLE PRECISION ABD
(LDA
,*),B
(*)
81 DOUBLE PRECISION DDOT
,T
82 INTEGER K
,KB
,L
,LA
,LB
,LM
,M
,NM1
83 C***FIRST EXECUTABLE STATEMENT DGBSL
86 IF (JOB
.NE
. 0) GO TO 50
88 C JOB = 0 , SOLVE A * X = B
91 IF (ML
.EQ
. 0) GO TO 30
92 IF (NM1
.LT
. 1) GO TO 30
97 IF (L
.EQ
. K
) GO TO 10
101 CALL DAXPY
(LM
,T
,ABD
(M
+1,K
),1,B
(K
+1),1)
114 CALL DAXPY
(LM
,T
,ABD
(LA
,K
),1,B
(LB
),1)
119 C JOB = NONZERO, SOLVE TRANS(A) * X = B
120 C FIRST SOLVE TRANS(U)*Y = B
126 T
= DDOT
(LM
,ABD
(LA
,K
),1,B
(LB
),1)
127 B
(K
) = (B
(K
) - T
)/ABD
(M
,K
)
130 C NOW SOLVE TRANS(L)*X = Y
132 IF (ML
.EQ
. 0) GO TO 90
133 IF (NM1
.LT
. 1) GO TO 90
137 B
(K
) = B
(K
) + DDOT
(LM
,ABD
(M
+1,K
),1,B
(K
+1),1)
139 IF (L
.EQ
. K
) GO TO 70