Function

vDSP_vlint(_:_:_:_:_:_:_:)

Calculates the interpolation between the neighboring elements of a single-precision vector using the specified stride.

Declaration

func vDSP_vlint(_ __A: UnsafePointer<Float>, _ __B: UnsafePointer<Float>, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer<Float>, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __M: vDSP_Length)

Parameters

__A

Single-precision real input vector.

__B

Single-precision real input vector: integer parts are indices into A and fractional parts are interpolation constants.

__IB

Address stride for B.

__C

Single-precision real output vector.

__IC

Address stride for C.

__N

Element count for C.

__M

Length of A.

Discussion

Performs the following operation:

for (n = 0; n < N; ++n){
    float b = B[n*IB];
    float index = trunc(b]); //int part of B value
    float alpha = b - index; //frac part of B value
 
    float a0 = A[(int)index];     //indexed A value
    float a1 = A[(int)index + 1]; //next A value
 
    C[n*IC] = a0 + (alpha * (a1 -a0)); //interpolated value
}

Generates vector C by interpolating between neighboring values of vector A as controlled by vector B. The integer portion of each element in B is the zero-based index of the first element of a pair of adjacent values in vector A.

The value of the corresponding element of C is derived from these two values by linear interpolation, using the fractional part of the value in B.

Argument M is not used in the calculation. However, the integer parts of the values in B must be greater than or equal to zero and less than or equal to M - 2.

See Also

Single-Vector Linear Interpolation

Use Linear Interpolation to Construct New Data Points

Fill the gaps in arrays of numerical data using linear interpolation.

static func linearInterpolate<T, U>(elementsOf: T, using: U) -> [Double]

Returns the interpolation between the neighboring elements of a double-precision vector.

static func linearInterpolate<T, U>(elementsOf: T, using: U) -> [Float]

Returns the interpolation between the neighboring elements of a single-precision vector.

static func linearInterpolate<T, U, V>(elementsOf: T, using: U, result: inout V)

Calculates the interpolation between the neighboring elements of a double-precision vector.

static func linearInterpolate<T, U, V>(elementsOf: T, using: U, result: inout V)

Calculates the interpolation between the neighboring elements of a single-precision vector.

func vDSP_vlintD(UnsafePointer<Double>, UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Stride, vDSP_Length, vDSP_Length)

Calculates the interpolation between the neighboring elements of a double-precision vector using the specified stride.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software