Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse R's RNG in default example included in skeleton package? #69
Comments
|
I am a little disappointed by this Ralf. You surely know that a non-included header is of no impact in a shared library, no? And for what it is worth I do not consider myself to be in the business of policing / editing / patching |
|
Maybe I am more dense than normal, but I do not understand why you are refering to a "non-included header" file. The above quoted file is included if one includes
Probably due to this line: One might argue that this case is pathologic. I am not sure, though, how the OP of that thread on r-pkg-devel managed to trigger that NOTE. |
|
Hm. Did anything change there? Lemme reopen then... |
|
Oh, I see now what you mean. That is a stupid example -- will change to calling R's RNG. |
|
From the top of your head, any other good initializers you'd recomment from here ? Maybe |
|
Draft: Eigen::MatrixXd rcppeigen_hello_world() {
Eigen::MatrixXd m1 = Eigen::MatrixXd::Identity(3, 3);
//Eigen::MatrixXd m2 = Eigen::MatrixXd::Random(3, 3);
Eigen::MatrixXd m2 = Eigen::MatrixXd::Zero(3, 3);
for (auto i=0; i<m2.rows(); i++)
for (auto j=0; j<m2.cols(); j++)
m2(i,j) = R::rnorm(0, 1);
return m1 + 3 * (m1 + m2);
} |
|
That removes the NOTE for the default skeleton, but the fundamental problem remains. One can trigger Eigen into using Eigen::MatrixXd rcppeigen_hello_world() {
Eigen::MatrixXd m1 = Eigen::MatrixXd::Identity(3, 3);
//Eigen::MatrixXd m2 = Eigen::MatrixXd::Random(3, 3);
Eigen::MatrixXd m2 = Eigen::MatrixXd::Zero(3, 3);
for (auto i=0; i<m2.rows(); i++)
for (auto j=0; j<m2.cols(); j++)
m2(i,j) = R::rnorm(0, 1);
Eigen::RealQZ<Eigen::MatrixXd> qz(3);
qz.compute(m1,m2);
return m1 + 3 * (m1 + m2);
}since RcppEigen/inst/include/Eigen/src/Eigenvalues/RealQZ.h Lines 439 to 442 in 9abb401 |
|
I am sorry. I do not understand what you're after here. I believe we are both aware that Writing R Extensions and the As opposed to enumerating all possible ways to trigger it. So why would As I said at the outset, I do not consider myself here in the role of an editor or reviewer for Eigen code. If they include code that may trigger R warnings I officially do not care. I am here to support the basic use cases not involving |
|
I meanwhile think that the OP of that r-pkg-devel thread used the
|
|
Yes. Writing R Extension does that. R CMD check checks for it. But I also do not do house visits to patch their system's C library. |
Ok, fair enough. In that case the proposed change to |
|
Good to have agreement. Shipping examples that trigger warnings and hence do not provide best practives is something I don't like so thanks for pointing me here. That had long been overlooked. |
RcppEigen/inst/include/Eigen/src/Core/MathFunctions.h
Line 560 in 9abb401
Shouldn't R's RNG be used here?
(Reference: https://stat.ethz.ch/pipermail/r-package-devel/2019q1/003687.html)