MCPcopy Create free account
hub / github.com/arrayfire/forge / generatePoints

Function generatePoints

examples/cpu/field.cpp:29–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27using namespace std;
28
29void generatePoints(std::vector<float> &points, std::vector<float> &dirs)
30{
31 points.clear();
32
33 for (int j=0; j<NELEMS; ++j) {
34 float y = MINIMUM + j*STEP;
35 for (int i=0; i<NELEMS; ++i) {
36 float x = MINIMUM + i*STEP;
37 points.push_back(x);
38 points.push_back(y);
39 dirs.push_back(sin(2*PI*x/10.f));
40 dirs.push_back(sin(2*PI*y/10.f));
41 }
42 }
43}
44
45int main(void)
46{

Callers 1

mainFunction · 0.70

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected