| 94 | |
| 95 | template<typename T> |
| 96 | void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot, |
| 97 | const Array<T> &in) { |
| 98 | dim4 iDims = in.dims(); |
| 99 | int M = iDims[0]; |
| 100 | int N = iDims[1]; |
| 101 | |
| 102 | Array<T> in_copy = copyArray<T>(in); |
| 103 | pivot = lu_inplace(in_copy); |
| 104 | |
| 105 | // SPLIT into lower and upper |
| 106 | dim4 ldims(M, std::min(M, N)); |
| 107 | dim4 udims(std::min(M, N), N); |
| 108 | lower = createEmptyArray<T>(ldims); |
| 109 | upper = createEmptyArray<T>(udims); |
| 110 | kernel::lu_split<T>(lower, upper, in_copy); |
| 111 | } |
| 112 | |
| 113 | template<typename T> |
| 114 | Array<int> lu_inplace(Array<T> &in, const bool convert_pivot) { |
nothing calls this directly
no test coverage detected