3
我試圖從Rcpp網頁與inline
編譯簡單Rcpp example:RCPP編譯錯誤
Rcpp::NumericVector orig(vector);
Rcpp::NumericVector vec(orig.size());
std::transform(orig.begin(),orig.end(),vec.begin(),sqrt);
return Rcpp::List::create(Rcpp::Named("result")=vec,Rcpp::Named("original") =orig);
不過,我得到以下錯誤:
no matching function for call to 'transform(Rcpp::traits::storage_type<14>::type*, Rcpp::traits::storage_type<14>::type*, Rcpp::traits::storage_type<14>::type*, <unresolved overloaded function type>)
我使用Windows XP與Rtools(其它沒有STL的例子可以工作!),R 2.12.0。
@Dirk Eddelbuettel [here](http://dirk.eddelbuettel.com/code/rcpp.examples.html)你走了。它的工作原理,thx! – teucer 2011-03-14 14:34:24
好吧,我通過在'sqrt'之前添加現在需要的'::'來修復html頁面。 – 2011-03-14 14:40:59
@dirk Eddelbuettel糖'sqrt'沒有列出(至少我沒有看到它:))是否有一個所有的糖功能列表? – teucer 2011-03-14 20:45:26