Do more. Code less. Free software for GPU computing.
<scroll to top>
Functions

Gradient or grid construction

Data Analysis

Functions

array diff1 (const array &in, int dim=-1)
 difference between elements along a dimension
array diff2 (const array &in, int dim=-1)
 difference between every other element along a dimension
void grad (array &dx, array &dy, const array &in)
 Gradient of a matrix (central differencing).
void grid (array &x, array &y, const array &v1, const array &v2)
 Create a regular mesh grid.

Function Documentation

array af::diff1 ( const array &  in,
int  dim = -1 
)

difference between elements along a dimension

Parameters:
[in]in
[in]dimdimension along which to operate (-1 indicates first nonsingleton dimension)
Returns:
difference between neighboring elements
Examples:
examples/fdtd/fdtd.cpp.
array af::diff2 ( const array &  in,
int  dim = -1 
)

difference between every other element along a dimension

Parameters:
[in]in
[in]dimdimension along which to operate (-1 indicates first nonsingleton dimension)
Returns:
second order difference between elements
void af::grad ( array &  dx,
array &  dy,
const array &  in 
)

Gradient of a matrix (central differencing).

Parameters:
[in]in2D
[out]dxgradient along the first dimension
[out]dygradient along the second dimension
void af::grid ( array &  x,
array &  y,
const array &  v1,
const array &  v2 
)

Create a regular mesh grid.

Transform the domain specified by vectors v1 and v2 into arrays x and y. The rows of array X are copies of vector v1, columns of output Y are copies of vector v2.

Parameters:
[in]v1indicates row to be repeated
[in]v2indicates the column to be repeated
[out]xmatrix with rows as copies of v1
[out]ymatrix with columns as copies of v2
Examples:
examples/swe/swe.cpp.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines