#include <math.h>
#include <cstdio>
static const int M = 30;
static const int N = 2 * M;
int main(int, char**) {
try {
af::Window myWindow(800, 800,
"3D Surface example: ArrayFire");
static float t = 0;
while (!myWindow.
close()) {
t += 0.07;
}
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}
Window object to render af::arrays.
A multi dimensional data container.
Generic object that represents size and shape.
An ArrayFire exception class.
virtual const char * what() const
Returns an error message for the exception in a string format.
array abs(const array &in)
C++ Interface to calculate the absolute value.
array cos(const array &in)
C++ Interface to evaluate the cosine function.
array sin(const array &in)
C++ Interface to evaluate the sine function.
array iota(const dim4 &dims, const dim4 &tile_dims=dim4(1), const dtype ty=f32)
C++ Interface to generate an array with [0, n-1] values modified to specified dimensions and tiling.
void surface(const array &S, const char *const title=NULL)
Renders the input arrays as a 3D surface plot to the window.
bool close()
Check if window is marked for close.