@@ -148,28 +148,45 @@ function Spline1D(x::AbstractVector, y::AbstractVector;
148
148
iwrk = Vector {Int32} (undef, nest)
149
149
150
150
if ! periodic
151
- ccall ((:curfit_ , libddierckx), Nothing,
152
- (Ref{Int32}, Ref{Int32}, # iopt, m
153
- Ref{Float64}, Ref{Float64}, Ref{Float64}, # x, y, w
154
- Ref{Float64}, Ref{Float64}, # xb, xe
155
- Ref{Int32}, Ref{Float64}, # k, s
156
- Ref{Int32}, Ref{Int32}, # nest, n
157
- Ref{Float64}, Ref{Float64}, Ref{Float64}, # t, c, fp
158
- Ref{Float64}, Ref{Int32}, Ref{Int32}, # wrk, lwrk, iwrk
159
- Ref{Int32}), # ier
160
- 0 , m, xin, yin, win, xin[1 ], xin[end ], k, Float64 (s),
161
- nest, n, t, c, fp, wrk, lwrk, iwrk, ier)
151
+ @ccall libddierckx. curfit_ (
152
+ 0 :: Ref{Int32} ,
153
+ m:: Ref{Int32} ,
154
+ xin:: Ref{Float64} ,
155
+ yin:: Ref{Float64} ,
156
+ win:: Ref{Float64} ,
157
+ xin[1 ]:: Ref{Float64} ,
158
+ xin[end ]:: Ref{Float64} ,
159
+ k:: Ref{Int32} ,
160
+ Float64 (s):: Ref{Float64} ,
161
+ nest:: Ref{Int32} ,
162
+ n:: Ref{Int32} ,
163
+ t:: Ref{Float64} ,
164
+ c:: Ref{Float64} ,
165
+ fp:: Ref{Float64} ,
166
+ wrk:: Ref{Float64} ,
167
+ lwrk:: Ref{Int32} ,
168
+ iwrk:: Ref{Int32} ,
169
+ ier:: Ref{Int32} ,
170
+ ):: Nothing
162
171
else
163
- ccall ((:percur_ , libddierckx), Nothing,
164
- (Ref{Int32}, Ref{Int32}, # iopt, m
165
- Ref{Float64}, Ref{Float64}, Ref{Float64}, # x, y, w
166
- Ref{Int32}, Ref{Float64}, # k, s
167
- Ref{Int32}, Ref{Int32}, # nest, n
168
- Ref{Float64}, Ref{Float64}, Ref{Float64}, # t, c, fp
169
- Ref{Float64}, Ref{Int32}, Ref{Int32}, # wrk, lwrk, iwrk
170
- Ref{Int32}), # ier
171
- 0 , m, xin, yin, win, k, Float64 (s), nest, n, t, c,
172
- fp, wrk, lwrk, iwrk, ier)
172
+ @ccall libddierckx. percur_ (
173
+ 0 :: Ref{Int32} ,
174
+ m:: Ref{Int32} ,
175
+ xin:: Ref{Float64} ,
176
+ yin:: Ref{Float64} ,
177
+ win:: Ref{Float64} ,
178
+ k:: Ref{Int32} ,
179
+ Float64 (s):: Ref{Float64} ,
180
+ nest:: Ref{Int32} ,
181
+ n:: Ref{Int32} ,
182
+ t:: Ref{Float64} ,
183
+ c:: Ref{Float64} ,
184
+ fp:: Ref{Float64} ,
185
+ wrk:: Ref{Float64} ,
186
+ lwrk:: Ref{Int32} ,
187
+ iwrk:: Ref{Int32} ,
188
+ ier:: Ref{Int32} ,
189
+ ):: Nothing
173
190
end
174
191
175
192
ier[] <= 0 || error (_fit1d_messages[ier[]])
@@ -222,28 +239,45 @@ function Spline1D(x::AbstractVector, y::AbstractVector,
222
239
iwrk = Vector {Int32} (undef, n)
223
240
224
241
if ! periodic
225
- ccall ((:curfit_ , libddierckx), Nothing,
226
- (Ref{Int32}, Ref{Int32}, # iopt, m
227
- Ref{Float64}, Ref{Float64}, Ref{Float64}, # x, y, w
228
- Ref{Float64}, Ref{Float64}, # xb, xe
229
- Ref{Int32}, Ref{Float64}, # k, s
230
- Ref{Int32}, Ref{Int32}, # nest, n
231
- Ref{Float64}, Ref{Float64}, Ref{Float64}, # t, c, fp
232
- Ref{Float64}, Ref{Int32}, Ref{Int32}, # wrk, lwrk, iwrk
233
- Ref{Int32}), # ier
234
- - 1 , m, xin, yin, win, xin[1 ], xin[end ], k, - 1.0 ,
235
- n, n, t, c, fp, wrk, lwrk, iwrk, ier)
242
+ @ccall libddierckx. curfit_ (
243
+ (- 1 ):: Ref{Int32} ,
244
+ m:: Ref{Int32} ,
245
+ xin:: Ref{Float64} ,
246
+ yin:: Ref{Float64} ,
247
+ win:: Ref{Float64} ,
248
+ xin[1 ]:: Ref{Float64} ,
249
+ xin[end ]:: Ref{Float64} ,
250
+ k:: Ref{Int32} ,
251
+ (- 1.0 ):: Ref{Float64} ,
252
+ n:: Ref{Int32} ,
253
+ n:: Ref{Int32} ,
254
+ t:: Ref{Float64} ,
255
+ c:: Ref{Float64} ,
256
+ fp:: Ref{Float64} ,
257
+ wrk:: Ref{Float64} ,
258
+ lwrk:: Ref{Int32} ,
259
+ iwrk:: Ref{Int32} ,
260
+ ier:: Ref{Int32} ,
261
+ ):: Nothing
236
262
else
237
- ccall ((:percur_ , libddierckx), Nothing,
238
- (Ref{Int32}, Ref{Int32}, # iopt, m
239
- Ref{Float64}, Ref{Float64}, Ref{Float64}, # x, y, w
240
- Ref{Int32}, Ref{Float64}, # k, s
241
- Ref{Int32}, Ref{Int32}, # nest, n
242
- Ref{Float64}, Ref{Float64}, Ref{Float64}, # t, c, fp
243
- Ref{Float64}, Ref{Int32}, Ref{Int32}, # wrk, lwrk, iwrk
244
- Ref{Int32}), # ier
245
- - 1 , m, xin, yin, win, k, - 1.0 , n, n, t, c,
246
- fp, wrk, lwrk, iwrk, ier)
263
+ @ccall libddierckx. percur_ (
264
+ (- 1 ):: Ref{Int32} ,
265
+ m:: Ref{Int32} ,
266
+ xin:: Ref{Float64} ,
267
+ yin:: Ref{Float64} ,
268
+ win:: Ref{Float64} ,
269
+ k:: Ref{Int32} ,
270
+ (- 1.0 ):: Ref{Float64} ,
271
+ n:: Ref{Int32} ,
272
+ n:: Ref{Int32} ,
273
+ t:: Ref{Float64} ,
274
+ c:: Ref{Float64} ,
275
+ fp:: Ref{Float64} ,
276
+ wrk:: Ref{Float64} ,
277
+ lwrk:: Ref{Int32} ,
278
+ iwrk:: Ref{Int32} ,
279
+ ier:: Ref{Int32} ,
280
+ ):: Nothing
247
281
end
248
282
249
283
ier[] <= 0 || error (_fit1d_messages[ier[]])
@@ -263,9 +297,10 @@ function _evaluate(t::Vector{Float64}, c::Vector{Float64}, k::Int,
263
297
ccall ((:splev_ , libddierckx), Nothing,
264
298
(Ref{Float64}, Ref{Int32},
265
299
Ref{Float64}, Ref{Int32},
300
+ Ref{Int32},
266
301
Ref{Float64}, Ref{Float64}, Ref{Int32},
267
302
Ref{Int32}, Ref{Int32}),
268
- t, length (t), c, k, xin, y, m, bc, ier)
303
+ t, length (t), c, length (c), k, xin, y, m, bc, ier)
269
304
270
305
ier[] == 0 || error (_eval1d_messages[ier[]])
271
306
return y
@@ -279,9 +314,10 @@ function _evaluate(t::Vector{Float64}, c::Vector{Float64}, k::Int,
279
314
ccall ((:splev_ , libddierckx), Nothing,
280
315
(Ref{Float64}, Ref{Int32},
281
316
Ref{Float64}, Ref{Int32},
317
+ Ref{Int32},
282
318
Ref{Float64}, Ref{Float64}, Ref{Int32},
283
319
Ref{Int32}, Ref{Int32}),
284
- t, length (t), c, k, Float64 (x), y, 1 , bc, ier)
320
+ t, length (t), c, length (c), k, Float64 (x), y, 1 , bc, ier)
285
321
286
322
ier[] == 0 || error (_eval1d_messages[ier[]])
287
323
return y[]
@@ -306,11 +342,12 @@ function _derivative(t::Vector{Float64}, c::Vector{Float64}, k::Int,
306
342
ier = Ref {Int32} (0 )
307
343
ccall ((:splder_ , libddierckx), Nothing,
308
344
(Ref{Float64}, Ref{Int32}, # t, n
309
- Ref{Float64}, Ref{Int32}, # c, k
345
+ Ref{Float64}, Ref{Int32}, # c, nc
346
+ Ref{Int32}, # k
310
347
Ref{Int32}, # nu
311
348
Ref{Float64}, Ref{Float64}, Ref{Int32}, # x, y, m
312
349
Ref{Int32}, Ref{Float64}, Ref{Int32}), # e, wrk, ier
313
- t, n, c, k, nu, x, y, m, bc, wrk, ier)
350
+ t, n, c, length (c), k, nu, x, y, m, bc, wrk, ier)
314
351
ier[] == 0 || error (_eval1d_messages[ier[]])
315
352
return y
316
353
end
@@ -323,11 +360,12 @@ function _derivative(t::Vector{Float64}, c::Vector{Float64}, k::Int,
323
360
ier = Ref {Int32} (0 )
324
361
ccall ((:splder_ , libddierckx), Nothing,
325
362
(Ref{Float64}, Ref{Int32}, # t, n
326
- Ref{Float64}, Ref{Int32}, # c, k
363
+ Ref{Float64}, Ref{Int32}, # c, nc
364
+ Ref{Int32}, # k
327
365
Ref{Int32}, # nu
328
366
Ref{Float64}, Ref{Float64}, Ref{Int32}, # x, y, m
329
367
Ref{Int32}, Ref{Float64}, Ref{Int32}), # e, wrk, ier
330
- t, n, c, k, nu, Float64 (x), y, 1 , bc, wrk, ier)
368
+ t, n, c, length (c), k, nu, Float64 (x), y, 1 , bc, wrk, ier)
331
369
ier[] == 0 || error (_eval1d_messages[ier[]])
332
370
return y[]
333
371
end
@@ -355,9 +393,10 @@ function _integrate(t::Vector{Float64}, c::Vector{Float64}, k::Int,
355
393
ccall ((:splint_ , libddierckx), Float64,
356
394
(Ref{Float64}, Ref{Int32},
357
395
Ref{Float64}, Ref{Int32},
396
+ Ref{Int32},
358
397
Ref{Float64}, Ref{Float64},
359
398
Ref{Float64}),
360
- t, n, c, k,
399
+ t, n, c, length (c), k,
361
400
Float64 (a), Float64 (b), wrk)
362
401
end
363
402
@@ -376,10 +415,11 @@ function roots(spline::Spline1D; maxn::Integer=8)
376
415
ier = Vector {Int32} (undef, 1 )
377
416
ccall ((:sproot_ , libddierckx), Nothing,
378
417
(Ref{Float64}, Ref{Int32}, # t, n
379
- Ref{Float64}, Ref{Float64}, # c, zeros
418
+ Ref{Float64}, Ref{Int32}, # c, nc
419
+ Ref{Float64}, # zeros
380
420
Ref{Int32}, Ref{Int32}, # mest, m
381
421
Ref{Int32}), # ier
382
- spline. t, n, spline. c, zeros,
422
+ spline. t, n, spline. c, length (spline . c), zeros,
383
423
maxn, m, ier)
384
424
385
425
if ier[1 ] == 0
0 commit comments