Methods

DataInterpolations.LinearInterpolationType
LinearInterpolation(u, t; extrapolation_left::ExtrapolationType.T = ExtrapolationType.None, 
extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_right::ExtrapolationType.T = ExtrapolationType.None, 
cache_parameters = false)

It is the method of interpolating between the data points using a linear polynomial. For any point, two data points one each side are chosen and connected with a line. Extrapolation extends the last linear polynomial on each side.

t may contain repeated time points: a pair of equal knots encodes a jump (a discontinuity), e.g. u = [1.0, 2.0, 1.0], t = [0.0, 1.0, 1.0] ramps up to 2.0 on (0, 1) and steps down to 1.0 at t = 1. At a repeated knot the value is right-continuous — A(t) returns the post-jump value, matching ConstantInterpolation with the default dir = :left.

Arguments

  • u: data points.
  • t: time points.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = LinearInterpolation([1.0, 3.0], [0.0, 1.0])
A(0.5)
source
DataInterpolations.QuadraticInterpolationType
QuadraticInterpolation(u, t, mode = :Forward; extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_right::ExtrapolationType.T = ExtrapolationType.None, 
    cache_parameters = false)

It is the method of interpolating between the data points using quadratic polynomials. For any point, three data points nearby are taken to fit a quadratic polynomial. Extrapolation extends the last quadratic polynomial on each side.

Arguments

  • u: data points.
  • t: time points.
  • mode: :Forward or :Backward. If :Forward, two data points ahead of the point and one data point behind is taken for interpolation. If :Backward, two data points behind and one ahead is taken for interpolation.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = QuadraticInterpolation([1.0, 4.0, 9.0], [1.0, 2.0, 3.0])
A(2.5)
source
DataInterpolations.LagrangeInterpolationType
LagrangeInterpolation(u, t, n = length(t) - 1; extrapolation::ExtrapolationType.T = ExtrapolationType.None, 
extrapolation_left::ExtrapolationType.T = ExtrapolationType.None, extrapolation_right::ExtrapolationType.T = ExtrapolationType.None)

It is the method of interpolation using Lagrange polynomials of (k-1)th order passing through all the data points where k is the number of data points.

Arguments

  • u: data points.
  • t: time points.
  • n: order of the polynomial. Currently only (k-1)th order where k is the number of data points.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = LagrangeInterpolation([1.0, 4.0, 9.0], [1.0, 2.0, 3.0])
A(2.5)
source
DataInterpolations.AkimaInterpolationType
AkimaInterpolation(u, t; modified = false, extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None, cache_parameters = false)

It is a spline interpolation built from cubic polynomials. It forms a continuously differentiable function. For more details, refer: https://en.wikipedia.org/wiki/Akima_spline. Extrapolation extends the last cubic polynomial on each side.

Arguments

  • u: data points.
  • t: time points.

Keywords

  • modified: if true, use the modified Akima (makima) formula for the slopes at the knots, which adds an extra term |m_{i+1} + m_i| / 2 to each weight. Tends to reduce overshoot and oscillation on data with flat regions or repeated values. See https://blogs.mathworks.com/cleve/2019/04/29/makima-piecewise-cubic-interpolation/. Defaults to false.
  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = AkimaInterpolation([1.0, 4.0, 9.0, 16.0], [1.0, 2.0, 3.0, 4.0])
A(2.5)
source
DataInterpolations.ConstantInterpolationType
ConstantInterpolation(u, t; dir = :left, extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None, cache_parameters = false)

It is the method of interpolating using a constant polynomial. For any point, two adjacent data points are found on either side (left and right). The value at that point depends on dir. If it is :left, then the value at the left point is chosen and if it is :right, the value at the right point is chosen. Extrapolation extends the last constant polynomial at the end points on each side.

Arguments

  • u: data points.
  • t: time points.

Keywords

  • dir: indicates which value should be used for interpolation (:left or :right).
  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = ConstantInterpolation([1.0, 2.0, 3.0], [0.0, 1.0, 2.0])
A(0.5)
source
DataInterpolations.SmoothedConstantInterpolationType
SmoothedConstantInterpolation(u, t; d_max = Inf, extrapolate = false,
    cache_parameters = false)

It is a method for interpolating constantly with forward fill, with smoothing around the value transitions to make the curve continuously differentiable while the integral never drifts far from the integral of constant interpolation. u[end] is ignored, except when using extrapolation types Constant or Extension.

Arguments

  • u: data points.
  • t: time points.

