| 76 | LU_FUNC(getrf, cdouble, Z) |
| 77 | |
| 78 | void convertPivot(Array<int> &pivot, int out_sz) { |
| 79 | dim_t d0 = pivot.dims()[0]; |
| 80 | |
| 81 | std::vector<int> d_po(out_sz); |
| 82 | for (int i = 0; i < out_sz; i++) { d_po[i] = i; } |
| 83 | |
| 84 | std::vector<int> d_pi(d0); |
| 85 | copyData(&d_pi[0], pivot); |
| 86 | |
| 87 | for (int j = 0; j < d0; j++) { |
| 88 | // 1 indexed in pivot |
| 89 | std::swap(d_po[j], d_po[d_pi[j] - 1]); |
| 90 | } |
| 91 | |
| 92 | pivot = createHostDataArray<int>(out_sz, &d_po[0]); |
| 93 | } |
| 94 | |
| 95 | template<typename T> |
| 96 | void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot, |
no test coverage detected