Function

vDSP_vclipc

Calculates and counts the elements of a single-precision vector clipped to the specified range.

Declaration

void vDSP_vclipc(const float *__A, vDSP_Stride __IA, const float *__B, const float *__C, float *__D, vDSP_Stride __ID, vDSP_Length __N, vDSP_Length *__NLow, vDSP_Length *__NHigh);

Parameters

__A

Single-precision real input vector

__IA

Stride for A

__B

Pointer to single-precision real input scalar: low clipping threshold

__C

Pointer to single-precision real input scalar: high clipping threshold

__D

Single-precision real output vector

__ID

Stride for D

__vDSP_N

Number of elements in A and D

__NLow

Pointer to integer: number of elements that were clipped to *B

__NHigh

Pointer to integer: number of elements that were clipped to *C

Discussion

This performs the following operation:

for (n = 0; n < N; ++n) {
    if (A[n*IA] < *B)
        D[n*ID] = *B;
    else if (A[n*IA] > *C)
        D[n*ID] = *C;
    else
        D[n*ID] = A[n*IA];
}

Elements of A are copied to D, while clipping elements that are outside the interval [*B, *C] to the endpoints of the interval.

The count of elements clipped to *B is returned in *NLow, and the count of elements clipped to *C is returned in *NHigh

See Also

Clipping Operations

vDSP_vclip

Calculates the elements of a single-precision vector clipped to the specified range using the specified stride.

vDSP_vclipD

Calculates the elements of a double-precision vector clipped to the specified range using the specified stride.

vDSP_vclipcD

Calculates and counts the elements of a double-precision vector clipped to the specified range.

vDSP_viclip

Calculates the elements of a single-precision vector inverted-clipped to the specified range using the specified stride.

vDSP_viclipD

Calculates the elements of a double-precision vector inverted-clipped to the specified range using the specified stride.

vDSP_vthr

Calculates single-precision vector threshold to the specified range.

vDSP_vthrD

Calculates double-precision vector threshold to the specified range.