The stupid question is the question not asked | |
PerlMonks |
Re^3: Kronecker Productby vr (Curate) |
on Jun 22, 2022 at 21:40 UTC ( [id://11144961]=note: print w/replies, xml ) | Need Help?? |
I think dummy dimensions add only a few bytes to PDL-struct header, but your approach really physicalizes arrays from 2D to 4D (edit: well, it's still same 2D but squared dimensions for this example, sorry), which has grave consequences for performance. If no-one ever needs Kronecker product of 80x80 matrices, then count this comment as another nitpick :). + Note report of memory consumption assumes Win32, so disable/replace otherwise.
Edit 2. By the way, while we are at this example, the PDL::NiceSlice says
but I see that lone unquoted star(s) cause Perl to produce a warning: Use of uninitialized value in concatenation (.) or string so I had to insert a pair of very unsightly "1"'s, which of course devalues code nicety by half at least:). Is this a bug in PDL::NiceSlice, documentation flaw, or just me reading it incorrectly?
In Section
Seekers of Perl Wisdom
|
|