#include <cstdio>
#include <math.h>
static const int ITERATIONS = 50;
static const float PRECISION = 1.0f/ITERATIONS;
int main(int argc, char *argv[])
{
try {
af::Window myWindow(1024, 512,
"2D Plot example: ArrayFire");
int sign = 1;
Y = sin(X);
myWindow(0,0).
plot(X, Y);
X = X + PRECISION * float(sign);
val += PRECISION * float(sign);
sign = -1;
sign = 1;
}
}
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}
Window object to render af::arrays.
Definition graphics.h:37
A multi dimensional data container.
Definition array.h:27
Definition exception.h:20
virtual const char * what() const
Definition exception.h:34
seq is used to create seq for indexing af::array
Definition seq.h:46
@ AF_MARKER_POINT
Definition defines.h:387
void scatter(const array &X, const array &Y, const af::markerType marker=AF_MARKER_POINT, const char *const title=NULL)
Renders the input arrays as a 2D scatter-plot to the window.
void plot(const array &X, const array &Y, const char *const title=NULL)
Renders the input arrays as a 2D plot to the window.
bool close()
Check if window is marked for close.
void show()
This function swaps the background buffer to current view and polls for any key strokes while the win...
void grid(const int rows, const int cols)
Setup grid layout for multiview mode in a window.
dim4 dims() const
Get dimensions of the array.
Definition algorithm.h:15