| 38 | |
| 39 | template<typename T> |
| 40 | Array<T> cholesky(int *info, const Array<T> &in, const bool is_upper) { |
| 41 | Array<T> out = copyArray<T>(in); |
| 42 | *info = cholesky_inplace(out, is_upper); |
| 43 | |
| 44 | mapped_ptr<T> oPtr = out.getMappedPtr(); |
| 45 | |
| 46 | if (is_upper) { |
| 47 | triangle<T, true, false>(oPtr.get(), oPtr.get(), out.dims(), |
| 48 | out.strides(), out.strides()); |
| 49 | } else { |
| 50 | triangle<T, false, false>(oPtr.get(), oPtr.get(), out.dims(), |
| 51 | out.strides(), out.strides()); |
| 52 | } |
| 53 | |
| 54 | return out; |
| 55 | } |
| 56 | |
| 57 | template<typename T> |
| 58 | int cholesky_inplace(Array<T> &in, const bool is_upper) { |
nothing calls this directly
no test coverage detected