Repository navigation
Feat extrapolation configuration - #38
Merged
Merged
Conversation
Pin the current behavior (return 0 outside the domain) for every 1D and 2D interpolator in float and double, before adding extrapolation and sentinel options. Known bugs are tagged [!shouldfail] or hidden with [.] (known-crash, known-bug). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_[xy]_index_closest_to dereferenced lower_bound(...) - 1, which reads before the start of the array for queries on the lower x or y edge, or NaN. The search result is now clamped to the data range. NaN queries now return Z(0,0) instead of an undefined value; NaN policy is left for the sentinel work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After clamping the limits to the domain, a range entirely outside it gave _a > _b. Above the domain this read past the end of the coefficient arrays; below it returned a nonzero value. Return 0 instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cover get_[xy]_index_closest_to at knots, between knots, ties, one ulp either side of a knot, outside the data, +/-inf, and NaN (valid index only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derivative() checked the interval index instead of x, so queries below x[0] used the first segment and returned a value (NaN at -inf). Use the same bounds check as operator(). derivative() and integral() now call checkData() and throw std::logic_error without data instead of dereferencing a null pointer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
operator() now calls checkData() and throws std::logic_error without data, like the other interpolators, instead of returning 0. The triangulation and z lookup read through the data views instead of the owned data vectors, which are empty when setUnsafeDataReference() is used and caused a segfault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base copy constructors always pointed the copy's views at its own data vectors, which are empty when setUnsafeDataReference() was used. 1D copies threw on every call and 2D copies aborted in setup2DDataViews(). Copies now share the reference in that case. Also fixes yView being created based on rhs.xView. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 1D and 2D regular grid interpolators require strictly increasing coordinates (x outer, y inner for grids). This is not checked. Document it in the README and the setData/setUnsafeDataReference comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Queries outside the data return 0; document what "outside" means for each method. Results for NaN coordinates are unspecified. Tests that pin current NaN results are kept as change detectors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Interpolators can now return a custom value or quiet NaN for queries outside the data (setOutOfBoundsValue, setOutOfBoundsNaN), or extrapolate (enableExtrapolation). The default is unchanged: return 0. - Linear continues the end segments. CubicSpline and Monotonic continue in a straight line with the end-point slope. Bilinear and Bicubic continue the edge patch. NearestNeighbor returns the edge value. ThinPlateSpline evaluates the spline. - LinearDelaunay cannot extrapolate; enableExtrapolation() on it is a compile error, as is setOutOfBoundsNaN() for types without a NaN. - Settings are kept by copies (including AnyInterpolator) and batch(). - derivative() and integral() are not affected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.