Skip to content

Commit

Permalink
Add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Nov 25, 2024
1 parent 80edc15 commit ec4c113
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/interpolation_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,29 @@ function ConstantInterpolation(
ConstantInterpolation(u, t, I, dir, extrapolate, cache_parameters, assume_linear_t)
end

"""
SmoothedConstantInterpolation(u, t; d_max = Inf, extrapolate = false,
cache_parameters = false, assume_linear_t = 1e-2)
It is a method for interpolating constantly with forward fill, with smoothing around the
value transitions to make the curve C1 smooth while the integral never drifts far from
the integral of constant interpolation.
## Arguments
- `u`: data points.
- `t`: time points.
## Keyword Arguments
- `d_max`: the maximum distance in `t` from the data points the smoothing is allowed to reach.
- `extrapolate`: boolean value to allow extrapolation. Defaults to `false`.
- `cache_parameters`: precompute parameters at initialization for faster interpolation computations. Note: if activated, `u` and `t` should not be modified. Defaults to `false`.
- `assume_linear_t`: boolean value to specify a faster index lookup behaviour for
evenly-distributed abscissae. Alternatively, a numerical threshold may be specified
for a test based on the normalized standard deviation of the difference with respect
to the straight line (see [`looks_linear`](@ref)). Defaults to 1e-2.
"""
struct SmoothedConstantInterpolation{uType, tType, dmaxType, IType, pType, T, N} <:
AbstractInterpolation{T, N}
u::uType
Expand Down

0 comments on commit ec4c113

Please sign in to comment.