JuliaMath / JuliaMath/Interpolations.jl
Reuse weights with extrapolation
- Dominant language
- Julia
- Stars
- 575
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
I'm finding the [documentation on how to reuse weights](http://juliamath.github.io/Interpolations.jl/latest/devdocs/#Interpolant-usage) quite difficult to comprehend. But I would like to compute weights for an extrapolant/interpolant. My best attempt at replicating the code in the documentation but with my own interpolation object (below) results in a `MethodError`.
```julia-repl
julia> using Interpolations
julia> x = collect(range(0.1, 0.9, 100));
julia> v = 2x;
julia> itp = LinearInterpolation(x, v; extrapolation_bc=((Flat(), Line()),));
julia> itp(0.5) # Works just fine :)
1.0
julia> wis = Interpolations.weightedindexes((Interpolations.value_weights,), Interpolations.itpinfo(itp)..., 0.5);
ERROR: MethodError: no method matching weightedindexes(::Tuple{typeof(Interpolations.value_weights)}, ::Tuple{Gridded{Linear{Throw{OnGrid}}}}, ::Tuple{Base.OneTo{Int64}}, ::Float64)
Closest candidates are:
weightedindexes(::F, ::Tuple{Vararg{Interpolations.Flag, N}}, ::Tuple{Vararg{AbstractVector, N}}, ::Tuple{Vararg{Number, N}}) where {F, N} at C:\...\.julia\packages\Interpolations\Glp9h\src\b-splines\indexing.jl:64
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.