@@ -48,10 +48,10 @@ mutable struct History
48
48
end
49
49
50
50
"""
51
- FiniteDifferencesethod
51
+ FiniteDifferenceMethod
52
52
53
53
Abstract type for all finite differencing method types.
54
- Subtypes of `FiniteDifferencesethod ` are callable with the signature
54
+ Subtypes of `FiniteDifferenceMethod ` are callable with the signature
55
55
56
56
```
57
57
method(f, x; kwargs...)
@@ -64,10 +64,10 @@ where the keyword arguments can be any of
64
64
* `condition`: The condition number. See [`DEFAULT_CONDITION`](@ref).
65
65
* `eps`: The assumed roundoff error. Defaults to `eps()` plus [`TINY`](@ref).
66
66
"""
67
- abstract type FiniteDifferencesethod end
67
+ abstract type FiniteDifferenceMethod end
68
68
69
- function Base. show (io:: IO , x:: FiniteDifferencesethod )
70
- @printf io " FiniteDifferencesethod :\n "
69
+ function Base. show (io:: IO , x:: FiniteDifferenceMethod )
70
+ @printf io " FiniteDifferenceMethod :\n "
71
71
@printf io " order of method: %d\n " x. p
72
72
@printf io " order of derivative: %d\n " x. q
73
73
@printf io " grid: %s\n " x. grid
83
83
84
84
for D in (:Forward , :Backward , :Central , :Nonstandard )
85
85
@eval begin
86
- struct $ D{G<: AbstractVector , C<: AbstractVector } <: FiniteDifferencesethod
86
+ struct $ D{G<: AbstractVector , C<: AbstractVector } <: FiniteDifferenceMethod
87
87
p:: Int
88
88
q:: Int
89
89
grid:: G
@@ -121,7 +121,7 @@ for D in (:Forward, :Backward, :Central)
121
121
122
122
Construct a $($ lcname) finite difference method of order `p` to compute the `q`th
123
123
derivative.
124
- See [`FiniteDifferencesethod `](@ref) for more details.
124
+ See [`FiniteDifferenceMethod `](@ref) for more details.
125
125
"""
126
126
($ D, $ fdmf)
127
127
end
133
133
An finite differencing method which is constructed based on a user-defined grid. It is
134
134
nonstandard in the sense that it represents neither forward, backward, nor central
135
135
differencing.
136
- See [`FiniteDifferencesethod `](@ref) for further details.
136
+ See [`FiniteDifferenceMethod `](@ref) for further details.
137
137
"""
138
138
function Nonstandard (grid:: AbstractVector{<:Real} , q:: Integer ; adapt= 0 , kwargs... )
139
139
p = length (grid)
166
166
_estimate_bound (x, cond) = cond * maximum (abs, x) + TINY
167
167
168
168
"""
169
- fdm(m::FiniteDifferencesethod , f, x[, Val(false)]; kwargs...) -> Real
170
- fdm(m::FiniteDifferencesethod , f, x, Val(true); kwargs...) -> Tuple{FiniteDifferencesethod , Real}
169
+ fdm(m::FiniteDifferenceMethod , f, x[, Val(false)]; kwargs...) -> Real
170
+ fdm(m::FiniteDifferenceMethod , f, x, Val(true); kwargs...) -> Tuple{FiniteDifferenceMethod , Real}
171
171
172
172
Compute the derivative of `f` at `x` using the finite differencing method `m`.
173
173
The optional `Val` argument dictates whether the method should be returned alongside the
@@ -186,7 +186,7 @@ The recognized keywords are:
186
186
`adapt` greater than 0 when `m::Nonstandard` results in an error.
187
187
188
188
!!! note
189
- Calling [`FiniteDifferencesethod `](@ref) objects is equivalent to passing them to `fdm`.
189
+ Calling [`FiniteDifferenceMethod `](@ref) objects is equivalent to passing them to `fdm`.
190
190
191
191
# Examples
192
192
@@ -195,7 +195,7 @@ julia> fdm(central_fdm(5, 1), sin, 1; adapt=2)
195
195
0.5403023058681039
196
196
197
197
julia> fdm(central_fdm(2, 1), exp, 0, Val(true))
198
- (FiniteDifferencesethod :
198
+ (FiniteDifferenceMethod :
199
199
order of method: 2
200
200
order of derivative: 1
201
201
grid: [-1, 1]
@@ -217,7 +217,7 @@ function fdm(
217
217
eps= (Base. eps (float (bound)) + TINY),
218
218
adapt= m. history. adapt,
219
219
max_step= 0.1 ,
220
- ) where M<: FiniteDifferencesethod
220
+ ) where M<: FiniteDifferenceMethod
221
221
if M <: Nonstandard && adapt > 0
222
222
throw (ArgumentError (" can't adaptively compute bounds over Nonstandard grids" ))
223
223
end
@@ -265,7 +265,7 @@ function fdm(
265
265
return m, dfdx
266
266
end
267
267
268
- function fdm (m:: FiniteDifferencesethod , f, x, :: Val{false} = Val (false ); kwargs... )
268
+ function fdm (m:: FiniteDifferenceMethod , f, x, :: Val{false} = Val (false ); kwargs... )
269
269
_, dfdx = fdm (m, f, x, Val (true ); kwargs... )
270
270
return dfdx
271
271
end
0 commit comments