Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/FDM.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__precompile__()

module FDM
include("methods.jl")
include("numerics.jl")
Expand Down
4 changes: 2 additions & 2 deletions src/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down