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

Function af_qr_inplace

src/api/c/qr.cpp:80–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80af_err af_qr_inplace(af_array *tau, af_array in) {
81 try {
82 const ArrayInfo &i_info = getInfo(in);
83
84 if (i_info.ndims() > 2) {
85 AF_ERROR("qr can not be used in batch mode", AF_ERR_BATCH);
86 }
87
88 af_dtype type = i_info.getType();
89
90 ARG_ASSERT(1, i_info.isFloating()); // Only floating and complex types
91 ARG_ASSERT(0, tau != nullptr);
92
93 if (i_info.ndims() == 0) {
94 return af_create_handle(tau, 0, nullptr, type);
95 }
96
97 af_array out;
98 switch (type) {
99 case f32: out = qr_inplace<float>(in); break;
100 case f64: out = qr_inplace<double>(in); break;
101 case c32: out = qr_inplace<cfloat>(in); break;
102 case c64: out = qr_inplace<cdouble>(in); break;
103 default: TYPE_ERROR(1, type);
104 }
105 swap(*tau, out);
106 }
107 CATCHALL;
108
109 return AF_SUCCESS;
110}

Callers 3

TESTFunction · 0.50
qrFunction · 0.50
qrInPlaceFunction · 0.50

Calls 5

swapFunction · 0.85
isFloatingMethod · 0.80
af_create_handleFunction · 0.70
ndimsMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected