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

MCMCDyn preallocates the space for logging toggles; should it be (re)allocated dynamically? #123

Closed
krivit opened this issue Aug 12, 2024 · 0 comments

Comments

@krivit
Copy link
Member

krivit commented Aug 12, 2024

MCMCDyn_wrapper() pre-allocates three integer vectors (time, tail, head), each of length control$MCMC.maxchanges, then trims them as needed. A more memory-efficient approach would be to start with a short vector and use array-doubling, either using Realloc() and then allocating the R vectors as a final step or working with R vectors and copying as needed.

@krivit krivit closed this as completed in c4e8ea3 Oct 8, 2024
krivit added a commit that referenced this issue Oct 8, 2024
fixes #123

Co-authored-by: Pavel N. Krivitsky <p.krivitsky@unsw.edu.au>
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

No branches or pull requests

1 participant