Function

vDSP_vthr

Calculates single-precision vector threshold to the specified range.

Declaration

void vDSP_vthr(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] = *B;
}

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

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_vclipc

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

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_vthrD

Calculates double-precision vector threshold to the specified range.