Hello and sorry for the probably stupid question. I studied a bit of C++ in my past but in the last years I've only used R. I need to transform some R code for a package I wrote using Rcpp and in particular, I'm using RcppArmadillo. Now I checked the documentation but I spent the last hours trying to make this work. Let's say I have a matrix A and a vector of indices idx. If I want to extract a submatrix containing only the rows corresponding to the indices contained in idx, in R I'd do:
A[idx,]
while in Armadillo I'm doing this:
A.rows(idx);
where A is a mat
object. However, I get the following error:
not matching function for call to 'arma::Mat<double>::rows(arma::vec&)'
What am I doing wrong?
Thanks in advance for the help!