File: datatf.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 (214 lines) | stat: -rw-r--r-- 4,495 bytes parent folder | download
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
      subroutine datatf
c     Copyright INRIA
c ================================== ( Inria    ) =============
c     manipulation de donnees
c =============================================================
      include '../stack.h'
c
      common /tg02bd/ knot
      integer lr(4),per,iadr,sadr
      double precision vals(4)
      logical period
      data per/25/
c
c
c     fonction  spline inte
c                 1     2
c
c
      iadr(l)=l+l-1
      sadr(l)=(l/2)+1
c
      if (ddt .eq. 4) then
         write(buf(1:4),'(i4)') fin
         call basout(io,wte,' datatf '//buf(1:4))
      endif
      if(rhs.le.0) then
                call error(39)
                return
      endif
      goto (10,20) fin
c
c spline
c
   10 if(rhs.gt.3) then
         call error(39)
         return
      endif
      period=.false.
      if(rhs.eq.3) then
        il=iadr(lstk(top))
        if(istk(il).ne.10) then
           err=rhs
           call error(55)
           return
        endif
        if(istk(il+1)*istk(il+2).ne.1) then
           err=rhs
           call error(89)
           return
        endif
        if(abs(istk(il+6)).eq.per) period=.true.
        top=top-1
      endif
      il=iadr(lstk(top))
      if(istk(il).ne.1) then
         err=2
         call error(53)
         return
      endif
      if(istk(il+3).ne.0) then
       err=2
       call error(52)
       return
      endif
      nf=istk(il+1)*istk(il+2)
      lf=sadr(il+4)
      top=top-1
      il=iadr(lstk(top))
      if(istk(il).ne.1) then
         err=1
         call error(53)
         return
      endif
      if(istk(il+3).ne.0) then
         err=1
         call error(52)
         return
      endif
      nx=istk(il+1)*istk(il+2)
      n=min(nf,nx)
      lx=sadr(il+4)
c
      ld=lf+n
      lw=ld+n
      err=lw+3*n-lstk(bot)
      if(err.gt.0) then
         call error(17)
         return
      endif
      if(.not.period) then
         call dspln(n,stk(lx),stk(lf),stk(ld),stk(lw),err)
         if(err.eq.1) then
            err=1
            call error(99)
            return
         endif
      else
         call dpspln(n,stk(lx),stk(lf),stk(ld),stk(lw),err)
         if(err.eq.1) then
            err=1
            call error(99)
            return
         endif
         if(err.eq.2) then
            err=2
            call error(101)
            return
         endif
      endif
      call unsfdcopy(n,stk(ld),1,stk(lx),1)
      goto 99
c
c
c interpolation
c
   20 if(rhs.ne.4) then
         call error(39)
         return
      endif
      lw=lstk(top+1)
      il=iadr(lstk(top))
      if(istk(il).ne.1) then
         err=4
         call error(53)
         return
      endif
      if(istk(il+3).ne.0) then
         err=4
         call error(52)
         return
      endif
      n=istk(il+1)*istk(il+2)
      ld=sadr(il+4)
      top=top-1
      il=iadr(lstk(top))
      if(istk(il).ne.1) then
         err=3
         call error(53)
         return
      endif
      if(istk(il+3).ne.0) then
         err=3
         call error(52)
         return
      endif
      n=istk(il+1)*istk(il+2)
      lf=sadr(il+4)
      top=top-1
      il=iadr(lstk(top))
      if(istk(il).ne.1) then
         err=2
         call error(53)
         return
      endif
      if(istk(il+3).ne.0) then
         err=2
         call error(52)
         return
      endif
      n=istk(il+1)*istk(il+2)
      lx=sadr(il+4)
      top=top-1
      il=iadr(lstk(top))
      if(istk(il).ne.1) then
         err=1
         call error(53)
         return
      endif
      if(istk(il+3).ne.0) then
         err=1
         call error(52)
         return
      endif
      m0=istk(il+1)
      n0=istk(il+2)
      mn0=m0*n0
      lx0=sadr(il+4)
      lr(1)=lx0
      if(lhs.ge.2) then
            err=lw+(lhs-1)*mn0-lstk(bot)
            if(err.gt.0) then
               call error(17)
               return
            endif
            do 21 k=2,lhs
            lr(k)=lw
   21       lw=lw+mn0
      endif
      mode=-1
      do 23 i=1,mn0
      call tg02ad(mode,n,stk(lx),stk(lf),stk(ld),stk(lx0+i-1),
     1            vals)
      mode=1
      do 22 k=1,lhs
   22 stk(lr(k)-1+i)=vals(k)
      mode=+1
   23 continue
      if(lhs.eq.1) goto 99
      do 24 k=2,lhs
      top=top+1
      il=iadr(lstk(top))
      istk(il)=1
      istk(il+1)=n0
      istk(il+2)=m0
      istk(il+3)=0
      l=sadr(il+4)
      call unsfdcopy(mn0,stk(lr(k)),1,stk(l),1)
      lstk(top+1)=l+mn0
   24 continue
      goto 99
c
   99 continue
      return
      end