Function

vDSP_vcmprs

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

Declaration

void vDSP_vcmprs(const float *__A, vDSP_Stride __IA, const float *__B, vDSP_Stride __IB, float *__C, vDSP_Stride __IC, vDSP_Length __N);

Parameters

__A

Single-precision real input vector

__IA

Stride for A

__B

Single-precision real gating vector

__IB

Stride for B

__C

Single-precision real output vector

__IC

Stride for C

__N

The number of elements to process.

Discussion

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

Single-Vector Compression

vDSP_vcmprsD

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