From: Philippe Monnier Date: 2002-01-23T01:32:09+09:00 Subject: Re: swapping arrays > > On Wed, 23 Jan 2002, Philippe Monnier wrote: > > I've tried to comput a half array of n*(n-1) of reals > > or arrays of reals > > @prox = Array.new > > for i in 1..@bornesup-1 > > @prox[i] = Array.new > > for j in i+1..@bornesup > > @prox[i][j] = .... > > end > > end > > I improved big swap with n=510 and each @prox[i][j] containing an > > array with 16 real values. > > I guess your matrix takes 55 megs of ram ? > I've tried once it was going up to 240 megs then back to 200, but it stil takes 260 megs incremented until morning with more than 600 megs and a night of swaps but at that time I had arrays of strings inside. I guess I've made some mistakes. I coded again in computing each lines and forgetting last lines and it stil use 100 megs, but I need to keep all the array, so I worry about it. > There are lots of tricks to save a little RAM here and there, but the > biggest trick will be to download "narray". when you build your 16-element > arrays, do NArray.double(16). This will take 3 times less > RAM. (note: NArray is also multidimensional, so you could do > NArray.double(510,510,16) once, but it won't make a big difference > compared to the above change.) > > and don't forget to number indices starting from 0, or reserve an extra > unused index. > Thanks, Philippe -------------------------------------------- ENST -#- mailto:monnier@infres.enst.fr -#- http://www.infres.enst.fr/~monnier -#- T�l.(33)145817744 Fax ~3119 -#-