-
Notifications
You must be signed in to change notification settings - Fork 3
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
181: pre-assign sizes to variables #182
Conversation
alternative approach would be to pass these to the function as they're available as data anyway |
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.
Nice. Do you think this makes the code easier or harder to parse? I think for me maybe it is a little harder like this but only a little
There is also some speed considerations (annoyingly touchstone is down) my assumption is that this approach would be slightly faster due to the reduction in repeated work.
I think with the latter considerations probably worth doing.
Also quite a few contributions now so I guess its aut time (wow).
alternative approach would be to pass these to the function as they're available as data anyway
I think we want to avoid this as the more you have to pass the harder these functions become to use for people in my view
I would agree with this, and that it's worth doing overall (especially as it won't work on my laptop with the latest version of cmdstan otherwise). |
Half a day of contributions - depends on where you want to set the bar really. |
I want to set it very low |
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.
Nice LGTM
Description
This PR closes #181.
It fixes the issue by assigning sizes to int first (where type conversion is permitted) and then brace-initialise.
If we agree on the solution I'll add a new news item.
Checklist