Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ext/DataInterpolationsMakieExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ function Makie.convert_arguments(
plotdensity = 10_000,
denseplot = true
)
densex, densey = convert_arguments(
densex,
densey = convert_arguments(
Makie.PointBased(), A; plotdensity = plotdensity, denseplot = denseplot)
return [
Makie.SpecApi.Lines(densex, densey),
Expand Down
8 changes: 2 additions & 6 deletions ext/DataInterpolationsSparseConnectivityTracerExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ using DataInterpolations:
CubicHermiteSpline,
# PCHIPInterpolation,
QuinticHermiteSpline,
output_size
output_size#===========##===========#

#===========#
# Utilities #
#===========#

# Limit support to `u` begin an AbstractVector{<:Number} or AbstractMatrix{<:Number},
# to avoid any cases where the output size is dependent on the input value.
Expand Down Expand Up @@ -67,11 +65,9 @@ function _sct_interpolate(
t = hessian_tracer_1_to_1(t, is_der_1_zero, is_der_2_zero)
N = only(output_size(interp))
return Fill(t, N)
end
end#===========##===========#

#===========#
# Overloads #
#===========#

# We assume that with the exception of ConstantInterpolation and LinearInterpolation,
# all interpolations have a non-zero second derivative at some point in the input domain.
Expand Down
4 changes: 2 additions & 2 deletions src/interpolation_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1220,8 +1220,8 @@ function BSplineApprox(
end
for k in 2:(n - 1)
q[ax_u...,
k] = u[ax_u..., k] - sc[k, 1] * u[ax_u..., 1] -
sc[k, h] * u[ax_u..., end]
k] = u[ax_u..., k] - sc[k, 1] * u[ax_u..., 1] -
sc[k, h] * u[ax_u..., end]
end
Q = Array{T, N}(undef, size(u)[1:(end - 1)]..., h - 2)
for i in 2:(h - 1)
Expand Down
3 changes: 2 additions & 1 deletion src/interpolation_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ function cumulative_integral(A::AbstractInterpolation{<:Number}, cache_parameter
Base.require_one_based_indexing(A.u)
idxs = cache_parameters ? (1:(length(A.t) - 1)) : (1:0)
return cumsum(_integral(A, idx, t1, t2)
for (idx, t1, t2) in zip(idxs, @view(A.t[begin:(end - 1)]), @view(A.t[(begin + 1):end])))
for (idx, t1, t2) in
zip(idxs, @view(A.t[begin:(end - 1)]), @view(A.t[(begin + 1):end])))
end

function get_parameters(A::LinearInterpolation, idx)
Expand Down
2 changes: 2 additions & 0 deletions test/interpolation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,7 @@ end
ut1 = Float32[0.1, 0.2, 0.3, 0.4, 0.5]
ut2 = Float64[0.1, 0.2, 0.3, 0.4, 0.5]
for u in (ut1, ut2), t in (ut1, ut2)

interp = @inferred(LinearInterpolation(ut1, ut2))
for xs in (u, t)
ys = @inferred(interp(xs))
Expand Down Expand Up @@ -1109,6 +1110,7 @@ f_cubic_spline = c -> square(CubicSpline, c)
iszero_allocations(u, t) = iszero(@allocated(DataInterpolations.munge_data(u, t)))

for T in (String, Union{String, Missing}), dims in 1:3

_u0 = convert(Array{T}, reshape(u0, ntuple(i -> i == dims ? 3 : 1, dims)))

u, t = @inferred(DataInterpolations.munge_data(_u0, t0))
Expand Down
Loading