Skip to content

Error when integrating with cache_parameters = trueΒ #390

@SouthEndMusic

Description

@SouthEndMusic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions