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

Set state from arrays #7

Merged
merged 1 commit into from
May 15, 2024
Merged

Set state from arrays #7

merged 1 commit into from
May 15, 2024

Conversation

richfitz
Copy link
Member

Merge after #6, contains those commits

@richfitz richfitz changed the title Start allowing groups of parameters Set state from arrays May 10, 2024
@richfitz richfitz marked this pull request as ready for review May 13, 2024 15:19
@richfitz richfitz requested a review from weshinsley May 14, 2024 08:13
Copy link
Contributor

@weshinsley weshinsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - all good - and makes sense entirely as the extra "group" stuff compared to the previous version. I am taking a bit of time to get used to C++ templating...

(n_state_ * (recycle_particle ? 1 : n_particles_));
const auto offset_read_particle = recycle_particle ? 0 : n_state_;

real_type * state_data = state_.data();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could do auto state_it = state_.begin() really

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote the original suggestion here, and of course I can't do that because T::initial expects real_type * not an iterator...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh, and then when writing this I looked in the wrong place too, so I was wrong twice and could have done this! Doesn't really matter either way though

@richfitz richfitz merged commit 002a8d5 into main May 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants