Documentation
|
|
The C++ interface for grad. More...
| void | grad (array &dcols, array &drows, const array &in) |
The C++ interface for grad.
grad computes the gradient of a matrix using a central difference along a given dimension. For an interior point in the matrix, \( n_i \), the central difference is computed as \( \frac{n_{i+1} - n_{i-1}}{2} \). For exterior points (those along the edge of the matrix), a one-sided difference is used.
| void af::grad | ( | array & | dcols, |
| array & | drows, | ||
| const array & | in | ||
| ) |
| [in] | in | 2D |
| [out] | dcols | gradient along columns |
| [out] | drows | gradient along rows |