MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / main

Function main

examples/lin_algebra/lu.cpp:16–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace af;
15
16int main(int argc, char* argv[]) {
17 try {
18 // Select a device and display arrayfire info
19 int device = argc > 1 ? atoi(argv[1]) : 0;
20 af::setDevice(device);
21 af::info();
22
23 array in = randu(5, 8);
24 af_print(in);
25
26 array lin = in.copy();
27
28 printf("Running LU InPlace\n");
29 array pivot;
30 luInPlace(pivot, lin);
31 af_print(lin);
32 af_print(pivot);
33
34 printf("Running LU with Upper Lower Factorization\n");
35 array lower, upper;
36 lu(lower, upper, pivot, in);
37 af_print(lower);
38 af_print(upper);
39 af_print(pivot);
40
41 } catch (af::exception& e) {
42 fprintf(stderr, "%s\n", e.what());
43 throw;
44 }
45
46 return 0;
47}

Callers

nothing calls this directly

Calls 6

infoFunction · 0.85
randuFunction · 0.85
luInPlaceFunction · 0.85
setDeviceFunction · 0.50
luFunction · 0.50
copyMethod · 0.45

Tested by

no test coverage detected