in reply to Expanding Two demensional arrays

You might consider using PDL. Piddles use far less space than normal Perl arrays. Also (I think; you'll need to explore it or consult an PDL expert), it would be able to combine the two piddles into a third using it's Dataflow feature, in a way that would not cause them to be copied wholesale and therefore, would use even less space.

In theory, assuming your numbers are 32-bit ints, a piddle would require ~1/3 or 1/4 the space of an equivalent Perl array. And, if the Dataflow aliasing will work to allow you create the 3rd array as an mapping over the other two, it possible the memory requirement for holding all 3 piddles could be close to 1/6 th of the space required by the Perl solutions. PDL is also renowned for doing what it does very quickly.

Sorry for the scant information, but I really don't know much about PDL, so take this suggestion with a huge handful of salt.

With luck lin0 or Zaxo or one of the other monks with PDL expertise will read this and expand further or shoot me down in flames.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."