Closed GoogleCodeExporter closed 9 years ago
Sorry, for the typo: I meant of course "Add two different x/y-pairs...."
Original comment by Edgar.Bo...@googlemail.com
on 24 Sep 2013 at 6:52
Just found a new method in Math, which I was not aware of so far, and which
would solve the problem very easily:
public synchronized void add(double x, double y) {
while (mXY.get(x) != null) {
// add a very small value to x such as data points sharing the same x will
// still be added. Math.ulp delivers the smallest value which still
// leads to a change of x.
x += Math.ulp(x);
}
mXY.put(x, y);
updateRange(x, y);
}
Same should be done of course in the other add-method, which takes an
additional index as parameter.
BTW: The updateMaxDifference in IndexXYMap will not work correctly, when
put(int index, K key, V value) is used, as it compares only the last two
entries. But the index could point anywhere. I am however not sure about the
consequences, as I did not check when and why this value is used.
Original comment by Edgar.Bo...@googlemail.com
on 28 Sep 2013 at 4:52
Thanks for reporting this.
Original comment by dandrome...@gmail.com
on 31 Oct 2013 at 9:05
Original issue reported on code.google.com by
Edgar.Bo...@googlemail.com
on 24 Sep 2013 at 6:48