A high-performance general-purpose compute library

Clamp an array between an upper and a lower limit. More...

Functions

AFAPI af_err af_clamp (af_array *out, const af_array in, const af_array lo, const af_array hi, const bool batch)
 C Interface to clamp an array between an upper and a lower limit. More...
 
AFAPI array clamp (const array &in, const array &lo, const array &hi)
 
AFAPI array clamp (const array &in, const array &lo, const double hi)
 
AFAPI array clamp (const array &in, const double lo, const array &hi)
 
AFAPI array clamp (const array &in, const double lo, const double hi)
 

Detailed Description

Clamp an array between an upper and a lower limit.

Function Documentation

◆ af_clamp()

AFAPI af_err af_clamp ( af_array out,
const af_array  in,
const af_array  lo,
const af_array  hi,
const bool  batch 
)

C Interface to clamp an array between an upper and a lower limit.

Parameters
[out]outclamped array
[in]ininput array
[in]lolower limit array
[in]hiupper limit array
[in]batchbatch mode
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ clamp() [1/4]

AFAPI array clamp ( const array in,
const array lo,
const array hi 
)

C++ Interface to clamp an array between an upper and a lower limit.

Parameters
[in]ininput array
[in]lolower limit; can be an array or a scalar
[in]hiupper limit; can be an array or a scalar
Returns
clamped array

◆ clamp() [2/4]

AFAPI array clamp ( const array in,
const array lo,
const double  hi 
)

C++ Interface to clamp an array between an upper and a lower limit.

Parameters
[in]ininput array
[in]lolower limit; can be an array or a scalar
[in]hiupper limit; can be an array or a scalar
Returns
clamped array

◆ clamp() [3/4]

AFAPI array clamp ( const array in,
const double  lo,
const array hi 
)

C++ Interface to clamp an array between an upper and a lower limit.

Parameters
[in]ininput array
[in]lolower limit; can be an array or a scalar
[in]hiupper limit; can be an array or a scalar
Returns
clamped array

◆ clamp() [4/4]

AFAPI array clamp ( const array in,
const double  lo,
const double  hi 
)

C++ Interface to clamp an array between an upper and a lower limit.

Parameters
[in]ininput array
[in]lolower limit; can be an array or a scalar
[in]hiupper limit; can be an array or a scalar
Returns
clamped array