Hi all,<div><br></div><div>I've copied the following from a portion of the "Using matrices" section of the <a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-quickref.pdf">Rcpp Quick Reference guide</a>. I get a compilation error that I'm having trouble decoding. Commenting out the third line allows it to compile, so it must be something I've done wrong with the column selector, but I don't see it. </div>
<div><br></div><div>Thanks in advance,</div><div>Chris</div><div><br></div><div>PS. My g++ version is 4.5.2, in case that helps.</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>
<div>src <- '</div><div>NumericMatrix xx(4, 5);</div><div>std::fill(xx.begin(), xx.end(), 8);</div><div>NumericMatrix::Column zzcol = xx( _, 1);</div><div>return(wrap(1));</div><div> '</div><div>fun <- cxxfunction(signature(x="numeric"), body = src, plugin="Rcpp")</div>
</div><div><br></div><div><div>file3011595e.cpp:35:39: error: invalid conversion from ‘SEXPREC*’ to ‘int’</div><div>file3011595e.cpp:35:39: error: initializing argument 1 of ‘Rcpp::Matrix<RTYPE>::Proxy Rcpp::Matrix<RTYPE>::operator()(int, int) [with int RTYPE = 14, Rcpp::Matrix<RTYPE>::Proxy = double&]’</div>
<div>file3011595e.cpp:35:39: error: conversion from ‘Rcpp::traits::storage_type<14>::type’ to non-scalar type ‘Rcpp::Matrix<14>::Column’ requested</div><div>make: *** [file3011595e.o] Error 1</div></div><div>
<br>
</div><div><br></div>