linearInterpolate(values:atIndices:)
Returns the double-precision linearly interpolated values of a vector at the specified indices.
Declaration
static func linearInterpolate<T, U>(values: T, atIndices indices: U) -> [Double] where T : AccelerateBuffer, U : AccelerateBuffer, T.Element == Double, U.Element == DoubleParameters
- values:
The values to interpolate.
- indices:
The indices to the output vector.
Mentioned in
Return Value
A vector that contains the linearly interpolated values.
Discussion
The following code creates a five-element vector from two values using linear interpolation. The last index in indices determines the length of the operation result.
let values: [Double] = [0, 100]
let indices: [Double] = [0, 4]
let result = vDSP.linearInterpolate(values: values,
atIndices: indices)
// Prints "[0.0, 25.0, 50.0, 75.0, 100.0]".
print(result)