Skip to content
Prev 5185 / 10988 Next

[Rcpp-devel] problem compiling with const in RcppEigen

Sorry but I am still struggling (even after reformatting the source code)
to understand what the problem is.  For one thing it is not clear to me
what the Cm_class is for.

The fundamental rule for me is that I always declare functions like

//[[Rcpp::Export]]
Eigen::VectorXd testfunc(const MapVecd ytrait, const MapMatd xmat) {
   ...
}

If you need to get a pointer to the contents of the matrix you could use a
const_cast but in that case I don't understand why you would use the Eigen
classes.  If all you want is the dimensions and a pointer to the contents
you should use NumericMatrix class.
On Thu, Jan 31, 2013 at 1:27 PM, M A <markoilcan at gmail.com> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130131/703aa9b9/attachment-0001.html>