Opened 13 years ago

Closed 13 years ago

#323 closed defect (fixed)

fix bug in EvenlyDiscretizedFunction

Reported by: Peter Powers Owned by: Peter Powers
Priority: major Milestone: OpenSHA 1.3
Component: sha Version:
Keywords: Cc:


Given an EvenlyDiscretizedFunction? with a single x-value (say 6.5) and a tolerance of 0.01, any call to any method relying on getXindex(x) will be fine for values <= 6.5, but will fail above, even if within tolerance.

Change History (2)

comment:1 Changed 13 years ago by Peter Powers

The situation arose because both methods, in trying to determine an index, divide by 'delta', which is 0 for single valued functions resulting in attempts to round NaN, +Infinity, -Infinity;p the ultimate result was that for values > x(0), the index returned was -1. Both methods mentioned above were adjusted to handle the single-value case. This should not have adverse side effects unless there is code that unknowingly relies on the error. Fixed in [8054]

comment:2 Changed 13 years ago by Peter Powers

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.