~ubuntu-branches/ubuntu/saucy/python-scipy/saucy

« back to all changes in this revision

Viewing changes to scipy/integrate/odepack/cntnzu.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 cntnzu (n, ia, ja, nzsut)
 
2
      integer n, ia, ja, nzsut
 
3
      dimension ia(1), ja(1)
 
4
c-----------------------------------------------------------------------
 
5
c this routine counts the number of nonzero elements in the strict
 
6
c upper triangle of the matrix m + m(transpose), where the sparsity
 
7
c structure of m is given by pointer arrays ia and ja.
 
8
c this is needed to compute the storage requirements for the
 
9
c sparse matrix reordering operation in odrv.
 
10
c-----------------------------------------------------------------------
 
11
      integer ii, jj, j, jmin, jmax, k, kmin, kmax, num
 
12
c
 
13
      num = 0
 
14
      do 50 ii = 1,n
 
15
        jmin = ia(ii)
 
16
        jmax = ia(ii+1) - 1
 
17
        if (jmin .gt. jmax) go to 50
 
18
        do 40 j = jmin,jmax
 
19
          if (ja(j).lt.ii) go to 10
 
20
          if (ja(j).eq.ii) go to 40
 
21
          go to 30
 
22
 10       jj =ja(j)
 
23
          kmin = ia(jj)
 
24
          kmax = ia(jj+1) - 1
 
25
          if (kmin .gt. kmax) go to 30
 
26
          do 20 k = kmin,kmax
 
27
            if (ja(k) .eq. ii) go to 40
 
28
 20         continue
 
29
 30       num = num + 1
 
30
 40       continue
 
31
 50     continue
 
32
      nzsut = num
 
33
      return
 
34
c----------------------- end of subroutine cntnzu ----------------------
 
35
      end