A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arrayfire.org/docs/graphics_2plot2d_8cpp-example.htm below:

ArrayFire: graphics/plot2d.cpp

#include <math.h>

#include <cstdio>

static const int ITERATIONS = 50;

static const float PRECISION = 1.0f / ITERATIONS;

int main(int, char**) {

try {

af::Window

myWindow(800, 800,

"2D Plot example: ArrayFire"

);

int sign = 1;

for

(

double

val = 0; !myWindow.

close

();) {

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.

A multi dimensional data container.

dim4 dims() const

Get dimensions of the array.

An ArrayFire exception class.

virtual const char * what() const

Returns an error message for the exception in a string format.

seq is used to create sequences for indexing af::array

void plot(const array &in, const char *const title=NULL)

Renders the input arrays as a 2D or 3D plot to the window.

void scatter(const array &in, const af::markerType marker=AF_MARKER_POINT, const char *const title=NULL)

Renders the input arrays as a 2D or 3D scatter-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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4