1 | subroutine spbfa(abd,lda,n,m,info) |
---|
2 | integer lda,n,m,info |
---|
3 | real abd(lda,1) |
---|
4 | c |
---|
5 | c spbfa factors a real symmetric positive definite matrix |
---|
6 | c stored in band form. |
---|
7 | c |
---|
8 | c spbfa is usually called by spbco, but it can be called |
---|
9 | c directly with a saving in time if rcond is not needed. |
---|
10 | c |
---|
11 | c on entry |
---|
12 | c |
---|
13 | c abd real(lda, n) |
---|
14 | c the matrix to be factored. the columns of the upper |
---|
15 | c triangle are stored in the columns of abd and the |
---|
16 | c diagonals of the upper triangle are stored in the |
---|
17 | c rows of abd . see the comments below for details. |
---|
18 | c |
---|
19 | c lda integer |
---|
20 | c the leading dimension of the array abd . |
---|
21 | c lda must be .ge. m + 1 . |
---|
22 | c |
---|
23 | c n integer |
---|
24 | c the order of the matrix a . |
---|
25 | c |
---|
26 | c m integer |
---|
27 | c the number of diagonals above the main diagonal. |
---|
28 | c 0 .le. m .lt. n . |
---|
29 | c |
---|
30 | c on return |
---|
31 | c |
---|
32 | c abd an upper triangular matrix r , stored in band |
---|
33 | c form, so that a = trans(r)*r . |
---|
34 | c |
---|
35 | c info integer |
---|
36 | c = 0 for normal return. |
---|
37 | c = k if the leading minor of order k is not |
---|
38 | c positive definite. |
---|
39 | c |
---|
40 | c band storage |
---|
41 | c |
---|
42 | c if a is a symmetric positive definite band matrix, |
---|
43 | c the following program segment will set up the input. |
---|
44 | c |
---|
45 | c m = (band width above diagonal) |
---|
46 | c do 20 j = 1, n |
---|
47 | c i1 = max0(1, j-m) |
---|
48 | c do 10 i = i1, j |
---|
49 | c k = i-j+m+1 |
---|
50 | c abd(k,j) = a(i,j) |
---|
51 | c 10 continue |
---|
52 | c 20 continue |
---|
53 | c |
---|
54 | c linpack. this version dated 08/14/78 . |
---|
55 | c cleve moler, university of new mexico, argonne national lab. |
---|
56 | c |
---|
57 | c subroutines and functions |
---|
58 | c |
---|
59 | c blas sdot |
---|
60 | c fortran max0,sqrt |
---|
61 | c |
---|
62 | c internal variables |
---|
63 | c |
---|
64 | real sdot,t |
---|
65 | real s |
---|
66 | integer ik,j,jk,k,mu |
---|
67 | c begin block with ...exits to 40 |
---|
68 | c |
---|
69 | c |
---|
70 | do 30 j = 1, n |
---|
71 | info = j |
---|
72 | s = 0.0e0 |
---|
73 | ik = m + 1 |
---|
74 | jk = max0(j-m,1) |
---|
75 | mu = max0(m+2-j,1) |
---|
76 | if (m .lt. mu) go to 20 |
---|
77 | do 10 k = mu, m |
---|
78 | t = abd(k,j) - sdot(k-mu,abd(ik,jk),1,abd(mu,j),1) |
---|
79 | t = t/abd(m+1,jk) |
---|
80 | abd(k,j) = t |
---|
81 | s = s + t*t |
---|
82 | ik = ik - 1 |
---|
83 | jk = jk + 1 |
---|
84 | 10 continue |
---|
85 | 20 continue |
---|
86 | s = abd(m+1,j) - s |
---|
87 | c ......exit |
---|
88 | if (s .le. 0.0e0) go to 40 |
---|
89 | abd(m+1,j) = sqrt(s) |
---|
90 | 30 continue |
---|
91 | info = 0 |
---|
92 | 40 continue |
---|
93 | return |
---|
94 | end |
---|