
6 May
2005
6 May
'05
2:58 p.m.
Daniel Fischer wrote:
The problem is that a prime crept in in Josef's code, so to calculate the positions and velocities, the updated versions of the planets are used, it should be
Ah, yes, thanks for the correction.
Besides, offset_momentum does not use the parameter n at all and I think that all the indexing in the computation of the potential energy is rather inefficient.
I wasn't too worried about the energy function, since it only gets called twice, whereas the "advance" get called potentially millions of times (and must be the source of the space leak). You can see one profile I ran (for n=1000 instead of 1000000) at... http://sleepingsquirrel.org/nbody/nbody.prof Thanks, Greg Buchholz