RcppArmadillo: convert matrix subview to SEXP
Is there a way to convert an arma::subview<double> into an SEXP? I have
the following code after creating a matrix X in my Rcpp code:
//.... MCMC loop
if(i % skiplength == 0) {
for(unsigned int k=0; k < X.n_rows; k++) {
X(k,index) = y[k];
}
index = index + 1;
}
// return matrix of samples in columns
return Rcpp::wrap(X.submat( arma::span(0, X.n_rows - 1) ,
arma::span(discard, X.n_cols-1)));
END_RCPP
}
But I'm getting an error message specifying: cannot convert 'const
arma::subview<double>' to SEXP in initialization. Is there an easy fix to
this?
Cats are one of the most popular and companions. Those that haven’t owned a cat before should read the following article. Continue reading for some advice on how to raise a cat.
ReplyDeletehome-patubjai |
homewardboundnews |
ifakayaktour |
ifoundaschool |
juliesphototours |