Function

vDSP_vthres

Calculates single-precision vector threshold with zero fill to the specified range.

Declaration

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

Parameters

__A

Single-precision real input vector

__IA

Stride for A

__B

Pointer to single-precision real input scalar: lower threshold

__C

Single-precision real output vector

__IC

Stride for C

__N

The number of elements to process

Discussion

Performs the following operation:

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

Creates vector C by comparing each input from vector A with scalar *B. If an input value is less than *B, zero is written to C; otherwise, the input value from A is copied to C.

See Also

Threshold Operations

vDSP_vthresD

Calculates double-precision vector threshold with zero fill to the specified range.

vDSP_vthrsc

Calculates single-precision vector threshold with signed constant to the specified range.

vDSP_vthrscD

Calculates double-precision vector threshold with signed constant to the specified range.