-
Notifications
You must be signed in to change notification settings - Fork 33
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
Avoid the use of intermediate storage arrays in computing bounding boxes. #326
Conversation
@alarshi FYI. |
Codecov Report
@@ Coverage Diff @@
## master #326 +/- ##
==========================================
- Coverage 98.90% 98.90% -0.01%
==========================================
Files 75 75
Lines 4277 4275 -2
==========================================
- Hits 4230 4228 -2
Misses 47 47
Continue to review full report at Codecov.
|
|
@bangerth : Thank you for sharing the modification, I did not know it could be computed this way. |
Thanks for the pull request. Could you elaborate a bit on what the advantage of using lambda functions here is? It is turning four short one line functions into four 5 line function. Is this faster for you computations? |
The idea is this: You already have the The code may be slightly more difficult to read, but it avoids the need to copy the data into two arrays. (It's ok if you don't like the approach and don't want to merge it. It's just something I saw and thought could be made more efficient. But I'm not married to the patch :-) ) |
hmm, I can see where you are coming from and that should definitely be more efficient, although I am not seeing much in the benchmarks. The more I think about it, I do like the approach of not having to copy stuff around needlessly. I am wondering though whether it can be simplified into for example this:
This compiles and passes the tests on my computer, and looks easier to read to me. I think it would be even better if the
This also compiles and passes the tests for me. What is your opinion on these options? |
You're totally right with making this more readable. I've adapted the first idea. I don't think the second one is a benefit because you're changing what the function does based on the |
Yes, that looks more readable to me, thanks for making the changes! Could you also apply the same changes to the subducting plate file? As for the coverage testing, the coverage has not been changed, but for some reason it doesn't recognize |
Done as suggested! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes and also the small fixes you made along the way :)
This is ready to merge now!
Follow-up to #264.