~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to scipy/integrate/odepack/nntc.f

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine nntc
 
2
     *     (n, r, c, il, jl, ijl, l, d, iu, ju, iju, u, z, b, tmp)
 
3
clll. optimize
 
4
c*** subroutine nntc
 
5
c*** numeric solution of the transpose of a sparse nonsymmetric system
 
6
c      of linear equations given lu-factorization (compressed pointer
 
7
c      storage)
 
8
c
 
9
c
 
10
c       input variables..  n, r, c, il, jl, ijl, l, d, iu, ju, iju, u, b
 
11
c       output variables.. z
 
12
c
 
13
c       parameters used internally..
 
14
c fia   - tmp   - temporary vector which gets result of solving ut y = b
 
15
c       -           size = n.
 
16
c
 
17
c  internal variables..
 
18
c    jmin, jmax - indices of the first and last positions in a row of
 
19
c      u or l  to be used.
 
20
c
 
21
      integer r(1), c(1), il(1), jl(1), ijl(1), iu(1), ju(1), iju(1)
 
22
      double precision l(1), d(1), u(1), b(1), z(1), tmp(1), tmpk,sum
 
23
c
 
24
c  ******  set tmp to reordered b  *************************************
 
25
      do 1 k=1,n
 
26
   1    tmp(k) = b(c(k))
 
27
c  ******  solve  ut y = b  by forward substitution  *******************
 
28
      do 3 k=1,n
 
29
        jmin = iu(k)
 
30
        jmax = iu(k+1) - 1
 
31
        tmpk = -tmp(k)
 
32
        if (jmin .gt. jmax) go to 3
 
33
        mu = iju(k) - jmin
 
34
        do 2 j=jmin,jmax
 
35
   2      tmp(ju(mu+j)) = tmp(ju(mu+j)) + tmpk * u(j)
 
36
   3    continue
 
37
c  ******  solve  lt x = y  by back substitution  **********************
 
38
      k = n
 
39
      do 6 i=1,n
 
40
        sum = -tmp(k)
 
41
        jmin = il(k)
 
42
        jmax = il(k+1) - 1
 
43
        if (jmin .gt. jmax) go to 5
 
44
        ml = ijl(k) - jmin
 
45
        do 4 j=jmin,jmax
 
46
   4      sum = sum + l(j) * tmp(jl(ml+j))
 
47
   5    tmp(k) = -sum * d(k)
 
48
        z(r(k)) = tmp(k)
 
49
        k = k - 1
 
50
   6    continue
 
51
      return
 
52
      end