【发布时间】:2015-09-01 09:35:31
【问题描述】:
之前有人问过类似的问题,这里:
问题是,我在 fastLm.cpp 中找到的代码(最后)对我不起作用。
Rcpp::NumericVector X( (SEXP) R.parseEval("x <- 1:10"));
Eigen::Map<Eigen::VectorXd> XS(Rcpp::as<Eigen::Map<Eigen::VectorXd>>(X)); //!!not working
它给出了以下错误:
error: no matching constructor for initialization of 'Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >'
Exporter( SEXP x ) : t(x){}
和(除其他外):
note: candidate constructor (the implicit copy constructor) not viable: cannot convert argument of incomplete type 'SEXP' (aka 'SEXPREC *') to 'const Eigen::Map<Eigen::Matrix<double, -1, 1, 0, -1, 1>, 0, Eigen::Stride<0, 0> >'
template<typename PlainObjectType, int MapOptions, typename StrideType> class Map
可能与 SEXP 对象有关?
【问题讨论】: