1580 Reuse flow difference vector - #1581
Open
HenrZu wants to merge 2 commits into
Open
Conversation
2 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1581 +/- ##
==========================================
- Coverage 97.48% 97.47% -0.02%
==========================================
Files 190 190
Lines 16030 16036 +6
==========================================
+ Hits 15627 15631 +4
- Misses 403 405 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
reneSchm
requested changes
Aug 3, 2026
| // To incorporate external changes to the last values of pop_result (e.g. by applying mobility), we only | ||
| // calculate the change in population starting from the last available time point in m_result, instead | ||
| // of starting at t0. To do that, the following difference of flows is used. | ||
| model.get_derivatives(flows - Base::get_flows().get_value(pop_result.get_num_time_points() - 1), |
Member
There was a problem hiding this comment.
I am a little surprised that this used to allocate at all. I assumed this would be an Eigen difference expression. Do you know where exactly the allocation occurs?
Comment on lines
+108
to
+111
| Eigen::VectorX<FP>& get_flow_delta() | ||
| { | ||
| return m_flow_delta; | ||
| } |
Member
There was a problem hiding this comment.
I don't think exposing a temporary is a good idea, maybe make it protected? Or just use one vector each, the storage cost is not too bad.
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.
Changes and Information
Please briefly list the changes (main added features, changed items, or corrected bugs) made:
If need be, add additional information and what the reviewer should look out for in particular:
Merge Request - Guideline Checklist
Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.
Checks by code author
Checks by code reviewer(s)