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

Function svdInPlace

src/api/c/svd.cpp:52–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51template<typename T>
52static inline void svdInPlace(af_array *s, af_array *u, af_array *vt,
53 af_array in) {
54 const ArrayInfo &info = getInfo(in); // ArrayInfo is the base class which
55 dim4 dims = info.dims();
56 int M = dims[0];
57 int N = dims[1];
58
59 using Tr = typename dtype_traits<T>::base_type;
60
61 // Allocate output arrays
62 Array<Tr> sA = createEmptyArray<Tr>(dim4(min(M, N)));
63 Array<T> uA = createEmptyArray<T>(dim4(M, M));
64 Array<T> vtA = createEmptyArray<T>(dim4(N, N));
65
66 svdInPlace<T, Tr>(sA, uA, vtA, getArray<T>(in));
67
68 *s = getHandle(sA);
69 *u = getHandle(uA);
70 *vt = getHandle(vtA);
71}
72
73af_err af_svd(af_array *u, af_array *s, af_array *vt, const af_array in) {
74 try {

Callers 4

TESTFunction · 0.50
svdInPlaceTestFunction · 0.50
checkInPlaceSameResultsFunction · 0.50
TESTFunction · 0.50

Calls 4

getHandleFunction · 0.70
dim4Class · 0.50
minFunction · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected