-
-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Description
I'm not sure if integer interpolation is something intended to be supported by the package; i.e. for integer u
, you can define a ConstantInterpolation
- other interpolations get you a non-integer by definition. If so, this is broken as of 7.0.1
julia> itp = ConstantInterpolation([1, 2], [0.0, 10.0]; extrapolation_right=ExtrapolationType.Constant)
ConstantInterpolation with 2 points, in left direction
┌──────┬─────┐
│ time │ u │
├──────┼─────┤
│ 0.0 │ 1.0 │
│ 10.0 │ 2.0 │
└──────┴─────┘
julia> itp(5.0)
1
julia> itp(15.0)
2.0
The reason is that the extrapolation code path (
elseif extrapolation_left == ExtrapolationType.Constant |
elseif extrapolation_right == ExtrapolationType.Constant
slope = derivative(A, last(A.t))
last(A.u) + zero(slope * t)
where both terms inside the zero(_)
call turn into floats. Is there any drawback to just returning last(A.u)
in that branch? Obviously this is fairly niche usage, but maybe there's other legitimate type combinations where analogous issues happen.
Metadata
Metadata
Assignees
Labels
No labels