RcppCore / RcppEigen

Rcpp integration for the Eigen templated linear algebra library
Other
110 stars 40 forks source link

"eigen_version" unexposed but stated in manual #71

Closed cyianor closed 5 years ago

cyianor commented 5 years ago

In the RcppEigen vignette, on page 2, an example is given: Calling

.Call("eigen_version", FALSE)

is supposed to return the version of Eigen used in RcppEigen, after loading the package. However, doing so in RcppEigen, version 0.3.3.5.0, leads to

> library(RcppEigen)
> .Call("eigen_version", FALSE)
# Error in .Call("eigen_version", FALSE) :
#  C symbol name "eigen_version" not in load table

I am wondering if eigen_version was removed and this is expected behaviour (in which case the vignette is out of date) or if something might have gone wrong when I installed RcppEigen.

A call to sessionInfo() returns the following

R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin18.5.0 (64-bit)
Running under: macOS Mojave 10.14.5

Matrix products: default
BLAS/LAPACK: /usr/local/Cellar/openblas/0.3.6_1/lib/libopenblasp-r0.3.6.dylib

locale:
[1] en_GB/UTF-8/en_GB/C/en_GB/en_GB

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] RcppEigen_0.3.3.5.0 colorout_1.2-0

loaded via a namespace (and not attached):
[1] compiler_3.6.0  Matrix_1.2-17   Rcpp_1.0.1      grid_3.6.0
[5] lattice_0.20-38

EDIT: I tested RcppEigen with the transpose example on page 5 in the vignette, which works fine.

eddelbuettel commented 5 years ago

It's simply internal:

R> library(RcppEigen)
R> RcppEigen:::eigen_version(TRUE)
[1] 30305
R> RcppEigen:::eigen_version(FALSE)
major minor patch 
    3     3     5 
R> 

The .Call() pattern is historic and what we used to do before Rcpp Attributes. I'll update the vignette.