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

Allow C++ code sharing #150

Merged
merged 11 commits into from
Mar 13, 2023
Merged

Allow C++ code sharing #150

merged 11 commits into from
Mar 13, 2023

Conversation

pratikunterwegs
Copy link
Collaborator

@pratikunterwegs pratikunterwegs commented Feb 16, 2023

This pull request fixes #146, and allows the {finalsize} C++ code to be shared with other Rcpp packages, such as {epidemics}. This is a potential precursor to fixing #68, but that issue is not tackled here.

Using {finalsize} headers in a new package is relatively easy:

  1. Add 'finalsize', 'Rcpp' and 'RcppEigen' under LinkingTo in the DESCRIPTION,
  2. Add // [[Rcpp::depends(finalsize)]] in a source file,
  3. Import the {finalsize} header using #include <finalsize.h>.

@pratikunterwegs pratikunterwegs self-assigned this Feb 16, 2023
@pratikunterwegs pratikunterwegs added New feature New feature or request Cleanup Clean up files or code for readability. labels Feb 16, 2023
@pratikunterwegs pratikunterwegs changed the title Feature/share cpp Allow C++ code sharing Feb 16, 2023
@pratikunterwegs pratikunterwegs marked this pull request as ready for review February 16, 2023 14:20
@pratikunterwegs
Copy link
Collaborator Author

I've forcibly reset the branch to remove the final two commits which had moved the contact matrix processing (for the small speed boost) to the finalsize.R file. This functionality should likely stay within the C++ code for now, so that this speed boost is available to users importing the finalsize namespace in C++.

@pratikunterwegs pratikunterwegs merged commit 772ea8f into main Mar 13, 2023
@pratikunterwegs pratikunterwegs deleted the feature/share-cpp branch March 13, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Clean up files or code for readability. New feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow finalsize C++ code sharing
1 participant