Skip to content

Commit 3d4cc19

Browse files
authored
Compatibility with Interpolations ≥ 0.14.3 (#46)
* Edit compat for Interpolations * Use snake_case constructors of Interpolations
1 parent 540b6c4 commit 3d4cc19

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name = "NumericalIntegration"
22
uuid = "e7bfaba1-d571-5449-8927-abc22e82249b"
33
authors = ["dextorious"]
4-
version = "0.3.3"
4+
version = "0.3.4"
55

66
[deps]
77
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
88
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
99
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1010

1111
[compat]
12-
Interpolations = "0.13"
1312
julia = "0.7, 1"
13+
Interpolations = "≥ 0.14.3"
1414

1515
[extras]
1616
HCubature = "19dc6840-f33b-545b-b366-655c7e3ffd49"

src/NumericalIntegration.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function integrate(X::NTuple{N,AbstractVector}, Y::AbstractArray{T,N}, ::Trapezo
207207
midpnts = map(_midpoints, X)
208208
Δ(x::AbstractVector) = length(x) > 1 ? diff(x) : 1
209209
Δxs = map(Δ, X)
210-
interp = LinearInterpolation(X,Y)
210+
interp = linear_interpolation(X,Y)
211211
f((Δx,x)) = prod(Δx)*interp(x...)
212212
return sum(f, zip(product(Δxs...), product(midpnts...)))
213213
end
@@ -216,7 +216,7 @@ function integrate(X::NTuple{N,AbstractVector}, Y::AbstractArray{T,N}, ::Trapezo
216216
midpnts = map(_midpoints, X)
217217
Δ(x::AbstractVector) = length(x) > 1 ? x[2] - x[1] : 1
218218
Δx = prod(Δ, X)
219-
interp = LinearInterpolation(X,Y)
219+
interp = linear_interpolation(X,Y)
220220
f(x) = interp(x...)
221221
return Δx*sum(f, product(midpnts...))
222222
end
@@ -225,7 +225,7 @@ function integrate(X::NTuple{N,AbstractRange}, Y::AbstractArray{T,N}, ::Trapezoi
225225
midpnts = map(_midpoints, X)
226226
Δ(x::AbstractVector) = length(x) > 1 ? step(x) : 1
227227
Δx = prod(Δ, X)
228-
interp = LinearInterpolation(X,Y)
228+
interp = linear_interpolation(X,Y)
229229
f(x) = interp(x...)
230230
return Δx*sum(f, product(midpnts...))
231231
end

0 commit comments

Comments
 (0)