On Thu, 8 Nov 2012, Pindar wrote:
Am 07.11.2012 21:42, schrieb Allin Cottrell:
> On Wed, 7 Nov 2012, Pindar wrote:
>
>> Indeed, on my W7 PC with the new snapshot the 'evals' are
>> not the same. The order within the bins is different. I
>> expected the null operation and checked other parts of the
>> code until I found the reason explained. I gonna try with
>> 'matrix K' instead of the ~ operation and report then.
> OK, I suspect this must be a difference between the
> implementation of the qsort() function in the Microsoft C
> library and the GNU C library. The C standard doesn't specify
> whether or not elements of an array passed to qsort() that
> compare equal will remain in the original order.
In CVS and snapshots I've revised the qsort comparison
function in msortby() so that the sort will be "stable" (i.e.
rows that have a common value for the sort key will never be
interchanged). Since glibc's qsort seems to be stable by
default I hadn't realized this could be an issue.
It's possible there are one or two other places in the gretl
codebase where this should be done; I'll check.
Allin Cottrell