Deconvolution/2D+: Difference between revisions

m
→‎{{header|Perl 6}}: demonstrate 'g*h' yields 'f', as per task spec
m (→‎{{header|Perl}}: a few simplifications)
m (→‎{{header|Perl 6}}: demonstrate 'g*h' yields 'f', as per task spec)
Line 1,175:
 
say "# {+@f.shape}D array:";
my @h = deconvolve-N( @g, @f );
say "h =";
pretty_print( deconvolve-N( @g, @f )h );</lang>
my @h-shaped[2;3;4] = @(deconvolve-N( @g, @f ));
my @ff = deconvolve-N( @g, @h-shaped );
say "\nff =";
pretty_print( @ff );</lang>
 
Output:
Line 1,191 ⟶ 1,196:
[ 9, 9, 4, -4 ],
[ -3, 7, -2, -3 ],
],
]
 
ff =
[
[
[ -9, 5, -8 ],
[ 3, 5, 1 ],
],
[
[ -1, -7, 2 ],
[ -5, -6, 6 ],
],
[
[ 8, 5, 8 ],
[ -2, -6, -4 ],
],
]</pre>
2,392

edits