sub p{$t=pdl+pop;for(@_){ my $a=outer$t,pdl+pop; transpose($a); my $n=-1+nelem$t; $t=zeroes($n*2+1); $t->slice("$_:".($_+$n))+=$a->slice("$_,:")for 0..$n; } [list$t]}