| 106 | |
| 107 | template<typename T> |
| 108 | void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot, |
| 109 | const Array<T> &in) { |
| 110 | dim4 iDims = in.dims(); |
| 111 | int M = iDims[0]; |
| 112 | int N = iDims[1]; |
| 113 | |
| 114 | Array<T> in_copy = copyArray<T>(in); |
| 115 | pivot = lu_inplace(in_copy); |
| 116 | |
| 117 | // SPLIT into lower and upper |
| 118 | dim4 ldims(M, min(M, N)); |
| 119 | dim4 udims(min(M, N), N); |
| 120 | lower = createEmptyArray<T>(ldims); |
| 121 | upper = createEmptyArray<T>(udims); |
| 122 | |
| 123 | lu_split<T>(lower, upper, in_copy); |
| 124 | } |
| 125 | |
| 126 | template<typename T> |
| 127 | Array<int> lu_inplace(Array<T> &in, const bool convert_pivot) { |
nothing calls this directly
no test coverage detected