[math] Add test and improve doxygen of finite difference methods#22823
Open
hageboeck wants to merge 5 commits into
Open
[math] Add test and improve doxygen of finite difference methods#22823hageboeck wants to merge 5 commits into
hageboeck wants to merge 5 commits into
Conversation
Test Results 23 files 23 suites 3d 10h 22m 19s ⏱️ Results for commit 2ba8357. |
dpiparo
approved these changes
Jul 16, 2026
ferdymercury
suggested changes
Jul 16, 2026
ferdymercury
left a comment
Collaborator
There was a problem hiding this comment.
Thanks a lot!
I'd suggest
- adding in the RelNotes of 6.38.x and 6.40.2 that using Laplacian lead to incorrect results.
- fix preexisting TMathTests to not exit 0 and multiply by four refvalues
The standard second-order central, backward and forward differences contained a mistake: a factor-of-4 error. See finite different coefficients here: https://en.wikipedia.org/wiki/Finite_difference_coefficient
Use a polynomial and its known derivatives to check the correctness of the finite difference methods.
The test failed without any consequences because it was always returning 0. Other "tests" in this file will need to be updated to check their outputs in the future. Furthermore: - The second derivatives are unstable with short, so remove it from the test. - The targets for the second derivatives were wrong by a factor 4; fix. - Due to rounding, finite differences on integers don't exactly hit the target. Allow a delta of 1.
ferdymercury
approved these changes
Jul 16, 2026
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.
Note: Contains commits of #22809.