Tag Info

New answers tagged

6

A possible alternative for getting insight on how memory efficient two approaches are, could be by using Monitor and StepMonitor functions along with MemoryInUse. For convenience a rule for converting bytes into Kbytes, and initating the variable for monitoring memory usage: rlKB := n_ :> N[n/2^10]; mem = {MemoryInUse[]}; Illustrating the use of ...


3

It is a little known fact and probably not well documented, but since version 9 one can use just strings as variables (dependent and independent) in NDSolve, which in this case helps to solve the memory problem in a rather elegant way: mpl=1/Sqrt[6.70837*10^-39]; gsT=106.75; Sup[LamdaI_?NumericQ,GammaI_?NumericQ]:=Module[{ a,rhor,Trad,tf,s,t }, ...


0

From the comments that Szabolcs gave, Clear and ClearAll are ineffective, but using Remove works. So now the module reads: Sup[\[CapitalLambda]I_?NumericQ, \[CapitalGamma]I_?NumericQ] := Module[{a, \[Rho]r, Trad, tf, s, t, result}, tf = 10/\[CapitalGamma]I; s = NDSolve[{a'[t] ==a[t]*Sqrt[(8 \[Pi])/(3 mpl^2) (\[Rho]r[t] + ...


0

This will generate it in ~300 MB chunks. Takes about 30 seconds. You can work out what to do with the chunks. Do[ chunk = Prepend[#, i] & /@ Permutations[ DeleteCases[Range@11, i] ]; doSomethingWithChunk[chunk], {i, 11}];


3

This will write the permutations to permutations.txt in list blocks of ~50,000 each. Quiet@Block[{$ContextPath}, Needs["Combinatorica`"]] len = 11 numchunk = 1000 chunks = Partition[Clip[FindDivisions[{0, len! - 1, 1}, numchunk], {0, len! - 1}, {0,len! - 1}], 2, 1] // (# + Join[{{0, 0}}, ConstantArray[{1, 0}, Length@# ...



Top 50 recent answers are included