RosettaCodeData/Task/Deconvolution-1D/Zkl/deconvolution-1d-1.zkl

9 lines
256 B
Text
Raw Permalink Normal View History

2017-09-23 10:01:46 +02:00
var [const] GSL=Import("zklGSL"); // libGSL (GNU Scientific Library)
fcn dconv1D(f,g){
fsz,hsz:=f.len(), g.len() - fsz +1;
A:=GSL.Matrix(g.len(),hsz);
foreach n,fn in ([0..].zip(f)){ foreach rc in (hsz){ A[rc+n,rc]=fn } }
h:=A.AxEQb(g);
h
}