[−][src]Function arrayfire::clamp

pub fn clamp<T, C>(    input: &Array<T>,     arg1: &C,     arg2: &C,     batch: bool) -> Array<<T as ImplicitPromote<<C as Convertable>::OutType>>::Output> where    T: ImplicitPromote<<C as Convertable>::OutType>,    C: Convertable,    <C as Convertable>::OutType: ImplicitPromote<T>,

Clamp the values of Array

Parameters

• arg1is an argument that implements an internal trait Convertable.
• arg2is an argument that implements an internal trait Convertable.
• batch is an boolean that indicates if the current operation is an batch operation.

Both parameters arg1 and arg2 can be either an Array or a value of rust integral type.

Return Values

An Array with results of the binary operation.

Important Notes

• If shape/dimensions of arg1 and arg2 are same, the value of batch parameter has no effect.

• If shape/dimensions of arg1 and arg2 are different, the value of batch has to be set to true. In this case, the shapes of arg1 and arg2 have to satisfy the following criteria:

• Same number of elements in arg1 and arg2 along a given dimension/axis
• Only one element in arg1 or arg2 along a given dimension/axis
• The trait Convertable essentially translates to a scalar native type on rust or Array.