Re: qsort() results: implementation dependent?




How is it "wrong"? Are you sure your get_distance function is
correct? Do the points that are mis-ordered have nearly identical
distances? Are you sure you're invoking qsort() correctly?

Yes, the functions works correctly and they have been tested
extensively. The qsort() call is not an issue.


We can only point out flaws in code that you post. If you show us an
actual program that exhibits the problem, we can help. If not, we
can't guess.

I know what you mean, and you are right. Unfortunately the code is not
free and I am not allowed to distribute it...
Anyway, I will investigate better the "undefined behaviour" tip, since
this should be the problem. Up to now the algorithm has been used with
small lists and its application to larger vectors may results in such a
strange behaviour.
Thanks
Max



--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.

.