correctly registering a plugin to use Eigen via Rcpp
问题 I'm trying to be able to use a c++ class template in R . This was my first try at a small reproducible example. library(inline) library(Rcpp) inc <- "#include <Eigen/Dense> template <size_t dim> class SillyWrapper { public: Eigen::Matrix<double,dim,1> m_vec; SillyWrapper(const Eigen::Matrix<int,dim,1>& vec) : m_vec(vec); };" src <- 'SillyWrapper mything(Rcpp::as<Eigen::Map<Eigen::Matrix<double,dim,1>>>(x));' library(inline) fun <- cxxfunction(signature(x="numeric"), body=src, includes=inc,