CubicInterpolant

class CubicInterpolant(parameterPositions: DoubleArray, sampleValues: DoubleArray, sampleSize: Int, resultBuffer: DoubleArray = DoubleArray(sampleSize)) : Interpolant

Fast and simple cubic spline interpolant.

It was derived from a Hermitian construction setting the first derivative at each sample position to the linear slope between neighboring positions over their parameter interval.

Parameters

parameterPositions

The parameter positions holding the interpolation factors.

sampleValues

The sample values.

sampleSize

The sample size (a.k.a. the value size / stride).

resultBuffer

The result buffer; defaults to a fresh DoubleArray(sampleSize).

Constructors

Link copied to clipboard
constructor(parameterPositions: DoubleArray, sampleValues: DoubleArray, sampleSize: Int, resultBuffer: DoubleArray = DoubleArray(sampleSize))

Properties

Link copied to clipboard

The default settings object. Overridden by CubicInterpolant.

Link copied to clipboard

The parameter positions.

Link copied to clipboard

The result buffer. Reused across calls; overwritten by every evaluate.

Link copied to clipboard

The sample values.

Link copied to clipboard

The interpolation settings. null until assigned; getSettings_ then falls back to DefaultSettings_.

Link copied to clipboard

The value size (stride).

Functions

Link copied to clipboard
open fun copySampleValue_(index: Int): DoubleArray

Copies a sample value to the result buffer.

Link copied to clipboard

Evaluates the interpolant at position t.

Link copied to clipboard

Returns the interpolation settings.