Re: Eliminating intermediate results
- To: mathgroup at smc.vnet.net
- Subject: [mg91578] Re: Eliminating intermediate results
- From: Ray Koopman <koopman at sfu.ca>
- Date: Thu, 28 Aug 2008 03:16:35 -0400 (EDT)
- References: <200808250905.FAA24382@smc.vnet.net> <g90bfc$n8o$1@smc.vnet.net>
On Aug 27, 3:41 am, Mariano Su=E1rez-Alvarez <mariano.suarezalva... at gmail.com> wrote: > [...] > Notice my example was just an example. The context > it came from needed not the length of the list but the > combinations themselves. P can also be used to get the compositions themselves, without using excess intermediate storage: Timing@Length[a = Select[Compositions[30,6],FreeQ[#,0]&]] Timing@Length[b = Flatten[Permutations[#+1]&/@P[30-6,6],1]] a === Sort[b] {23.97 Second,118755} {0.11 Second,118755} True
- References:
- Eliminating intermediate results
- From: Mariano Suárez-Alvarez <mariano.suarezalvarez@gmail.com>
- Eliminating intermediate results