Function

vDSP_viclip

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

Declaration

void vDSP_viclip(const float *__A, vDSP_Stride __IA, const float *__B, const float *__C, float *__D, vDSP_Stride __ID, 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

Pointer to single-precision real input scalar: upper threshold

__D

Single-precision real output vector

__ID

Stride for D

__N

The number of elements to process

Discussion

Performs the following operation:

for (int n = 0; n < N; ++n) {
    if (A[nIA] <= *B || A[nIA] >= *C)
        D[nID] = A[nIA];
    else if (A[nIA] < 0)
        D[nID] = *B;
    else
        D[nID] = *C;
 
}

Performs an inverted clip of vector A using lower-threshold and upper-threshold input scalars *B and *C. Note that negative values in A are clipped to *B.

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_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.