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

Energy Grid Interpolation Rounding Error #11

Closed
HunterBelanger opened this issue Oct 11, 2021 · 0 comments · Fixed by #12
Closed

Energy Grid Interpolation Rounding Error #11

HunterBelanger opened this issue Oct 11, 2021 · 0 comments · Fixed by #12
Labels
bug Something isn't working

Comments

@HunterBelanger
Copy link
Owner

Currently, it appears that round-off error is occurring when an EnergyGrid instance is constructed directly from an std::vector<double>, as it first converts all of the values to floats, and then saves them as doubles. This is a remnant of when I used to store XS data as floats. It should suffice to just pass the energy argument to the energy_values_ member in the class initialization, and remove the entire for loop at line 63.

energy_values_[i] = static_cast<float>(energy[i]);

@HunterBelanger HunterBelanger added the bug Something isn't working label Oct 11, 2021
@HunterBelanger HunterBelanger added this to To do in Road to v0.3.0 via automation Oct 11, 2021
@HunterBelanger HunterBelanger moved this from To do to In progress in Road to v0.3.0 Oct 11, 2021
Road to v0.3.0 automation moved this from In progress to Done Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant