MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / lu_inplace

Function lu_inplace

src/backend/opencl/cpu/cpu_lu.cpp:127–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125
126template<typename T>
127Array<int> lu_inplace(Array<T> &in, const bool convert_pivot) {
128 dim4 iDims = in.dims();
129 int M = iDims[0];
130 int N = iDims[1];
131
132 int pivot_dim = min(M, N);
133 Array<int> pivot = createEmptyArray<int>(af::dim4(pivot_dim, 1, 1, 1));
134 if (convert_pivot) { pivot = range<int>(af::dim4(M, 1, 1, 1)); }
135
136 mapped_ptr<T> inPtr = in.getMappedPtr();
137 mapped_ptr<int> piPtr = pivot.getMappedPtr();
138
139 getrf_func<T>()(AF_LAPACK_COL_MAJOR, M, N, inPtr.get(), in.strides()[1],
140 piPtr.get());
141
142 if (convert_pivot) { convertPivot(piPtr.get(), M, min(M, N)); }
143
144 return pivot;
145}
146
147#define INSTANTIATE_LU(T) \
148 template Array<int> lu_inplace<T>(Array<T> & in, \

Callers 1

luFunction · 0.70

Calls 7

convertPivotFunction · 0.70
minFunction · 0.50
dim4Class · 0.50
dimsMethod · 0.45
getMappedPtrMethod · 0.45
getMethod · 0.45
stridesMethod · 0.45

Tested by

no test coverage detected