diff --git a/src/FDM.jl b/src/FDM.jl index 404134bc..f6fe352e 100644 --- a/src/FDM.jl +++ b/src/FDM.jl @@ -1,3 +1,5 @@ +__precompile__() + module FDM include("methods.jl") include("numerics.jl") diff --git a/src/methods.jl b/src/methods.jl index 98632425..33f8f1ba 100644 --- a/src/methods.jl +++ b/src/methods.jl @@ -47,7 +47,7 @@ end report::Bool=false ) -Construct a function `method(f::Function, x::Real, h::Real=ĥ)` that takes in a +Construct a function `method(f, x::Real, h::Real=ĥ)` that takes in a function `f`, a point `x` in the domain of `f`, and optionally a step size `h`, and estimates the `q`'th order derivative of `f` at `x` with a `length(grid)`'th order finite difference method. @@ -97,7 +97,7 @@ function fdm( acc = ĥ^(-q) * C₁ + ĥ^(p - q) * C₂ # Construct the FDM. - method(f::Function, x::Real=0, h::Real=ĥ) = sum(coefs .* f.(x .+ h .* grid)) / h^q + method(f, x::Real=0, h::Real=ĥ) = sum(coefs .* f.(x .+ h .* grid)) / h^q # If asked for, also return information. return report ? (method, FDMReport(p, q, grid, coefs, ε, M, ĥ, acc)) : method