- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
diff2
Complete List of ArrayFire Functions ArrayFire Functions by Category » Vector Algorithms » | Numerical differentiation

Second order numerical difference along specified dimension. More...

## Functions
AFAPI array | diff2 (const array &in, const int dim=0)
| C++ Interface for calculating second order differences in an array. More...
AFAPI af_err | af_diff2 (af_array *out, const af_array in, const int dim)
| C Interface for calculating second order differences in an array. More...

## Detailed Description

Second order numerical difference along specified dimension.

This function performs the operation across all batches present in the input simultaneously.

## Function Documentation

AFAPI af_err af_diff2 | ( | af_array * | out,
|  | const af_array | in,
|  | const int | dim
| ) |  |

C Interface for calculating second order differences in an array.

Parameters

  [out] | out | will contain the second order numerical differences of `in`
  [in] | in | is the input array
  [in] | dim | The dimension along which numerical difference is performed

Returns
  AF_SUCCESS if the execution completes properly

AFAPI array af::diff2 | ( | const array & | in,
|  | const int | dim = `0`
| ) |  |

C++ Interface for calculating second order differences in an array.

Parameters

  [in] | in | is the input array
  [in] | dim | The dimension along which numerical difference is performed

Returns
  array of second order numerical difference