RE: Limit to length of lists?
- To: mathgroup at smc.vnet.net
- Subject: [mg34159] RE: [mg34140] Limit to length of lists?
- From: "David Park" <djmp at earthlink.net>
- Date: Tue, 7 May 2002 03:53:55 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Bob, Unfortunately, you are not telling us exactly what you did. It looks like ss did not get set to a list. If you feed ss to the kernel what do you get? Anyway, on a Windows98 machine there is no problem in storing a list of that size. Here I make a 40000 long list of your maximum number size. ss = Table[2^32, {40000}]; Length[ss] 40000 ss[[10000]] 4294967296 MemoryInUse[] 2723504 David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ > From: Bob Harris [mailto:nitlion at mindspring.com] To: mathgroup at smc.vnet.net > > Howdy, > > I'm running into a problem where it seems like you just aren't allowed to > assign a list of 40 thousand integers to a variable. > > I've narrowed the failure down to the steps shown below. Originally I was > trying to import a large list, but when that failed I started > trying to see > just what worked and what didn't, and found that the problem has > nothing to > do with importing. The computation in the following will seem > strange, but > it creates a list that similar to one that I couldn't import. The > computation is probably not related to the problem either. > > (1) In mathematica, I create a 40,000 entry list of numbers in the range > 1..2^32/40000, and assign it to the variable tt. > > (2) Then I change the list so that each entry is the sum of the previous > entries. This results in a sorted list where the numbers range > from about 1 > to about 2^32. > > (3) Then I display that list, and cut and paste the whole list into an > assignment to a variable named ss. ss has not been previously used. The > asignment doesn't generate any complaints from Mathematica. The > assingment > looks like this: > ss = {44672, ... , 2142701433}; > where the ... stands for 39,998 elements that I've left out of this mail > message. > > (4) I then ask for Length[ss] and am told that it is zero. This is > surprising, since the original list (which was created using Mathematica > functions rather than just a big assignment) had the desired length (i.e. > Length[tt] is 40000. > > (5) Attempts to index into ss also fail. For example, ss[[1]] > gives me the > messages > Part::partd: > Part specification ss[[1]] is longer than depth of object. > > (6) After quitting and relaunching Mathematica, I've tried doing > steps 3, 4, > and 5 by themselves. The failure is the same. > > Anyone have any idea what's goin on here? And how I can correct it? I've > wandered so far away from what I was originally trying to do, I'm starting > to get pretty frustrated. Is there some artificial limit imposed on the > length of lists? Is there some way I can control it? > > I'm using Mathematica 4.0.1.0 on a G3 Mac running OS 9.0.4. I've > got it set > up to provide 20 MB for Mathematica and 30 MB for MathKernel. > > Thanks for any help, > Bob H > >