Skip to content

Commit

Permalink
interpolation example now working, sorted out Project.toml issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fintzij committed Jul 4, 2024
1 parent f4e8831 commit 19040a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "0.17.3"
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
3 changes: 2 additions & 1 deletion src/BSplineKit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ module BSplineKit

using Reexport
using PrecompileTools
using LinearAlgebra: LinearAlgebra # needed for docs
using LinearAlgebra: LinearAlgebra
using ForwardDiff # needed for docs

include("BandedTensors/BandedTensors.jl")
@reexport using .BandedTensors
Expand Down
7 changes: 3 additions & 4 deletions src/SplineExtrapolations/SplineExtrapolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ struct Linear <: AbstractExtrapolationMethod end
function extrapolate_at_point(::Linear, S::Spline, x)
a, b = boundaries(basis(S))
if x < a
slope = (S(a + eps()) - S(a)) / eps()
slope = ForwardDiff.derivative(S, a)
S(a) + slope * (x - a)
elseif x > b
slope = (S(b) - S(b - eps())) / eps()
slope = ForwardDiff.derivative(S, b)
S(b) + slope * (x - b)
else
x′ = clamp(x, a, b)
S(x′)
S(x)
end
end

Expand Down

0 comments on commit 19040a6

Please sign in to comment.