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

Function convertPivot

src/backend/opencl/lu.cpp:24–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace opencl {
23
24Array<int> convertPivot(int *ipiv, int in_sz, int out_sz) {
25 std::vector<int> out(out_sz);
26
27 for (int i = 0; i < out_sz; i++) { out[i] = i; }
28
29 for (int j = 0; j < in_sz; j++) {
30 // 1 indexed in pivot
31 std::swap(out[j], out[ipiv[j] - 1]);
32 }
33
34 Array<int> res = createHostDataArray(dim4(out_sz), &out[0]);
35
36 return res;
37}
38
39template<typename T>
40void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot,

Callers 1

lu_inplaceFunction · 0.70

Calls 3

swapFunction · 0.85
createHostDataArrayFunction · 0.70
dim4Class · 0.50

Tested by

no test coverage detected