Is your 'n' only the planets, large moons, dwarf planets, asteroids, and 
the Sun?  Or is it the age, that you mentioned was in the billions, for 
orbits...  (sorry for my dumb questions, but the parallel part of this is 
rather interesting to me!)

On Friday, June 19, 2015 at 10:47:20 AM UTC-4, Daniel Carrera wrote:
>
>
> On 19 June 2015 at 16:20, Scott Jones <[email protected] <javascript:>
> > wrote:
>
>> Not being an astronomer, I don't know how this is supposed to be, but you 
>> have calculations based on the bod array inside the loop, but you are never 
>> updating bod...  Are you just depending on the compiler to move those out 
>> of the loop?
>>
>
>
> Oh, the program is not complete. In a real program the "bod" array would 
> be updated elsewhere. Updating the bod requires O(n) additions, 
> multiplications and memory look-ups. Computing the forces on each particle 
> requires O(n^2) additions, multiplications, divisions and memory look-ups. 
> So all attempts at optimization focus on the O(n^2) part, so that's the 
> only part that I posted.
>
> Cheers,
> Daniel
>

Reply via email to