Saul Teukolsky
11-11-2004, 02:54 PM
The lines
if ((d1=data1[j1]) <= (d2=data2[j2])) fn1=j1++/en1;
if (d2 <= d1) fn2=j2++/en2;
should be
if ((d1=data1[j1]) <= (d2=data2[j2])) fn1=++j1/en1;
if (d2 <= d1) fn2=++j2/en2;
(i.e., change j1++ to ++j1 and similarly for j2).
This bug skips the contribution from the first data point (if any),
so it is negligible for reasonably large data sets. But you would
definitely notice it on small test cases.
This bug is present only in the C++ code, and only in v2.10 and
v2.11.
Thanks to Heng Sun for reporting this.
if ((d1=data1[j1]) <= (d2=data2[j2])) fn1=j1++/en1;
if (d2 <= d1) fn2=j2++/en2;
should be
if ((d1=data1[j1]) <= (d2=data2[j2])) fn1=++j1/en1;
if (d2 <= d1) fn2=++j2/en2;
(i.e., change j1++ to ++j1 and similarly for j2).
This bug skips the contribution from the first data point (if any),
so it is negligible for reasonably large data sets. But you would
definitely notice it on small test cases.
This bug is present only in the C++ code, and only in v2.10 and
v2.11.
Thanks to Heng Sun for reporting this.