Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolation Bug #10065

Closed
OwenArnold opened this issue Mar 26, 2014 · 1 comment
Closed

Interpolation Bug #10065

OwenArnold opened this issue Mar 26, 2014 · 1 comment
Assignees
Labels
Framework Issues and pull requests related to components in the Framework High Priority An issue or pull request that if not addressed is severe enough to postponse a release.
Milestone

Comments

@OwenArnold
Copy link
Contributor

From Michael Wedel via mantid help:

Hi,

I was using Kernel::Interpolation and I think I discovered a small bug
in Interpolation::value(), line 54. This line covers the case of values
above the upper interpolation interval limit.

Currently the line reads:

return m_y[N-1]+(at-m_y[N-1])*(m_y[N-1]-m_y[N-2])/(m_x[N-1]-m_x[N-2]);
----------------------^

I think it should read:

return m_y[N-1]+(at-m_x[N-1])*(m_y[N-1]-m_y[N-2])/(m_x[N-1]-m_x[N-2]);
----------------------^

Making this change breaks InterpolationTest::test1():

Line 31: TS_ASSERT_DELTA( interpolation.value(3000), 260400.0 ,0.000000001);

The test should then be adjusted like this:

Line 31: TS_ASSERT_DELTA( interpolation.value(3000), 28000.0 ,0.000000001);
Line 52: TS_ASSERT_DELTA( interpolation.value(3000), 28000.0 ,0.000000001);

I think this is just a typo, since subtracting a y-value from an x-value
would not make much sense and in all other cases in that method, x
values are subtracted from other x-values. Tomorrow I could write the
changes and open a pull-request on github.


Keywords: PatchCandidate

@OwenArnold
Copy link
Contributor Author

This issue was originally trac ticket 9222

@OwenArnold OwenArnold added High Priority An issue or pull request that if not addressed is severe enough to postponse a release. Framework Issues and pull requests related to components in the Framework labels Jun 3, 2015
@OwenArnold OwenArnold self-assigned this Jun 3, 2015
@OwenArnold OwenArnold added this to the Release 3.2 milestone Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework High Priority An issue or pull request that if not addressed is severe enough to postponse a release.
Projects
None yet
Development

No branches or pull requests

1 participant