Skip to content

Commit 9c380b0

Browse files
carlobaldassisglyon
authored andcommitted
Fixes for julia 0.7 (#218)
* Fixes for julia 0.7 except for the IO part, whose tests are disabled * Simplify inference bug workaround And limit its applicability range to before the fix. Credit to @RalphAS, this is basically #219. * Require AxisAlgorithms 0.3.0 * Change WebIO->Interpolations in travis script * Add an at-static annotation
1 parent b6ee0f3 commit 9c380b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+299
-214
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ language: julia
22
sudo: false
33
julia:
44
- 0.6
5+
- 0.7
56
- nightly
67
matrix:
78
allow_failures:
89
- julia: nightly
910
after_success:
1011
# push coverage results to Coveralls
11-
- julia -e 'cd(Pkg.dir("WebIO")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
12+
- julia -e 'cd(Pkg.dir("Interpolations")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
1213
# push coverage results to Codecov
13-
- julia -e 'cd(Pkg.dir("WebIO")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
14+
- julia -e 'cd(Pkg.dir("Interpolations")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

REQUIRE

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ julia 0.6
33
ShowItLikeYouBuildIt
44
WoodburyMatrices 0.1.5
55
Ratios
6-
AxisAlgorithms
7-
Compat 0.49
6+
AxisAlgorithms 0.3.0
7+
OffsetArrays
8+
Compat 0.59

src/Interpolations.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,20 @@ export
3838
# scaling/scaling.jl
3939

4040
using Compat
41-
using Compat.LinearAlgebra
42-
using WoodburyMatrices, Ratios, AxisAlgorithms
41+
using Compat.LinearAlgebra, Compat.SparseArrays
42+
using WoodburyMatrices, Ratios, AxisAlgorithms, OffsetArrays
4343

44-
import Base: convert, size, indices, getindex, gradient, promote_rule,
44+
import Base: convert, size, getindex, promote_rule,
4545
ndims, eltype, checkbounds
4646

47-
# Julia v0.5 compatibility
48-
if isdefined(:scaling) import Base.scaling end
49-
if isdefined(:scale) import Base.scale end
50-
if !isdefined(Base, :oneunit)
51-
const oneunit = one
47+
@static if VERSION < v"0.7.0-DEV.3449"
48+
import Base: gradient
49+
else
50+
import LinearAlgebra: gradient
5251
end
5352

53+
import Compat: axes
54+
5455
abstract type Flag end
5556
abstract type InterpolationType <: Flag end
5657
struct NoInterp <: InterpolationType end

src/b-splines/b-splines.jl

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ struct BSplineInterpolation{T,N,TCoefs<:AbstractArray,IT<:DimSpec{BSpline},GT<:D
1818
coefs::TCoefs
1919
end
2020
function BSplineInterpolation(::Type{TWeights}, A::AbstractArray{Tel,N}, ::IT, ::GT, ::Val{pad}) where {N,Tel,TWeights<:Real,IT<:DimSpec{BSpline},GT<:DimSpec{GridType},pad}
21-
isleaftype(IT) || error("The b-spline type must be a leaf type (was $IT)")
22-
isleaftype(typeof(A)) || warn("For performance reasons, consider using an array of a concrete type (typeof(A) == $(typeof(A)))")
21+
isconcretetype(IT) || error("The b-spline type must be a leaf type (was $IT)")
22+
isconcretetype(typeof(A)) || warn("For performance reasons, consider using an array of a concrete type (typeof(A) == $(typeof(A)))")
2323

2424
c = zero(TWeights)
2525
for _ in 2:N
@@ -42,13 +42,13 @@ padextract(pad::Integer, d) = pad
4242
padextract(pad::Tuple{Vararg{Integer}}, d) = pad[d]
4343

4444
lbound(itp::BSplineInterpolation{T,N,TCoefs,IT,OnGrid}, d::Integer) where {T,N,TCoefs,IT} =
45-
first(indices(itp, d))
45+
first(axes(itp, d))
4646
ubound(itp::BSplineInterpolation{T,N,TCoefs,IT,OnGrid}, d::Integer) where {T,N,TCoefs,IT} =
47-
last(indices(itp, d))
47+
last(axes(itp, d))
4848
lbound(itp::BSplineInterpolation{T,N,TCoefs,IT,OnCell}, d::Integer) where {T,N,TCoefs,IT} =
49-
first(indices(itp, d)) - 0.5
49+
first(axes(itp, d)) - 0.5
5050
ubound(itp::BSplineInterpolation{T,N,TCoefs,IT,OnCell}, d::Integer) where {T,N,TCoefs,IT} =
51-
last(indices(itp, d))+0.5
51+
last(axes(itp, d))+0.5
5252

5353
lbound(itp::BSplineInterpolation{T,N,TCoefs,IT,OnGrid}, d, inds) where {T,N,TCoefs,IT} =
5454
first(inds)
@@ -65,11 +65,11 @@ function size(itp::BSplineInterpolation{T,N,TCoefs,IT,GT,pad}, d) where {T,N,TCo
6565
d <= N ? size(itp.coefs, d) - 2*padextract(pad, d) : 1
6666
end
6767

68-
@inline indices(itp::BSplineInterpolation{T,N,TCoefs,IT,GT,pad}) where {T,N,TCoefs,IT,GT,pad} =
69-
indices_removepad.(indices(itp.coefs), pad)
68+
@inline axes(itp::BSplineInterpolation{T,N,TCoefs,IT,GT,pad}) where {T,N,TCoefs,IT,GT,pad} =
69+
indices_removepad.(axes(itp.coefs), pad)
7070

71-
function indices(itp::BSplineInterpolation{T,N,TCoefs,IT,GT,pad}, d) where {T,N,TCoefs,IT,GT,pad}
72-
d <= N ? indices_removepad(indices(itp.coefs, d), padextract(pad, d)) : indices(itp.coefs, d)
71+
function axes(itp::BSplineInterpolation{T,N,TCoefs,IT,GT,pad}, d) where {T,N,TCoefs,IT,GT,pad}
72+
d <= N ? indices_removepad(axes(itp.coefs, d), padextract(pad, d)) : axes(itp.coefs, d)
7373
end
7474

7575
function interpolate(::Type{TWeights}, ::Type{TC}, A, it::IT, gt::GT) where {TWeights,TC,IT<:DimSpec{BSpline},GT<:DimSpec{GridType}}
@@ -109,6 +109,12 @@ offsetsym(off, d) = off == -1 ? Symbol("ixm_", d) :
109109
@inline indices_addpad(inds, pad) = oftype(inds, first(inds):last(inds) + 2*pad)
110110
@inline indices_interior(inds, pad) = first(inds)+pad:last(inds)-pad
111111

112+
@static if VERSION < v"0.7.0-DEV.3449"
113+
lut!(dl, d, du) = lufact!(Tridiagonal(dl, d, du), Val{false})
114+
else
115+
lut!(dl, d, du) = lu!(Tridiagonal(dl, d, du), Val(false))
116+
end
117+
112118
include("constant.jl")
113119
include("linear.jl")
114120
include("quadratic.jl")

src/b-splines/cubic.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int,
193193
# Now Woodbury correction to set `[1, 3], [n, n-2] ==> 1`
194194
specs = WoodburyMatrices.sparse_factors(T, n, (1, 3, oneunit(T)), (n, n-2, oneunit(T)))
195195

196-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
196+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
197197
end
198198

199199
"""
@@ -226,7 +226,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int,
226226
(n, n-3, oneunit(T))
227227
)
228228

229-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
229+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
230230
end
231231

232232
"""
@@ -255,7 +255,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int,
255255
(n, n-3, -oneunit(T))
256256
)
257257

258-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
258+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
259259
end
260260

261261
"""
@@ -277,7 +277,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int,
277277
(n, n-2, oneunit(T)),
278278
)
279279

280-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
280+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
281281
end
282282

283283
"""
@@ -297,7 +297,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int,
297297
(n, 1, dl[end])
298298
)
299299

300-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
300+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
301301
end
302302

303303
"""
@@ -316,5 +316,5 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int,
316316
(n, 1, dl[end])
317317
)
318318

319-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
319+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
320320
end

src/b-splines/indexing.jl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,21 @@ function hessian_coefficients(::Type{IT}, N, dim1, dim2) where IT<:DimSpec{BSpli
2424
Expr(:block, exs...)
2525
end
2626

27-
index_gen(::Type{IT}, N::Integer, offsets...) where {IT} = index_gen(iextract(IT, min(length(offsets)+1, N)), IT, N, offsets...)
27+
function index_gen(::Type{IT}, N::Integer, offsets...) where {IT}
28+
idx = index_gen(iextract(IT, min(length(offsets)+1, N)), IT, N, offsets...)
29+
@static if v"0.7-" VERSION < v"0.7.0-beta2.119"
30+
# this is to avoid https://github.com/JuliaLang/julia/issues/27907
31+
return convert(Union{Expr,Symbol}, idx)
32+
end
33+
return idx
34+
end
2835

2936
function getindex_impl(itp::Type{BSplineInterpolation{T,N,TCoefs,IT,GT,Pad}}) where {T,N,TCoefs,IT<:DimSpec{BSpline},GT<:DimSpec{GridType},Pad}
3037
meta = Expr(:meta, :inline)
3138
quote
3239
$meta
3340
@nexprs $N d->(x_d = xs[d])
34-
inds_itp = indices(itp)
41+
inds_itp = axes(itp)
3542

3643
# Calculate the indices of all coefficients that will be used
3744
# and define fx = x - xi in each dimension
@@ -60,7 +67,7 @@ function gradient_impl(itp::Type{BSplineInterpolation{T,N,TCoefs,IT,GT,Pad}}) wh
6067
# For each component of the gradient, alternately calculate
6168
# coefficients and set component
6269
n = count_interp_dims(IT, N)
63-
exs = Array{Expr, 1}(2n)
70+
exs = Array{Expr, 1}(undef, 2n)
6471
cntr = 0
6572
for d = 1:N
6673
if count_interp_dims(iextract(IT, d), 1) > 0
@@ -74,7 +81,7 @@ function gradient_impl(itp::Type{BSplineInterpolation{T,N,TCoefs,IT,GT,Pad}}) wh
7481
$meta
7582
length(g) == $n || throw(ArgumentError(string("The length of the provided gradient vector (", length(g), ") did not match the number of interpolating dimensions (", n, ")")))
7683
@nexprs $N d->(x_d = xs[d])
77-
inds_itp = indices(itp)
84+
inds_itp = axes(itp)
7885

7986
# Calculate the indices of all coefficients that will be used
8087
# and define fx = x - xi in each dimension
@@ -115,7 +122,7 @@ for R in [:Real, :Any]
115122
xargs = [:(xs[$d]) for d in 1:length(xs)]
116123
quote
117124
Tg = $(Expr(:call, :promote_type, T, [x <: AbstractArray ? eltype(x) : x for x in xs]...))
118-
gradient!(Array{Tg, 1}($n), itp, $(xargs...))
125+
gradient!(Array{Tg, 1}(undef, $n), itp, $(xargs...))
119126
end
120127
end
121128
end
@@ -142,7 +149,7 @@ function hessian_impl(itp::Type{BSplineInterpolation{T,N,TCoefs,IT,GT,Pad}}) whe
142149
$meta
143150
size(H) == ($n,$n) || throw(ArgumentError(string("The size of the provided Hessian matrix wasn't a square matrix of size ", size(H))))
144151
@nexprs $N d->(x_d = xs[d])
145-
inds_itp = indices(itp)
152+
inds_itp = axes(itp)
146153

147154
$(define_indices(IT, N, Pad))
148155

@@ -167,7 +174,7 @@ end
167174
xargs = [:(xs[$d]) for d in 1:length(xs)]
168175
quote
169176
TH = $(Expr(:call, :promote_type, T, [x <: AbstractArray ? eltype(x) : x for x in xs]...))
170-
hessian!(Array{TH, 2}($n,$n), itp, $(xargs...))
177+
hessian!(Array{TH, 2}(undef, $n,$n), itp, $(xargs...))
171178
end
172179
end
173180

src/b-splines/prefiltering.jl

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,45 @@ padding(::Type{IT}) where {IT<:BSpline} = Val{0}()
77
end
88

99
@noinline function padded_index(indsA::NTuple{N,AbstractUnitRange{Int}}, ::Val{pad}) where {N,pad}
10-
indspad = ntuple(i->indices_addpad(indsA[i], padextract(pad,i)), Val{N})
11-
indscp = ntuple(i->indices_interior(indspad[i], padextract(pad,i)), Val{N})
10+
@static if VERSION < v"0.7.0-DEV.843"
11+
indspad = ntuple(i->indices_addpad(indsA[i], padextract(pad,i)), Val{N})
12+
indscp = ntuple(i->indices_interior(indspad[i], padextract(pad,i)), Val{N})
13+
else
14+
indspad = ntuple(i->indices_addpad(indsA[i], padextract(pad,i)), Val(N))
15+
indscp = ntuple(i->indices_interior(indspad[i], padextract(pad,i)), Val(N))
16+
end
1217
indscp, indspad
1318
end
1419

20+
padded_similar(::Type{TC}, inds::Tuple{Vararg{Base.OneTo{Int}}}) where TC = Array{TC}(undef, length.(inds))
21+
padded_similar(::Type{TC}, inds) where TC = OffsetArray{TC}(undef, inds)
22+
23+
# despite Compat, julia doesn't support 0.6 copy! with CartesianIndices argument
24+
@static if isdefined(Base, :CartesianIndices)
25+
ct!(coefs, indscp, A, indsA) = copyto!(coefs, CartesianIndices(indscp), A, CartesianIndices(indsA))
26+
else
27+
ct!(coefs, indscp, A, indsA) = copyto!(coefs, CartesianRange(indscp), A, CartesianRange(indsA))
28+
end
29+
1530
copy_with_padding(A, ::Type{IT}) where {IT} = copy_with_padding(eltype(A), A, IT)
1631
function copy_with_padding(::Type{TC}, A, ::Type{IT}) where {TC,IT<:DimSpec{InterpolationType}}
1732
Pad = padding(IT)
18-
indsA = indices(A)
33+
indsA = axes(A)
1934
indscp, indspad = padded_index(indsA, Pad)
20-
coefs = similar(dims->Array{TC}(dims), indspad)
35+
coefs = padded_similar(TC, indspad)
2136
if indspad == indsA
22-
coefs = copy!(coefs, A)
37+
coefs = copyto!(coefs, A)
2338
else
2439
fill!(coefs, zero(TC))
25-
copy!(coefs, CartesianRange(indscp), A, CartesianRange(indsA))
40+
ct!(coefs, indscp, A, indsA)
2641
end
2742
coefs, Pad
2843
end
2944

3045
prefilter!(::Type{TWeights}, A, ::Type{IT}, ::Type{GT}) where {TWeights, IT<:BSpline, GT<:GridType} = A
3146
function prefilter(::Type{TWeights}, ::Type{TC}, A, ::Type{IT}, ::Type{GT}) where {TWeights, TC, IT<:BSpline, GT<:GridType}
32-
coefs = similar(dims->Array{TC}(dims), indices(A))
33-
prefilter!(TWeights, copy!(coefs, A), IT, GT), Val{0}()
47+
coefs = padded_similar(TC, axes(A))
48+
prefilter!(TWeights, copyto!(coefs, A), IT, GT), Val{0}()
3449
end
3550

3651
function prefilter(
@@ -51,7 +66,7 @@ function prefilter!(
5166
::Type{TWeights}, ret::TCoefs, ::Type{BSpline{IT}}, ::Type{GT}
5267
) where {TWeights,TCoefs<:AbstractArray,IT<:Union{Quadratic,Cubic},GT<:GridType}
5368
local buf, shape, retrs
54-
sz = map(length, indices(ret))
69+
sz = map(length, axes(ret))
5570
first = true
5671
for dim in 1:ndims(ret)
5772
M, b = prefiltering_system(TWeights, eltype(TCoefs), sz[dim], IT, GT)

src/b-splines/quadratic.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int, ::Type{Quadratic{BC}
162162
dl,d,du = inner_system_diags(T,n,Quadratic{BC})
163163
d[1] = d[end] = -1
164164
du[1] = dl[end] = 1
165-
lufact!(Tridiagonal(dl, d, du), Val{false}), zeros(TC, n)
165+
lut!(dl, d, du), zeros(TC, n)
166166
end
167167

168168
function prefiltering_system(::Type{T}, ::Type{TC}, n::Int, ::Type{Quadratic{InPlace}}, ::Type{OnCell}) where {T,TC}
169169
dl,d,du = inner_system_diags(T,n,Quadratic{InPlace})
170170
d[1] = d[end] = convert(T, SimpleRatio(7,8))
171-
lufact!(Tridiagonal(dl, d, du), Val{false}), zeros(TC, n)
171+
lut!(dl, d, du), zeros(TC, n)
172172
end
173173

174174
# InPlaceQ continues the quadratic at 2 all the way down to 1 (rather than 1.5)
@@ -183,7 +183,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int, ::Type{Quadratic{InP
183183
valspec[1,1] = valspec[2,2] = SimpleRatio(1,8)
184184
rowspec[1,1] = rowspec[n,2] = 1
185185
colspec[1,3] = colspec[2,n-2] = 1
186-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), rowspec, valspec, colspec), zeros(TC, n)
186+
Woodbury(lut!(dl, d, du), rowspec, valspec, colspec), zeros(TC, n)
187187
end
188188

189189
"""
@@ -202,7 +202,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int, ::Type{Quadratic{BC}
202202
(n, n-2, oneunit(T))
203203
)
204204

205-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
205+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
206206
end
207207

208208
"""
@@ -222,7 +222,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int, ::Type{Quadratic{Lin
222222
(n, n-2, oneunit(T)),
223223
)
224224

225-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
225+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
226226
end
227227

228228
"""
@@ -243,7 +243,7 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int, ::Type{Quadratic{Fre
243243
(n, n-2, 3),
244244
(n, n-3, -1))
245245

246-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
246+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
247247
end
248248

249249
"""
@@ -262,5 +262,5 @@ function prefiltering_system(::Type{T}, ::Type{TC}, n::Int, ::Type{Quadratic{Per
262262
(n, 1, dl[end])
263263
)
264264

265-
Woodbury(lufact!(Tridiagonal(dl, d, du), Val{false}), specs...), zeros(TC, n)
265+
Woodbury(lut!(dl, d, du), specs...), zeros(TC, n)
266266
end

src/convenience-constructors.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# convenience copnstructors for linear / cubic spline interpolations
22
# 1D version
3-
LinearInterpolation(range::T, vs; extrapolation_bc = Interpolations.Throw()) where {T <: Range} = extrapolate(scale(interpolate(vs, BSpline(Linear()), OnGrid()), range), extrapolation_bc)
3+
LinearInterpolation(range::T, vs; extrapolation_bc = Interpolations.Throw()) where {T <: AbstractRange} = extrapolate(scale(interpolate(vs, BSpline(Linear()), OnGrid()), range), extrapolation_bc)
44
LinearInterpolation(range::T, vs; extrapolation_bc = Interpolations.Throw()) where {T <: AbstractArray} = extrapolate(interpolate((range, ), vs, Gridded(Linear())), extrapolation_bc)
5-
CubicSplineInterpolation(range::T, vs; bc = Interpolations.Line(), extrapolation_bc = Interpolations.Throw()) where {T <: Range} = extrapolate(scale(interpolate(vs, BSpline(Cubic(bc)), OnGrid()), range), extrapolation_bc)
5+
CubicSplineInterpolation(range::T, vs; bc = Interpolations.Line(), extrapolation_bc = Interpolations.Throw()) where {T <: AbstractRange} = extrapolate(scale(interpolate(vs, BSpline(Cubic(bc)), OnGrid()), range), extrapolation_bc)
66

77
# multivariate versions
8-
LinearInterpolation(ranges::NTuple{N,T}, vs; extrapolation_bc = Interpolations.Throw()) where {N,T <: Range} = extrapolate(scale(interpolate(vs, BSpline(Linear()), OnGrid()), ranges...), extrapolation_bc)
8+
LinearInterpolation(ranges::NTuple{N,T}, vs; extrapolation_bc = Interpolations.Throw()) where {N,T <: AbstractRange} = extrapolate(scale(interpolate(vs, BSpline(Linear()), OnGrid()), ranges...), extrapolation_bc)
99
LinearInterpolation(ranges::NTuple{N,T}, vs; extrapolation_bc = Interpolations.Throw()) where {N,T <: AbstractArray} = extrapolate(interpolate(ranges, vs, Gridded(Linear())), extrapolation_bc)
10-
CubicSplineInterpolation(ranges::NTuple{N,T}, vs; bc = Interpolations.Line(), extrapolation_bc = Interpolations.Throw()) where {N,T <: Range} = extrapolate(scale(interpolate(vs, BSpline(Cubic(bc)), OnGrid()), ranges...), extrapolation_bc)
10+
CubicSplineInterpolation(ranges::NTuple{N,T}, vs; bc = Interpolations.Line(), extrapolation_bc = Interpolations.Throw()) where {N,T <: AbstractRange} = extrapolate(scale(interpolate(vs, BSpline(Cubic(bc)), OnGrid()), ranges...), extrapolation_bc)

0 commit comments

Comments
 (0)