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

Function af_inverse_deconv

src/api/c/deconvolution.cpp:307–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307af_err af_inverse_deconv(af_array* out, const af_array in, const af_array psf,
308 const float gamma, const af_inverse_deconv_algo algo) {
309 try {
310 const ArrayInfo& inputInfo = getInfo(in);
311 const dim4& inputDims = inputInfo.dims();
312 const ArrayInfo& psfInfo = getInfo(psf);
313 const dim4& psfDims = psfInfo.dims();
314
315 DIM_ASSERT(2, (inputDims.ndims() == 2));
316 DIM_ASSERT(3, (psfDims.ndims() == 2));
317 ARG_ASSERT(4, std::isfinite(gamma));
318 ARG_ASSERT(4, (gamma > 0));
319 ARG_ASSERT(5, (algo == AF_INVERSE_DECONV_DEFAULT ||
320 algo == AF_INVERSE_DECONV_TIKHONOV));
321 af_array res = 0;
322
323 af_dtype inputType = inputInfo.getType();
324 switch (inputType) {
325 case f32: res = invDeconv<float>(in, psf, gamma, algo); break;
326 case s16: res = invDeconv<short>(in, psf, gamma, algo); break;
327 case u16: res = invDeconv<ushort>(in, psf, gamma, algo); break;
328 case s8: res = invDeconv<schar>(in, psf, gamma, algo); break;
329 case u8: res = invDeconv<uchar>(in, psf, gamma, algo); break;
330 default: TYPE_ERROR(1, inputType);
331 }
332 std::swap(res, *out);
333 }
334 CATCHALL;
335 return AF_SUCCESS;
336}

Callers 1

inverseDeconvFunction · 0.50

Calls 5

isfiniteFunction · 0.85
swapFunction · 0.85
dimsMethod · 0.45
ndimsMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected