1 | subroutine spbsl(abd,lda,n,m,b) |
---|
2 | integer lda,n,m |
---|
3 | real abd(lda,1),b(1) |
---|
4 | c |
---|
5 | c spbsl solves the real symmetric positive definite band |
---|
6 | c system a*x = b |
---|
7 | c using the factors computed by spbco or spbfa. |
---|
8 | c |
---|
9 | c on entry |
---|
10 | c |
---|
11 | c abd real(lda, n) |
---|
12 | c the output from spbco or spbfa. |
---|
13 | c |
---|
14 | c lda integer |
---|
15 | c the leading dimension of the array abd . |
---|
16 | c |
---|
17 | c n integer |
---|
18 | c the order of the matrix a . |
---|
19 | c |
---|
20 | c m integer |
---|
21 | c the number of diagonals above the main diagonal. |
---|
22 | c |
---|
23 | c b real(n) |
---|
24 | c the right hand side vector. |
---|
25 | c |
---|
26 | c on return |
---|
27 | c |
---|
28 | c b the solution vector x . |
---|
29 | c |
---|
30 | c error condition |
---|
31 | c |
---|
32 | c a division by zero will occur if the input factor contains |
---|
33 | c a zero on the diagonal. technically this indicates |
---|
34 | c singularity but it is usually caused by improper subroutine |
---|
35 | c arguments. it will not occur if the subroutines are called |
---|
36 | c correctly and info .eq. 0 . |
---|
37 | c |
---|
38 | c to compute inverse(a) * c where c is a matrix |
---|
39 | c with p columns |
---|
40 | c call spbco(abd,lda,n,rcond,z,info) |
---|
41 | c if (rcond is too small .or. info .ne. 0) go to ... |
---|
42 | c do 10 j = 1, p |
---|
43 | c call spbsl(abd,lda,n,c(1,j)) |
---|
44 | c 10 continue |
---|
45 | c |
---|
46 | c linpack. this version dated 08/14/78 . |
---|
47 | c cleve moler, university of new mexico, argonne national lab. |
---|
48 | c |
---|
49 | c subroutines and functions |
---|
50 | c |
---|
51 | c blas saxpy,sdot |
---|
52 | c fortran min0 |
---|
53 | c |
---|
54 | c internal variables |
---|
55 | c |
---|
56 | real sdot,t |
---|
57 | integer k,kb,la,lb,lm |
---|
58 | c |
---|
59 | c solve trans(r)*y = b |
---|
60 | c |
---|
61 | do 10 k = 1, n |
---|
62 | lm = min0(k-1,m) |
---|
63 | la = m + 1 - lm |
---|
64 | lb = k - lm |
---|
65 | t = sdot(lm,abd(la,k),1,b(lb),1) |
---|
66 | b(k) = (b(k) - t)/abd(m+1,k) |
---|
67 | 10 continue |
---|
68 | c |
---|
69 | c solve r*x = y |
---|
70 | c |
---|
71 | do 20 kb = 1, n |
---|
72 | k = n + 1 - kb |
---|
73 | lm = min0(k-1,m) |
---|
74 | la = m + 1 - lm |
---|
75 | lb = k - lm |
---|
76 | b(k) = b(k)/abd(m+1,k) |
---|
77 | t = -b(k) |
---|
78 | call saxpy(lm,t,abd(la,k),1,b(lb),1) |
---|
79 | 20 continue |
---|
80 | return |
---|
81 | end |
---|