gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
bchslv.f
Go to the documentation of this file.
1  subroutine bchslv ( w, nbands, nrow, b )
2 
3 c*********************************************************************72
4 c
5 cc BCHSLV solves a banded symmetric positive definite system.
6 c
7 c from * a practical guide to splines * by c. de boor
8 c solves the linear system c*x = b of order n r o w for x
9 c provided w contains the cholesky factorization for the banded (sym-
10 c metric) positive definite matrix c as constructed in the subroutine
11 c b c h f a c (quo vide).
12 c
13 c****** i n p u t ******
14 c nrow.....is the order of the matrix c .
15 c nbands.....indicates the bandwidth of c .
16 c w.....contains the cholesky factorization for c , as output from
17 c subroutine bchfac (quo vide).
18 c b.....the vector of length n r o w containing the right side.
19 c
20 c****** o u t p u t ******
21 c b.....the vector of length n r o w containing the solution.
22 c
23 c****** m e t h o d ******
24 c with the factorization c = l*d*l-transpose available, where l is
25 c unit lower triangular and d is diagonal, the triangular system
26 c l*y = b is solved for y (forward substitution), y is stored in b,
27 c the vector d**(-1)*y is computed and stored in b, then the triang-
28 c ular system l-transpose*x = d**(-1)*y is solved for x (backsubstit-
29 c ution).
30 c
31  implicit none
32 
33  integer nbands,nrow, j,jmax,n,nbndm1
34  double precision w(nbands,nrow),b(nrow)
35  if (nrow .gt. 1) go to 21
36  b(1) = b(1)*w(1,1)
37  return
38 c
39 c forward substitution. solve l*y = b for y, store in b.
40  21 nbndm1 = nbands - 1
41  do 30 n=1,nrow
42  jmax = min0(nbndm1,nrow-n)
43  if (jmax .lt. 1) go to 30
44  do 25 j=1,jmax
45  25 b(j+n) = b(j+n) - w(j+1,n)*b(n)
46  30 continue
47 c
48 c backsubstitution. solve l-transp.x = d**(-1)*y for x, store in b.
49  n = nrow
50  39 b(n) = b(n)*w(1,n)
51  jmax = min0(nbndm1,nrow-n)
52  if (jmax .lt. 1) go to 40
53  do 35 j=1,jmax
54  35 b(n) = b(n) - w(j+1,n)*b(j+n)
55  40 n = n-1
56  if (n .gt. 0) go to 39
57  return
58  end
subroutine bchslv(w, nbands, nrow, b)
Definition: bchslv.f:2
gtkIOStream: /tmp/gtkiostream/src/deBoor/bchslv.f Source File
GTK+ IOStream  Beta