Insufficient memory "General::nomem:" using Tuples
- To: mathgroup at smc.vnet.net
- Subject: [mg130241] Insufficient memory "General::nomem:" using Tuples
- From: Iván Lazaro <gaminster at gmail.com>
- Date: Tue, 26 Mar 2013 04:05:50 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
Hi all!
I've encounter a weird behavior today using Mathematica 9 under Linux.
I'm defining a list of available modes
num = 15;
maxModes = ConstantArray[2, num];
and then trying to organize them in all possible tuples
lst=Tuples[Range[0, #] & /@ Join[maxModes - 1, maxModes - 1]];
I expect a BIG number of outcomes, but then I'm just removing some
(almost all) of them from the list:
lst1=DeleteCases[Map[If[Total@Take[#, num] != Total@Take[#, {num + 1, 2 num}],
sym, #] &,lst], _Symbol];
The problem is that the computation doesn't finish building the
tuples. I'm getting the output "General::nomem: The current
computation was aborted because there was insufficient memory
available to complete the computation."
Is there a way to avoid this?
Thanks in advance!