in reply to Re: pushing multidimensional arrays
in thread pushing multidimensional arrays

The only thing I'd change in the above is to first initialise a block of zeroes (which these days is very quick) to the final size, then assign the starting information into it (using a slice, in standard PDL style), then do the calculation of norms:
$out = zeroes 4,100_000; $out->slice('0:2')->inplace->sequence; $out->slice('3') .= (($out->slice('0') ** 2) + ($out->slice('1') ** 2) +) ** 0.5;
The benefit of starting with the final size is there's only one big allocation. When loop-fusion arrives, the data will only go in and out of RAM once. Note the above slices don't need to specify the trailing ,:.