Skip to content

Copy! in interpolation does not take into account scalars #903

@bertini97

Description

@bertini97

Describe the bug 🐞

> a = LinearInterpolation([1.0, 2.0], [1.0, 2.0])
LinearInterpolation{Vector{Float64}, Vector{Float64}}([1.0, 2.0], [1.0, 2.0], false)

> b = [1.0]
1-element Vector{Float64}:
 1.0

> a(b, 1.1)
1-element Vector{Float64}:
 1.1

> a(b, 1.0)
ERROR: MethodError: no method matching copy!(::Vector{Float64}, ::Float64)

This is because of the copy! when the tval is the first one:

copy!(out, u[k])

Expected behavior
Expected behavior is that it should be interpolated properly. I don't know if this is intended. It doesn't look like it to me. Cheers.

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