File: misops.f

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (144 lines) | stat: -rw-r--r-- 3,384 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
      subroutine misops
c     ================================== ( Inria    ) =============
c     operations sur les types secondaires (macros librairies...)
c     =============================================================
c     Copyright INRIA
      include '../stack.h'
c     
      integer top0,iadr,sadr,op,rhs1
      integer equal,less,great,insert,extrac
      data equal/50/,less/59/,great/60/,insert/2/,extrac/3/
c     
      iadr(l)=l+l-1
      sadr(l)=(l/2)+1
c     
      op=fin
c     
      if (ddt .eq. 4) then
         write(buf(1:4),'(i4)') fin
         call basout(io,wte,' macops '//buf(1:4))
      endif
c     
      fun=0
c     
      top0=top
c     
      lw=lstk(top+1)
      rhs1=rhs
      if(op.eq.insert) rhs=2
      if(op.eq.extrac) rhs=1
c     
      il2=iadr(lstk(top))
      if(istk(il2).lt.0) il2=iadr(istk(il2+1))
c     
c     
      ityp=0
      do 01 i=top+1-rhs1,top
        ityp=max(ityp,abs(istk(iadr(lstk(i)))))
 01   continue
      if(ityp.eq.11.or.ityp.eq.13) goto 100
      if(ityp.eq.14) goto 50
      call error(43)
      return
c
c
 50   continue
c     librairies
      if(op.eq.equal.or.op.eq.less+great) goto 60
c     
c     operations non implantees
      top=top0
      fin=-fin
      return
c     
c     comparaisons
 60   continue
      top = top-1
      il1=iadr(lstk(top))
      ilr=il1
      if(istk(il1).lt.0) il1=iadr(istk(il1+1))
      itrue=1
      if(op.eq.less+great) itrue=0
      ilog=1-itrue
c     
      if(istk(il1).ne.istk(il2)) goto 65
      if(istk(il1+1).ne.istk(il2+1)) goto 65
      nf=istk(il1+1)
      do 61 i=1,nf
         if(istk(il1+1+i).ne.istk(il2+1+i)) goto 65
 61   continue
      ln=2+nf
      if(istk(il1+ln).ne.istk(il2+ln)) goto 65
      nh=istk(il1+ln)
      if(nh.gt.0) then
         do 62 i=1,nh
            if(istk(il1+ln+i).ne.istk(il2+ln+i)) goto 65
 62      continue
      endif
      ln=ln+nh+1
      if(istk(il1+ln).ne.istk(il2+ln)) goto 65
      long=istk(il1+ln)
      do 63 i=1,long*nsiz
         if(istk(il1+ln+i).ne.istk(il2+ln+i)) goto 65
 63   continue
      ilog=itrue
      
 65   istk(ilr)=4
      istk(ilr+1)=1
      istk(ilr+2)=1
      istk(ilr+3)=ilog
      lstk(top+1)=sadr(ilr+4)
      goto 999
      
      
c     
 100  continue
c     macros
      if(op.eq.equal.or.op.eq.less+great) goto 180
c     
c     operations non implantees
      top=top0
      fin=-fin
      return
c     
c     comparaisons
 180  continue
      top = top-1
      il1=iadr(lstk(top))
      ilr=il1
      if(istk(il1).lt.0) il1=iadr(istk(il1+1))
      itrue=1
      if(op.eq.less+great) itrue=0
      ilog=1-itrue
c     
      If(istk(il1).ne.istk(il2)) goto 185
      if(istk(il1+1).ne.istk(il2+1)) goto 185
      mrhs=istk(il1+1)
      do 181 i=1,nsiz*mrhs
         if(istk(il1+1+i).ne.istk(il2+1+i)) goto 185
 181  continue
      ln=2+nsiz*mrhs
      if(istk(il1+ln).ne.istk(il2+ln)) goto 185
      mlhs=istk(il1+ln)
      do 182 i=1,nsiz*mlhs
         if(istk(il1+ln+i).ne.istk(il2+ln+i)) goto 185
 182  continue
      ln=ln+nsiz*mlhs+1
      if(istk(il1+ln).ne.istk(il2+ln)) goto 185
      long=istk(il1+ln)
      do 183 i=1,long
         if(istk(il1+ln+i).ne.istk(il2+ln+i)) goto 185
 183  continue
      ilog=itrue
      
 185  istk(ilr)=4
      istk(ilr+1)=1
      istk(ilr+2)=1
      istk(ilr+3)=ilog
      lstk(top+1)=sadr(ilr+4)
      goto 999
      
c     
      
 999  return
      end