tylermorganwall / skpr

Generates and evaluates D, I, A, Alias, E, T, G, and custom optimal designs. Supports generation and evaluation of mixture and split/split-split/N-split plot designs. Includes parametric and Monte Carlo power evaluation functions. Provides a framework to evaluate power using functions provided in other packages or written by the user.
https://tylermorganwall.github.io/skpr/
GNU General Public License v3.0
115 stars 15 forks source link

Cast to int for Eigen 3.4.0 #65

Closed eddelbuettel closed 2 years ago

eddelbuettel commented 3 years ago

Dear Tyler, dear skpr team,

Eigen 3.4.0 was released earlier in the year, and I have been asked to update RcppEigen to it. As documented in this issue at its GitHub repo, there are about nine packages that built at CRAN under the previous release, but not with the Eigen 3.4.0 changes in the release candidate package -- which can be installed via

install.packages("RcppEigen", repo="https://RcppCore.github.io/drat")

For skpr, the change is (mostly) fairly simple. Apparently Eigen 3.4.0 dislikes double variables as matrix or vector indices so in spots where you cast MatrixXd we now use MatrixXi. With that simple changes in this PR, the package installs for me. The RcppEigen pre-release from the drat repo listed above will let you test this.

It would be helpful for RcppEigen if you could apply the patch and release an updated version so that RcppEigen could be upgraded to a version with Eigen 3.4.0.

Let me know if you have any question, and please do not hesitate to reply and ask.

Cheers, Dirk (who looks after RcppEigen as a care-taker...)

GeorgeMKhoury commented 2 years ago

Thanks, Dirk!

Just by inspection, these changes should have no impact other than resolving compilation errors, but I tested them on my machine just to be sure. As you would expect, everything works fine. I can confirm that our code doesn't compile with the new version of Eigen, but these changes fix that.