Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when integrating with cache_parameters = true #390

Closed
SouthEndMusic opened this issue Feb 6, 2025 · 1 comment · Fixed by #391
Closed

Error when integrating with cache_parameters = true #390

SouthEndMusic opened this issue Feb 6, 2025 · 1 comment · Fixed by #391
Labels
bug Something isn't working

Comments

@SouthEndMusic
Copy link
Member

Describe the bug 🐞

When integrating it seems any interpolation type which was defined with cache_parameters = true, in some cases the computation fails with an attempt to evaluate the cached integral vector at index 0.

Expected behavior

Integration without error 😋

Minimal Reproducible Example 👇

using DataInterpolations

A = LinearInterpolation([1.0, 2.0], [1.0, 2.0]; cache_parameters=true, extrapolation=ExtrapolationType.Extension)
DataInterpolations.integral(A, 0, 1.5)

Error & Stacktrace ⚠️

oundsError: attempt to access 1-element Vector{Float64} at index [0]
Stacktrace:
 [1] getindex
   @ .\essentials.jl:13 [inlined]
 [2] integral(A::LinearInterpolation{Vector{…}, Vector{…}, Vector{…}, Vector{…}, Float64, (1,)}, t1::Int64, t2::Float64)
   @ DataInterpolations c:\Users\konin_bt\Repositories\SciML\DataInterpolations.jl\src\integrals.jl:55
@SouthEndMusic
Copy link
Member Author

So it occurs when idx2 = 1 which means that no complete interval between data points is in the integration interval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant