ArrayFire: sign (original) (raw)

Return the sign of elements in an array. More...

Functions
AFAPI array sign (const array &in)
C++ Interface to return the sign of elements in an array. More...
AFAPI af_err af_sign (af_array *out, const af_array in)
C Interface to calculate the sign of elements in an array. More...

Return the sign of elements in an array.

Note

This function only supports real inputs; complex inputs are not yet supported.

af_sign()

C Interface to calculate the sign of elements in an array.

Parameters

[out] out array containing 1's for negative values; 0's otherwise
[in] in input array

Returns

AF_SUCCESS, if function returns successfully, else an af_err code is given

C++ Interface to return the sign of elements in an array.

Parameters

Returns

array containing 1's for negative values; 0's otherwise