-
Notifications
You must be signed in to change notification settings - Fork 5
Harness creation improvements #5
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
Conversation
|
Another problem is that 'RcppDeepState_CharacterVector' uses int str_len = 20;
rand_charactervec[i] = DeepState_CStr_C(str_len, "abcdefghijklmnopqrstuvwxyz");
rand_charactervec[i] = DeepState_CStrUpToLen(str_len, "abcdefghijklmnopqrstuvwxyz");It is preferable to construct a string of length 1 instead of generating 20 characters and taking only the first. |
|
The RInside part was discussed in this blog post and solved in the commit 9d7413e of the pull request #6. |
|
@tdhock if you agree with me I merge these changes into master. This pull request is meant to solve some minor bugs inside the |
|
I'm not sure I understand the string issue, can you please clarify? |
|
I got confused by the C/C++ notation where a character vector is a vector composed of single characters. However I can see that in R a character vector is composed by strings. I revert that change. |
|
In the last commit I removed the |
|
I also removed the |
|
in C++ Rcpp::CharacterVector ch_vec(2); has elements ch_vec[0], ch_vec[1] both of which are strings. |
|
Thank you @tdhock for the clarification. I don't understand this naming choice of Rcpp, in fact when I write Is it possible that the lack of a distinction between a character and a string in R is the cause of this? |
|
clarifications:
|
|
Thank you for the clarification, @tdhock. Now I can see the distinction. I close this pull request. |
Description
The purpose of this pull request is to enhance the RcppDeepState harness creation procedure.
The issue I found is that the RInside library stops the test harness with the warning
R is already initialized. This problem is due to the fact that during the course of an application's lifetime, no more than one RInside object can be generated. Making the RInside variable static is the solution.