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

Function af_svd

src/api/c/svd.cpp:73–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73af_err af_svd(af_array *u, af_array *s, af_array *vt, const af_array in) {
74 try {
75 const ArrayInfo &info = getInfo(in);
76 dim4 dims = info.dims();
77
78 ARG_ASSERT(3, (dims.ndims() >= 0 && dims.ndims() <= 2));
79 af_dtype type = info.getType();
80
81 if (dims.ndims() == 0) {
82 AF_CHECK(af_create_handle(u, 0, nullptr, type));
83 AF_CHECK(af_create_handle(s, 0, nullptr, type));
84 AF_CHECK(af_create_handle(vt, 0, nullptr, type));
85 return AF_SUCCESS;
86 }
87
88 switch (type) {
89 case f64: svd<double>(s, u, vt, in); break;
90 case f32: svd<float>(s, u, vt, in); break;
91 case c64: svd<cdouble>(s, u, vt, in); break;
92 case c32: svd<cfloat>(s, u, vt, in); break;
93 default: TYPE_ERROR(1, type);
94 }
95 }
96 CATCHALL;
97 return AF_SUCCESS;
98}
99
100af_err af_svd_inplace(af_array *u, af_array *s, af_array *vt, af_array in) {
101 try {

Callers 1

svdFunction · 0.50

Calls 4

af_create_handleFunction · 0.70
dimsMethod · 0.45
ndimsMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected