Erm... i dont understand, its not really the point how fast sqrt() is , the main thing is your doing an extra calculation that is completly redundant,
If you have 10,000 atoms then 10,000*10,000 sqrt()'s has an effect on performance,
It must be better to do just one $cutoff_dist**2?
However i do agree that the any improovments to the brute force method would be better,
Cheers , monkey_boy
I should really do something about this apathy ... but i just cant be bothered
Comment on Re: Re: Re: Processing data with lot of math...
I'm sorry, you are right that it's always good to avoid redundant operations. I just wanted to point out that sqrt was not a likely bottleneck, but that the algorithm was the problem (and in that we agree). By avoiding sqrt you might get a size-independent 5% percent improvement if you are lucky, but by using a better algorithm you get a 99% improvement for sufficiently large systems if you have N^1 scaling instead of N^2 (note: by improvement I mean reduction in execution time).