Relax some floating point comparisons#670
Merged
garth-wells merged 3 commits intomainfrom May 9, 2023
Merged
Conversation
mscroggs
reviewed
May 9, 2023
| { | ||
| F v = col == row ? 1.0 : 0.0; | ||
| if (std::abs(matM(row, col) - v) > 1.0e-12) | ||
| constexpr F eps = 100 * std::numeric_limits<F>::epsilon(); |
Member
There was a problem hiding this comment.
Should this be 10.0 * and <float> to match the other line? Or are these intentionally different?
Member
Author
There was a problem hiding this comment.
Deliberate, but without good justification ;).
I made the previous 'looser' because it follows a LU factorisation. I thought this check could be stricter. Proper 'fix' would be to support float32 from Python and run the test suite, but we're not there yet.
mscroggs
approved these changes
May 9, 2023
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.
Some checks were too tight for
float32. Issues picked up in testingfloatsupport in DOLFINx.Eventually more tested is required, but only
float64is supported via the Python interface at the moment. Test should be added once the Python interface is extended.