1      subroutine cppsl(ap,n,b)
2      integer n
3      complex ap(1),b(1)
4c
5c     cppsl solves the complex hermitian positive definite system
6c     a * x = b
7c     using the factors computed by cppco or cppfa.
8c
9c     on entry
10c
11c        ap      complex (n*(n+1)/2)
12c                the output from cppco or cppfa.
13c
14c        n       integer
15c                the order of the matrix  a .
16c
17c        b       complex(n)
18c                the right hand side vector.
19c
20c     on return
21c
22c        b       the solution vector  x .
23c
24c     error condition
25c
26c        a division by zero will occur if the input factor contains
27c        a zero on the diagonal.  technically this indicates
28c        singularity but it is usually caused by improper subroutine
29c        arguments.  it will not occur if the subroutines are called
30c        correctly and  info .eq. 0 .
31c
32c     to compute  inverse(a) * c  where  c  is a matrix
33c     with  p  columns
34c           call cppco(ap,n,rcond,z,info)
35c           if (rcond is too small .or. info .ne. 0) go to ...
36c           do 10 j = 1, p
37c              call cppsl(ap,n,c(1,j))
38c        10 continue
39c
40c     linpack.  this version dated 08/14/78 .
41c     cleve moler, university of new mexico, argonne national lab.
42c
43c     subroutines and functions
44c
45c     blas caxpy,cdotc
46c
47c     internal variables
48c
49      complex cdotc,t
50      integer k,kb,kk
51c
52      kk = 0
53      do 10 k = 1, n
54         t = cdotc(k-1,ap(kk+1),1,b(1),1)
55         kk = kk + k
56         b(k) = (b(k) - t)/ap(kk)
57   10 continue
58      do 20 kb = 1, n
59         k = n + 1 - kb
60         b(k) = b(k)/ap(kk)
61         kk = kk - k
62         t = -b(k)
63         call caxpy(k-1,t,ap(kk+1),1,b(1),1)
64   20 continue
65      return
66      end
67