Keywords

  • d_max: Around each time point tᵢ there is a continuously differentiable (quadratic) transition between uᵢ₋₁ and uᵢ, on the interval [tᵢ - d, tᵢ + d]. The distance d is determined as d = min((tᵢ - tᵢ₋₁)/2, (tᵢ₊₁ - tᵢ)/2, d_max).
  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic (also made smooth at the boundaries) and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = SmoothedConstantInterpolation([1.0, 2.0, 3.0], [0.0, 1.0, 2.0])
A(0.5)
source
DataInterpolations.QuadraticSplineType
QuadraticSpline(u, t; extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None, cache_parameters = false)

It is a spline interpolation using piecewise quadratic polynomials between each pair of data points. Its first derivative is also continuous. Extrapolation extends the last quadratic polynomial on each side.

Arguments

  • u: data points.
  • t: time points.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = QuadraticSpline([1.0, 4.0, 9.0], [1.0, 2.0, 3.0])
A(2.5)
source
DataInterpolations.CubicSplineType
CubicSpline(u, t; extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None, cache_parameters = false)

It is a spline interpolation using piecewise cubic polynomials between each pair of data points. Its first and second derivative is also continuous. Second derivative on both ends are zero, which are also called "natural" boundary conditions. Extrapolation extends the last cubic polynomial on each side.

Arguments

  • u: data points.
  • t: time points.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = CubicSpline([1.0, 4.0, 9.0, 16.0], [1.0, 2.0, 3.0, 4.0])
A(2.5)
source
DataInterpolations.BSplineInterpolationType
BSplineInterpolation(u, t, d, knotVecType; extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None)

It is a B-spline interpolation of degree d that passes through all data points. The knot vector is constructed directly from the data sites t, and basis functions are evaluated directly at t values (no reparameterization). For more information, refer to de Boor's "A Practical Guide to Splines". Extrapolation is a constant polynomial of the end points on each side.

Arguments

  • u: data points.
  • t: time points.
  • d: degree of the piecewise polynomial.
  • knotVecType: symbol to knot vector, :Uniform for uniform knot vector, :Average for average spaced knot vector. :Average is the appropriate choice for interpolation. :Uniform spaces the interior knots inconsistently with the data sites, which makes the collocation system exponentially ill-conditioned in the number of points for d >= 3; constructing such an interpolation warns, and the result may deviate from the data by orders of magnitude between the data points even though it still passes through them.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = BSplineInterpolation([1.0, 4.0, 9.0, 16.0], [1.0, 2.0, 3.0, 4.0], 2, :Average)
A(2.5)
source
DataInterpolations.BSplineApproxType
BSplineApprox(u, t, d, h, knotVecType; extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None)

It is a regression based B-spline. The argument choices are the same as the BSplineInterpolation, with the additional parameter h < length(t) which is the number of control points to use, with smaller h indicating more smoothing. Extrapolation is a constant polynomial of the end points on each side.

Arguments

  • u: data points.
  • t: time points.
  • d: degree of the piecewise polynomial.
  • h: number of control points to use.
  • knotVecType: symbol to knot vector, :Uniform for uniform knot vector, :Average for average spaced knot vector.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = BSplineApprox([1.0, 4.0, 9.0, 16.0], [1.0, 2.0, 3.0, 4.0], 2, 3, :Average)
A(2.5)
source
DataInterpolations.CubicHermiteSplineType
CubicHermiteSpline(du, u, t; extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None, cache_parameters = false)

It is a Cubic Hermite interpolation, which is a piece-wise third degree polynomial such that the value and the first derivative are equal to given values in the data points.

Arguments

  • du: the derivative at the data points.
  • u: data points.
  • t: time points.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = CubicHermiteSpline([2.0, 4.0, 6.0], [1.0, 4.0, 9.0], [1.0, 2.0, 3.0])
A(2.5)
source
DataInterpolations.PCHIPInterpolationFunction
PCHIPInterpolation(u, t; extrapolation::ExtrapolationType.T = ExtrapolationType.None, extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None)

It is a PCHIP Interpolation, which is a type of CubicHermiteSpline where the derivative values du are derived from the input data in such a way that the interpolation never overshoots the data. See here, section 3.4 for more details.

Arguments

  • u: data points.
  • t: time points.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = PCHIPInterpolation([1.0, 4.0, 9.0, 16.0], [1.0, 2.0, 3.0, 4.0])
