| 46 | |
| 47 | template<typename T> |
| 48 | void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot, |
| 49 | const Array<T> &in) { |
| 50 | dim4 iDims = in.dims(); |
| 51 | int M = iDims[0]; |
| 52 | int N = iDims[1]; |
| 53 | int MN = std::min(M, N); |
| 54 | |
| 55 | Array<T> in_copy = copyArray<T>(in); |
| 56 | pivot = lu_inplace(in_copy); |
| 57 | |
| 58 | // SPLIT into lower and upper |
| 59 | dim4 ldims(M, MN); |
| 60 | dim4 udims(MN, N); |
| 61 | lower = createEmptyArray<T>(ldims); |
| 62 | upper = createEmptyArray<T>(udims); |
| 63 | kernel::lu_split<T>(lower, upper, in_copy); |
| 64 | } |
| 65 | |
| 66 | template<typename T> |
| 67 | Array<int> lu_inplace(Array<T> &in, const bool convert_pivot) { |
nothing calls this directly
no test coverage detected