File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change
1
+ 2018-02-26 Kevin Ushey <
[email protected] >
2
+
3
+ * src/api.cpp: Always set / put RNG state when calling Rcpp function
4
+
5
+
1
6
2018-02-25 Dirk Eddelbuettel <
[email protected] >
2
7
3
8
* vignettes/Rcpp.bib: Updated
Original file line number Diff line number Diff line change 6
6
\section {Changes in Rcpp version 0.12.16 (2018 - 03 - xx )}{
7
7
\itemize {
8
8
\item Changes in Rcpp API :
9
+ \itemize {
10
+ \item Rcpp now sets and puts the RNG state upon each entry to an Rcpp
11
+ function , ensuring that nested invocations of Rcpp functions manage the
12
+ RNG state as expected
13
+ }
9
14
\itemize {
10
15
\item The \code {long long } type can now be used on 64 - bit Windows (Kevin
11
16
in \ghpr {811 })
Original file line number Diff line number Diff line change @@ -64,22 +64,17 @@ using namespace Rcpp;
64
64
namespace Rcpp {
65
65
66
66
namespace internal {
67
- namespace {
68
- unsigned long RNGScopeCounter = 0 ;
69
- }
70
67
71
68
// [[Rcpp::register]]
72
69
unsigned long enterRNGScope () {
73
- if (RNGScopeCounter == 0 ) GetRNGstate ();
74
- RNGScopeCounter++;
75
- return RNGScopeCounter;
70
+ GetRNGstate ();
71
+ return 0 ;
76
72
}
77
73
78
74
// [[Rcpp::register]]
79
75
unsigned long exitRNGScope () {
80
- RNGScopeCounter--;
81
- if (RNGScopeCounter == 0 ) PutRNGstate ();
82
- return RNGScopeCounter;
76
+ PutRNGstate ();
77
+ return 0 ;
83
78
}
84
79
85
80
// [[Rcpp::register]]
You can’t perform that action at this time.
0 commit comments