Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2789_MathNetNumerics-Exploration/HeuristicLab.Algorithms.DataAnalysis.Experimental/sbart/spbfa.f @ 17185

Last change on this file since 17185 was 15457, checked in by gkronber, 7 years ago

#2789 added Finbarr O'Sullivan smoothing spline code

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