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

Gradients of 3D extrapolations not working. #202

Closed
natschil opened this issue Apr 9, 2018 · 1 comment · Fixed by #226
Closed

Gradients of 3D extrapolations not working. #202

natschil opened this issue Apr 9, 2018 · 1 comment · Fixed by #226

Comments

@natschil
Copy link

natschil commented Apr 9, 2018

The following minimal working example fails for me very cryptically:

using Interpolations

xs = 1:10
itp = Interpolations.scale(Interpolations.interpolate(zeros(10),BSpline(Cubic(Periodic())), OnGrid()),xs)
extp = Interpolations.extrapolate(itp,Periodic())
gradient(extp,2.,2.)

I get an error beginning with

ERROR: LoadError: UndefVarError: d not defined

Do extrapolation objects support computing gradients?

@tomasaschan
Copy link
Contributor

Extrapolation objects should, but I'm not sure how well-tested the implementation is for the combination of extrapolation and >1D.

For reference, here's the full stack trace:

UndefVarError: d not defined

Stacktrace:
 [1] macro expansion at /home/jrun/.julia/v0.6/Interpolations/src/extrapolation/periodic.jl:23 [inlined]
 [2] macro expansion at /home/jrun/.julia/v0.6/Interpolations/src/extrapolation/extrap_prep_gradient.jl:49 [inlined]
 [3] macro expansion at /home/jrun/.julia/v0.6/Interpolations/src/extrapolation/extrapolation.jl:74 [inlined]
 [4] gradient! at /home/jrun/.julia/v0.6/Interpolations/src/extrapolation/extrapolation.jl:81 [inlined]
 [5] gradient(::Interpolations.Extrapolation{Float64,1,Interpolations.ScaledInterpolation{Float64,1,Interpolations.BSplineInterpolation{Float64,1,Array{Float64,1},Interpolations.BSpline{Interpolations.Cubic{Interpolations.Periodic}},Interpolations.OnGrid,0},Interpolations.BSpline{Interpolations.Cubic{Interpolations.Periodic}},Interpolations.OnGrid,Tuple{UnitRange{Int64}}},Interpolations.BSpline{Interpolations.Cubic{Interpolations.Periodic}},Interpolations.OnGrid,Interpolations.Periodic}, ::Float64, ::Float64) at /home/jrun/.julia/v0.6/Interpolations/src/b-splines/indexing.jl:110

@timholy timholy mentioned this issue Sep 10, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants