Skip to content

Commit b3a3379

Browse files
committed
(fix): Hermite allocating batch — include dy eltype in output type inference
hermite_interp(x, y, dy, x_query) ignored eltype(dy) when computing the output vector element type. When dy carries Dual (ForwardDiff AD on slopes), the kernel returns Dual but output was Vector{Float64} → MethodError on setindex!. Fix: add eltype(dy) to _output_eltype(...) promote chain.
1 parent abfba37 commit b3a3379

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hermite/hermite_oneshot.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function hermite_interp(
8888
search::AbstractSearchPolicy = AutoSearch(),
8989
hint::Union{Nothing, Base.RefValue{Int}} = nothing,
9090
) where {Tg, Tv, Tq <: Real}
91-
Tr = _output_eltype(Tv, _promote_grid_float(Tg, Tv), Tq)
91+
Tr = _output_eltype(Tv, _promote_grid_float(Tg, Tv), Tq, eltype(dy))
9292
output = Vector{Tr}(undef, length(x_query))
9393
hermite_interp!(output, x, y, dy, x_query; extrap = extrap, deriv = deriv, search = search, hint = hint)
9494
return output

0 commit comments

Comments
 (0)