~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to routines/optim/majz.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 majz(n,np,nt,y,s,z,ys,zs,diag,index)
 
2
c
 
3
c     mise a jour de ({z}(i),zs(i), i=1,np).
 
4
c     {z}(i)=[b](i-1)*{s}(i), [b](i) est definie par ({y}(j),{s}(j),{z}(j)
 
5
c     , j=1,i) et {diag}.
 
6
c     zs(i)=<z>(i)*{s}(i)
 
7
c
 
8
c     Copyright INRIA
 
9
c
 
10
      implicit double precision (a-h,o-z)
 
11
      dimension     y(nt,n),s(nt,n),z(nt,n),ys(nt),zs(nt),diag(n)
 
12
      integer  index(nt)
 
13
c
 
14
      l=index(1)
 
15
      do 100 jj=1,n
 
16
         z(l,jj)=diag(jj)*s(l,jj)
 
17
100   continue
 
18
c
 
19
      zs(l)=0
 
20
      do 110 jj=1,n
 
21
         zs(l)=zs(l)+z(l,jj)*s(l,jj)
 
22
110   continue
 
23
c
 
24
c
 
25
      if(np.eq.1) return
 
26
c
 
27
      do 200 i=2,np
 
28
         l=index(i)
 
29
         do 210 jj=1,n
 
30
            z(l,jj)=diag(jj)*s(l,jj)
 
31
210      continue
 
32
         do 220 j=1,i-1
 
33
            psy=0
 
34
            psz=0
 
35
            jl=index(j)
 
36
            do 230 jj=1,n
 
37
               psy=psy+y(jl,jj)*s(l,jj)
 
38
               psz=psz+z(jl,jj)*s(l,jj)
 
39
230         continue
 
40
            do 240 jj=1,n
 
41
               z(l,jj)=z(l,jj)+psy*y(jl,jj)/ys(jl)-psz*z(jl,jj)
 
42
     &                 /zs(jl)
 
43
240         continue
 
44
220      continue
 
45
c
 
46
         zs(l)=0
 
47
         do 250 jj=1,n
 
48
            zs(l)=zs(l)+z(l,jj)*s(l,jj)
 
49
250      continue
 
50
200   continue
 
51
c
 
52
      return
 
53
      end