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

Function convertPivot

src/backend/opencl/cpu/cpu_lu.cpp:95–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void convertPivot(int *pivot, int out_sz, size_t pivot_dim) {
96 std::vector<int> p(out_sz);
97 iota(begin(p), end(p), 0);
98
99 for (int j = 0; j < static_cast<int>(pivot_dim); j++) {
100 // 1 indexed in pivot
101 std::swap(p[j], p[pivot[j] - 1]);
102 }
103
104 copy(begin(p), end(p), pivot);
105}
106
107template<typename T>
108void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot,

Callers 1

lu_inplaceFunction · 0.70

Calls 5

beginFunction · 0.85
endFunction · 0.85
swapFunction · 0.85
iotaFunction · 0.50
copyFunction · 0.50

Tested by

no test coverage detected