A high-performance general-purpose compute library

Calculate the first order difference in an array over a given dimension. More...

Functions

AFAPI array diff1 (const array &in, const int dim=0)
 C++ Interface to calculate the first order difference in an array over a given dimension. More...
 
AFAPI af_err af_diff1 (af_array *out, const af_array in, const int dim)
 C Interface to calculate the first order difference in an array over a given dimension. More...
 

Detailed Description

Calculate the first order difference in an array over a given dimension.

This function runs across all batches in the input simultaneously.

Function Documentation

◆ af_diff1()

AFAPI af_err af_diff1 ( af_array out,
const af_array  in,
const int  dim 
)

C Interface to calculate the first order difference in an array over a given dimension.

Parameters
[out]outfirst order numerical difference
[in]ininput array
[in]dimdimension along which the difference occurs
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ diff1()

AFAPI array diff1 ( const array in,
const int  dim = 0 
)

C++ Interface to calculate the first order difference in an array over a given dimension.

Parameters
[in]ininput array
[in]dimdimension along which the difference occurs, 0 denotes the first non-singleton dimension
Returns
first order numerical difference