You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interpolating a smoothing B-spline on parametric data errors.
Expected behavior
I had expected it to work just as interpolating a parametric data set works for non smoothing interpolation.
Minimal Reproducible Example 👇
using StaticArrays, DataInterpolations
n =10
t =Float64.(1:n)
u =rand(SVector{2, Float64}, n)
LinearInterpolation(u, t) # works!BSplineApprox(u, t, 2, 3, :Uniform, :Uniform) # errors!
Error & Stacktrace ⚠️
ERROR: MethodError: no method matching ^(::SVector{2, Float64}, ::Int64)
The function`^` exists, but no method is defined for this combination of argument types.
Closest candidates are:^(::Irrational{:ℯ}, ::Integer)
@ Base mathconstants.jl:139^(::ForwardDiff.Dual{Tx}, ::Integer) where Tx
@ ForwardDiff ~/.julia/packages/ForwardDiff/UBbGT/src/dual.jl:148^(::Float32, ::Integer)
@ Base math.jl:1228...
Stacktrace:
[1] literal_pow
@ ./intfuncs.jl:389 [inlined]
[2] BSplineApprox(u::Vector{…}, t::Vector{…}, d::Int64, h::Int64, pVecType::Symbol, knotVecType::Symbol; extrapolation::DataInterpolations.ExtrapolationType.T, extrapolation_left::DataInterpolations.ExtrapolationType.T, extrapolation_right::DataInterpolations.ExtrapolationType.T, assume_linear_t::Float64)
@ DataInterpolations ~/.julia/packages/DataInterpolations/r3oVa/src/interpolation_caches.jl:989
[3] BSplineApprox(u::Vector{SVector{2, Float64}}, t::Vector{Float64}, d::Int64, h::Int64, pVecType::Symbol, knotVecType::Symbol)
@ DataInterpolations ~/.julia/packages/DataInterpolations/r3oVa/src/interpolation_caches.jl:971
[4] top-level scope
@ REPL[13]:1
Some type information was truncated. Use `show(err)` to see complete types.
Environment (please complete the following information):
Output of using Pkg; Pkg.status()
Status `/tmp/jl_HwR3uf/Project.toml`
[82cc6244] DataInterpolations v7.2.0
[90137ffa] StaticArrays v1.9.12
Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
Interesting. As far as I'm aware, we treat the elements of u as vectors (in the mathematical sense), i.e. we only assume that addition and scalar multiplication are defined for these elements. Here that's not the case. The erroring expression can probably be replaced by norm(u[i] - u[i - 1])^2.
Describe the bug 🐞
Interpolating a smoothing B-spline on parametric data errors.
Expected behavior
I had expected it to work just as interpolating a parametric data set works for non smoothing interpolation.
Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
None.
The text was updated successfully, but these errors were encountered: