~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to routines/control/dclmat.f

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine dclmat(ia, n, a, b, ib, w, c, ndng)
 
2
c
 
3
c%purpose
 
4
c      computes a matrix polynomial representated in a chebyshev
 
5
c      base by the clenshaw method.
 
6
c
 
7
c%calling sequence
 
8
c
 
9
c     subroutine dclmat(ia, n, a, b, ib,w , c, ndng)
 
10
c
 
11
c     integer ia,n,ib,ndng
 
12
c     double precision a,b,w,c
 
13
c     dimension a(ia,n), b(ib,n), c(*), w(*)
 
14
c
 
15
c      ia: the leading dimension of array a.
 
16
c      n: the order of the matrices a,b.
 
17
c      a: the  array that contains the n*n matrix a
 
18
c      b: the  array that contains the n*n matrix
 
19
c         pol(a).
 
20
c      ib:the leading dimension of array b.
 
21
c      w : work-space array of size n+n
 
22
c      c:  vectors which contains the coefficients
 
23
c      of the polynome.
 
24
c      ndng: the polynomial order.
 
25
c
 
26
c%auxiliary routines
 
27
c     dmmul (blas.extension)
 
28
c%
 
29
c
 
30
      integer ia,n,ib,ndng
 
31
      double precision a,b,w,c
 
32
      dimension a(ia,n), b(ib,n), c(*), w(*)
 
33
c internal variables
 
34
c
 
35
      integer i1,i,im1,j,ndng1,ndng2
 
36
      double precision two,zero,rc,wd,w1,half
 
37
      data zero, two, half /0.0d+0,2.0d+0,0.50d+0/
 
38
c
 
39
      ndng1 = ndng + 2
 
40
      ndng2 = ndng - 1
 
41
      rc = c(ndng1-1)
 
42
      wd = c(1)
 
43
      do 60 j=1,n
 
44
         do 10 i=1,n
 
45
            w(n+i) = zero
 
46
            w(i) = zero
 
47
   10    continue
 
48
         do 30 i1=1,ndng
 
49
            im1 = ndng1 - i1
 
50
            call dmmul(a,ia,w,1,b(1,j),ib,n,n,1)
 
51
            do 20 i=1,n
 
52
               w1 = two*b(i,j) - w(n+i)
 
53
               w(n+i) = w(i)
 
54
               w(i) = w1
 
55
   20       continue
 
56
            w(j) = w(j) + c(im1)
 
57
   30    continue
 
58
      call dmmul(a,ia,w,n,b(1,j),ib,n,n,1)
 
59
         do 40 i=1,n
 
60
            w(i) = two*b(i,j) - w(n+i)
 
61
   40    continue
 
62
         w(j) = w(j) + wd
 
63
         do 50 i=1,n
 
64
            b(i,j) = (w(i)-w(n+i))*half
 
65
   50    continue
 
66
         b(j,j) = b(j,j) + half*wd
 
67
   60 continue
 
68
      return
 
69
      end