Skip to content

Commit

Permalink
Remove hardcoded Float64s in AkimaInterpolation
Browse files Browse the repository at this point in the history
Just doing this from my phone to see if that's it. Missing tests and such, if someone can help that would be great.
  • Loading branch information
ChrisRackauckas authored Jan 28, 2025
1 parent ecad6a6 commit d1cde0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/interpolation_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,16 @@ function AkimaInterpolation(
m[end - 1] = 2m[end - 2] - m[end - 3]
m[end] = 2m[end - 1] - m[end - 2]

b = 0.5 .* (m[4:end] .+ m[1:(end - 3)])
b = (m[4:end] .+ m[1:(end - 3)]) ./ 2
dm = abs.(diff(m))
f1 = dm[3:(n + 2)]
f2 = dm[1:n]
f12 = f1 + f2
ind = findall(f12 .> 1e-9 * maximum(f12))
b[ind] = (f1[ind] .* m[ind .+ 1] .+
f2[ind] .* m[ind .+ 2]) ./ f12[ind]
c = (3.0 .* m[3:(end - 2)] .- 2.0 .* b[1:(end - 1)] .- b[2:end]) ./ dt
d = (b[1:(end - 1)] .+ b[2:end] .- 2.0 .* m[3:(end - 2)]) ./ dt .^ 2
c = (3 .* m[3:(end - 2)] .- 2 .* b[1:(end - 1)] .- b[2:end]) ./ dt
d = (b[1:(end - 1)] .+ b[2:end] .- 2 .* m[3:(end - 2)]) ./ dt .^ 2

A = AkimaInterpolation(
u, t, nothing, b, c, d, extrapolation_left,
Expand Down

0 comments on commit d1cde0a

Please sign in to comment.