A(2.5)
source
DataInterpolations.QuinticHermiteSplineType
QuinticHermiteSpline(ddu, du, u, t; extrapolation_left::ExtrapolationType.T = ExtrapolationType.None,
    extrapolation_right::ExtrapolationType.T = ExtrapolationType.None)

It is a Quintic Hermite interpolation, which is a piece-wise fifth degree polynomial such that the value and the first and second derivative are equal to given values in the data points.

Arguments

  • ddu: the second derivative at the data points.
  • du: the derivative at the data points.
  • u: data points.
  • t: time points.

Keywords

  • extrapolation: The extrapolation type applied left and right of the data. Possible options are ExtrapolationType.None (default), ExtrapolationType.Constant, ExtrapolationType.LinearExtrapolationType.Extension, ExtrapolationType.Periodic and ExtrapolationType.Reflective.
  • extrapolation_left: The extrapolation type applied left of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • extrapolation_right: The extrapolation type applied right of the data. See extrapolation for the possible options. This keyword is ignored if extrapolation != ExtrapolationType.None.
  • cache_parameters: precompute parameters at initialization for faster interpolation computations. Note: if activated, u and t should not be modified. Defaults to false.
  • search_properties: a pre-built FindFirstFunctions.SearchProperties for t, used to skip the construction-time knot probe or override its result (e.g. built with is_uniform = true). Defaults to nothing, which probes t automatically.

Examples

using DataInterpolations

A = QuinticHermiteSpline(
    [0.0, 0.0, 0.0], [2.0, 4.0, 6.0], [1.0, 4.0, 9.0], [1.0, 2.0, 3.0],
)
A(2.5)
source

Interface

DataInterpolations.derivativeFunction
derivative(A::AbstractInterpolation, t::Number, order = 1)

Evaluate the order-th derivative of the interpolation A at t.

First order derivatives are computed analytically; second order derivatives are computed from the analytical first order derivative with ForwardDiff.jl. The derivative is taken as a left derivative, so at a data point where the derivative jumps the value from the interval to the left of the point is returned.

Outside of the range of A.t the derivative of the extrapolation is returned, as determined by the extrapolation_left and extrapolation_right settings of A.

Arguments

  • A: the interpolation object.
  • t: the point at which to evaluate the derivative.
  • order: the order of the derivative, either 1 or 2. Defaults to 1.

Examples

using DataInterpolations

u = [1.0, 4.0, 9.0]
t = [1.0, 2.0, 3.0]
A = QuadraticInterpolation(u, t)

DataInterpolations.derivative(A, 2.5)

# output

5.0
source
DataInterpolations.integralFunction
integral(A::AbstractInterpolation, t::Number)
integral(A::AbstractInterpolation, t1::Number, t2::Number)

Evaluate the integral of the interpolation A over [first(A.t), t], or over [t1, t2] when both bounds are given. The integral is computed analytically per interval, so it is exact for the interpolation. integral(A, t2, t1) == -integral(A, t1, t2).

Parts of the integration interval outside the range of A.t are integrated over the extrapolation, as determined by the extrapolation_left and extrapolation_right settings of A.

Interpolation types with no analytical antiderivative — LagrangeInterpolation and Curvefit — throw an IntegralNotFoundError; use a numerical integrator such as Integrals.jl for those.

Arguments

  • A: the interpolation object.
  • t: the upper bound, with first(A.t) used as the lower bound.
  • t1, t2: the lower and upper bounds.

Examples

using DataInterpolations

u = [1.0, 2.0, 3.0]
t = [1.0, 2.0, 3.0]
A = LinearInterpolation(u, t)

DataInterpolations.integral(A, 1.0, 3.0)

# output

4.0
source

Utility Functions

DataInterpolations.output_dimFunction
output_dim(x::AbstractInterpolation)

Return the number of dimensions ndims(x(t)) of interpolation x for a scalar t.

Arguments

  • x: the interpolation to inspect.

Returns

  • Int: the number of dimensions of one interpolated data point.

Examples

using DataInterpolations

A = LinearInterpolation([1.0, 2.0], [0.0, 1.0])
output_dim(A)
source
DataInterpolations.output_sizeFunction
output_size(x::AbstractInterpolation)

Return the size size(x(t)) of interpolation x for a scalar t.

Arguments

  • x: the interpolation to inspect.

Returns

  • Tuple: the size of one interpolated data point.

Examples

using DataInterpolations

A = LinearInterpolation([1.0, 2.0], [0.0, 1.0])
output_size(A)
source