@@ -447,29 +447,13 @@ maybe_clamp(itp, xs) = maybe_clamp(BoundsCheckStyle(itp), itp, xs)
447447maybe_clamp (:: NeedsCheck , itp, xs) = map (clamp, xs, lbounds (itp), ubounds (itp))
448448maybe_clamp (:: CheckWillPass , itp, xs) = xs
449449
450- using ForwardDiff
451- # TODO
452- function maybe_clamp (:: NeedsCheck , itp, xs:: Tuple{Vararg{ForwardDiff.Dual}} )
453- xs_values = just_dual_value .(xs)
454- clamped_vals = maybe_clamp (NeedsCheck (), itp, xs_values)
455- apply_partials .(xs, clamped_vals)
456- end
450+ # this strips arbitrary layers of ForwardDiff.Dual, returning the innermost value
451+ # it's other methods are defined in InterpolationsForwardDiffExt.jl
452+ just_dual_value (x:: Number ) = x
457453
458454Base. hash (x:: AbstractInterpolation , h:: UInt ) = Base. hash_uint (3 h - objectid (x))
459455Base. hash (x:: AbstractExtrapolation , h:: UInt ) = Base. hash_uint (3 h - objectid (x))
460456
461- # TODO use this, and define a method in a ForwardDiff package extension
462- # stip off arbitrary layers of ForwardDiff.Dual, returning the innermost value
463- just_dual_value (x:: Number ) = x
464- just_dual_value (x:: ForwardDiff.Dual ) = just_dual_value (ForwardDiff. value (x))
465-
466- # apply partials from arbitrarily nested ForwardDiff.Dual to a value
467- function apply_partials (x_dual:: D , val:: Number ) where D <: ForwardDiff.Dual
468- ∂s = ForwardDiff. partials (x_dual)
469- apply_partials (ForwardDiff. value (x_dual), D (val, ∂s))
470- end
471- apply_partials (x_dual:: Number , val:: Number ) = val
472-
473457include (" nointerp/nointerp.jl" )
474458include (" b-splines/b-splines.jl" )
475459include (" gridded/gridded.jl" )
0 commit comments