Opened 10 years ago
Closed 9 years ago
#468 closed task (fixed)
Externalize discretized function interpolation implementations
Reported by: | Kevin Milner | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | commons | Version: | |
Keywords: | Cc: |
Description
Currently lots of interpolation code is duplicated between discretized function implementations. Generic implementations should be externalized to a utility class.
Change History (3)
comment:1 Changed 10 years ago by
comment:2 Changed 9 years ago by
I removed all of the duplicate code by creating abstract implementations in AbstractDiscretizedFunc? which pass through to the following methods:
org.opensha.commons.data.function.AbstractDiscretizedFunc?.getInterpolatedY(double, boolean, boolean)
org.opensha.commons.data.function.AbstractDiscretizedFunc?.getFirstInterpolatedX(double, boolean, boolean)
These methods, in turn, use Interpolate.java for the actual implementation, but don't defer fully to that class as turning the functions to arrays of x/y values would be computationally expensive.
Done in [10918], not closing until it is merged back to trunk. We have a pretty complete set of unit tests for these functions, and this new implementation passes those tests.
comment:3 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixes/updates merged to trunk in [10931], closing.
see Interpolate.java. Methods of class will extrapolate, but this may not be what is desired in all cases. No data checking is done either.