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

« back to all changes in this revision

Viewing changes to Lib/integrate/odepack/bnorm.f

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T. Chen (new)
  • Date: 2005-03-16 02:15:29 UTC
  • Revision ID: james.westby@ubuntu.com-20050316021529-xrjlowsejs0cijig
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      double precision function bnorm (n, a, nra, ml, mu, w)
 
2
clll. optimize
 
3
c-----------------------------------------------------------------------
 
4
c this function computes the norm of a banded n by n matrix,
 
5
c stored in the array a, that is consistent with the weighted max-norm
 
6
c on vectors, with weights stored in the array w.
 
7
c ml and mu are the lower and upper half-bandwidths of the matrix.
 
8
c nra is the first dimension of the a array, nra .ge. ml+mu+1.
 
9
c in terms of the matrix elements a(i,j), the norm is given by..
 
10
c   bnorm = max(i=1,...,n) ( w(i) * sum(j=1,...,n) abs(a(i,j))/w(j) )
 
11
c-----------------------------------------------------------------------
 
12
      integer n, nra, ml, mu
 
13
      integer i, i1, jlo, jhi, j
 
14
      double precision a, w
 
15
      double precision an, sum
 
16
      dimension a(nra,n), w(n)
 
17
      an = 0.0d0
 
18
      do 20 i = 1,n
 
19
        sum = 0.0d0
 
20
        i1 = i + mu + 1
 
21
        jlo = max0(i-ml,1)
 
22
        jhi = min0(i+mu,n)
 
23
        do 10 j = jlo,jhi
 
24
 10       sum = sum + dabs(a(i1-j,j))/w(j)
 
25
        an = dmax1(an,sum*w(i))
 
26
 20     continue
 
27
      bnorm = an
 
28
      return
 
29
c----------------------- end of function bnorm -------------------------
 
30
      end