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

Function denominator

src/api/c/deconvolution.cpp:241–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240template<typename CT>
241Array<CT> denominator(const Array<CT>& I, const Array<CT>& P, const float gamma,
242 const af_inverse_deconv_algo algo) {
243 using T = typename af::dtype_traits<CT>::base_type;
244
245 auto RCNST = createValueArray(I.dims(), scalar<T>(gamma));
246
247 if (algo == AF_INVERSE_DECONV_TIKHONOV) {
248 auto normP = complexNorm<T, CT>(P);
249 auto denom = arithOp<T, af_add_t>(normP, RCNST, normP.dims());
250
251 return cast<CT, T>(denom);
252 } else {
253 // TODO(pradeep) Wiener Filter code path is disabled.
254 // This code path doesn't is not exposed using current API
255 auto normI = complexNorm<T, CT>(I);
256 auto sRes = arithOp<T, af_sub_t>(normI, RCNST, normI.dims());
257 auto dRes = arithOp<T, af_div_t>(RCNST, sRes, RCNST.dims());
258 auto normP = complexNorm<T, CT>(P);
259 auto denom = arithOp<T, af_add_t>(normP, dRes, normP.dims());
260
261 return cast<CT, T>(denom);
262 }
263}
264
265template<typename InputType, typename RealType = float>
266af_array invDeconv(const af_array in, const af_array ker, const float gamma,

Callers 1

invDeconvFunction · 0.85

Calls 2

createValueArrayFunction · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected