Compresses a single-precision vector using the specified gating vector.


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



Single-precision real input vector


Stride for A


Single-precision real gating vector


Stride for B


Single-precision real output vector


Stride for C


The number of elements to process.


Performs the following operation:

vDSP_Length p = 0;
for (n = 0; n < N; ++n){
    if (B[n*IB] != 0)
        C[p++ * IC] = A[n*IA];

Compresses vector A based on the nonzero values of gating vector B. For nonzero elements of B, corresponding elements of A are sequentially copied to output vector C.

See Also

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