Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #17263: fix numerical noise in _reduce_resolution_
Browse files Browse the repository at this point in the history
Allow undershooting x_min by one pixel in order to be more robust
against numerical noise.
  • Loading branch information
cheuberg committed Nov 20, 2014
1 parent 955f01b commit 912bf51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sage/combinat/fsm_fourier.pyx
Expand Up @@ -435,6 +435,10 @@ def _reduce_resolution_(data, x_min, x_max, resolution):
f = (<double> resolution)/(x_max-x_min)

for (x, y) in data:
if x < x_min and x > x_min - 1/f:
# Allow undershooting x_min by one pixel in order to be
# more robust against numerical noise.
x = x_min
if x < x_min or x >= x_max:
raise ValueError(
"x values must be >= x_min and < x_max.")
Expand Down

0 comments on commit 912bf51

Please sign in to comment.