Skip to content

Commit e6607ac

Browse files
committed
Use newer JLL with updated upstream source code
1 parent b5f9b37 commit e6607ac

File tree

3 files changed

+95
-55
lines changed

3 files changed

+95
-55
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
version:
22-
- '1.3'
22+
- 'min'
2323
- '1'
2424
- 'nightly'
2525
os:

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name = "Dierckx"
22
uuid = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
33
repo = "https://github.com/kbarbary/Dierckx.jl.git"
4-
version = "0.5.3"
4+
version = "0.5.4"
55

66
[deps]
77
Dierckx_jll = "cd4c43a9-7502-52ba-aa6d-59fb2a88580b"
88

99
[compat]
10-
Dierckx_jll = "0.0.1, 0.1"
11-
julia = "1.3"
10+
Dierckx_jll = "0.2"
11+
julia = "1.6"
1212

1313
[extras]
1414
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

src/Dierckx.jl

Lines changed: 91 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -148,28 +148,45 @@ function Spline1D(x::AbstractVector, y::AbstractVector;
148148
iwrk = Vector{Int32}(undef, nest)
149149

150150
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
162171
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
173190
end
174191

175192
ier[] <= 0 || error(_fit1d_messages[ier[]])
@@ -222,28 +239,45 @@ function Spline1D(x::AbstractVector, y::AbstractVector,
222239
iwrk = Vector{Int32}(undef, n)
223240

224241
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
236262
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
247281
end
248282

249283
ier[] <= 0 || error(_fit1d_messages[ier[]])
@@ -263,9 +297,10 @@ function _evaluate(t::Vector{Float64}, c::Vector{Float64}, k::Int,
263297
ccall((:splev_, libddierckx), Nothing,
264298
(Ref{Float64}, Ref{Int32},
265299
Ref{Float64}, Ref{Int32},
300+
Ref{Int32},
266301
Ref{Float64}, Ref{Float64}, Ref{Int32},
267302
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)
269304

270305
ier[] == 0 || error(_eval1d_messages[ier[]])
271306
return y
@@ -279,9 +314,10 @@ function _evaluate(t::Vector{Float64}, c::Vector{Float64}, k::Int,
279314
ccall((:splev_, libddierckx), Nothing,
280315
(Ref{Float64}, Ref{Int32},
281316
Ref{Float64}, Ref{Int32},
317+
Ref{Int32},
282318
Ref{Float64}, Ref{Float64}, Ref{Int32},
283319
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)
285321

286322
ier[] == 0 || error(_eval1d_messages[ier[]])
287323
return y[]
@@ -306,11 +342,12 @@ function _derivative(t::Vector{Float64}, c::Vector{Float64}, k::Int,
306342
ier = Ref{Int32}(0)
307343
ccall((:splder_, libddierckx), Nothing,
308344
(Ref{Float64}, Ref{Int32}, # t, n
309-
Ref{Float64}, Ref{Int32}, # c, k
345+
Ref{Float64}, Ref{Int32}, # c, nc
346+
Ref{Int32}, # k
310347
Ref{Int32}, # nu
311348
Ref{Float64}, Ref{Float64}, Ref{Int32}, # x, y, m
312349
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)
314351
ier[] == 0 || error(_eval1d_messages[ier[]])
315352
return y
316353
end
@@ -323,11 +360,12 @@ function _derivative(t::Vector{Float64}, c::Vector{Float64}, k::Int,
323360
ier = Ref{Int32}(0)
324361
ccall((:splder_, libddierckx), Nothing,
325362
(Ref{Float64}, Ref{Int32}, # t, n
326-
Ref{Float64}, Ref{Int32}, # c, k
363+
Ref{Float64}, Ref{Int32}, # c, nc
364+
Ref{Int32}, # k
327365
Ref{Int32}, # nu
328366
Ref{Float64}, Ref{Float64}, Ref{Int32}, # x, y, m
329367
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)
331369
ier[] == 0 || error(_eval1d_messages[ier[]])
332370
return y[]
333371
end
@@ -355,9 +393,10 @@ function _integrate(t::Vector{Float64}, c::Vector{Float64}, k::Int,
355393
ccall((:splint_, libddierckx), Float64,
356394
(Ref{Float64}, Ref{Int32},
357395
Ref{Float64}, Ref{Int32},
396+
Ref{Int32},
358397
Ref{Float64}, Ref{Float64},
359398
Ref{Float64}),
360-
t, n, c, k,
399+
t, n, c, length(c), k,
361400
Float64(a), Float64(b), wrk)
362401
end
363402

@@ -376,10 +415,11 @@ function roots(spline::Spline1D; maxn::Integer=8)
376415
ier = Vector{Int32}(undef, 1)
377416
ccall((:sproot_, libddierckx), Nothing,
378417
(Ref{Float64}, Ref{Int32}, # t, n
379-
Ref{Float64}, Ref{Float64}, # c, zeros
418+
Ref{Float64}, Ref{Int32}, # c, nc
419+
Ref{Float64}, # zeros
380420
Ref{Int32}, Ref{Int32}, # mest, m
381421
Ref{Int32}), # ier
382-
spline.t, n, spline.c, zeros,
422+
spline.t, n, spline.c, length(spline.c), zeros,
383423
maxn, m, ier)
384424

385425
if ier[1] == 0

0 commit comments

Comments
 (0)