File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 55 interpolate!,
66 extrapolate,
77 scale,
8+ bounds,
89
910 AbstractInterpolation,
1011 AbstractExtrapolation,
@@ -107,6 +108,28 @@ axes(exp::AbstractExtrapolation) = axes(exp.itp)
107108
108109twotuple (r:: AbstractUnitRange ) = (first (r), last (r))
109110twotuple (x, y) = (x, y)
111+
112+ """
113+ bounds(itp::AbstractInterpolation)
114+
115+ Return the `bounds` of the domain of `itp` as a tuple of `(min, max)` pairs for each coordinate. This is best explained by example:
116+
117+ ```jldoctest
118+ julia> itp = interpolate([1 2 3; 4 5 6], BSpline(Linear()));
119+
120+ julia> bounds(itp)
121+ ((1, 2), (1, 3))
122+
123+ julia> data = 1:3;
124+
125+ julia> knots = ([10, 11, 13.5],);
126+
127+ julia> itp = interpolate(knots, data, Gridded(Linear()));
128+
129+ julia> bounds(itp)
130+ ((10.0, 13.5),)
131+ ```
132+ """
110133bounds (itp:: AbstractInterpolation ) = map (twotuple, lbounds (itp), ubounds (itp))
111134bounds (itp:: AbstractInterpolation , d) = bounds (itp)[d]
112135
You can’t perform that action at this time.
0 commit comments