Function

vDSP_vtabi(_:_:_:_:_:_:_:_:_:)

Generates a single-precision vector, by interpolating values from a lookup table.

Declaration

func vDSP_vtabi(_ __A: UnsafePointer<Float>, _ __IA: vDSP_Stride, _ __S1: UnsafePointer<Float>, _ __S2: UnsafePointer<Float>, _ __C: UnsafePointer<Float>, _ __M: vDSP_Length, _ __D: UnsafeMutablePointer<Float>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

Parameters

__A

Single-precision real input vector.

__IA

Address stride for A.

__S1

Pointer to single-precision real input scalar: scale factor.

__S2

Pointer to single-precision real input scalar: base offset.

__C

Single-precision real input vector: lookup table.

__M

Lookup table size.

__D

Single-precision real output vector.

__ID

Stride for D

__N

The number of elements to write to D.

Discussion

Performs the following operation:

mathematical formula

where F is scaling factor S1 and G is offset S2.

Evaluates elements of vector A for use as offsets into vector C. Vector C is a zero-based lookup table supplied by the caller that generates output values for vector D. Linear interpolation is used to compute output values when an offset is not an integer. Scale factor S1 and base offset S2 map the anticipated range of input values to the range of the lookup table and are typically assigned values such that:

floor(S1 * minimum input value + S2) = 0
floor(S1 * maximum input value + S2) = M-1

If an offset is less than zero or greater than M-1, C[0] or C[M-1] is written to the output, respectively. For inputs that evaluate integrally, the table location indexed by the integral is copied as the output value.

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