MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Insufficient memory "General::nomem:" using Tuples

  • To: mathgroup at
  • Subject: [mg130241] Insufficient memory "General::nomem:" using Tuples
  • From: Iván Lazaro <gaminster at>
  • Date: Tue, 26 Mar 2013 04:05:50 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

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!

  • Prev by Date: Re: Table with condition
  • Next by Date: A question about numerically solving differential equations
  • Previous by thread: Re: Recursive function: What is the proper way to get mathematica to
  • Next by thread: Re: Insufficient memory "General::nomem:" using Tuples