Re: [Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Ramon Diaz-Uriarte
On Mon, 10 Dec 2012 17:06:06 +0100,Romain Francois wrote: > the .col method gives you a subview_col : >arma_inline subview_col col(const uword col_num); >arma_inline const subview_col col(const uword col_num) const; > not an umat. > The name of the class implies that it is a "

Re: [Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Romain Francois
Le 10/12/12 17:06, Romain Francois a écrit : the .col method gives you a subview_col : arma_inline subview_col col(const uword col_num); arma_inline const subview_col col(const uword col_num) const; not an umat. The name of the class implies that it is a "view" class, so a way to l

Re: [Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Romain Francois
the .col method gives you a subview_col : arma_inline subview_col col(const uword col_num); arma_inline const subview_col col(const uword col_num) const; not an umat. The name of the class implies that it is a "view" class, so a way to look a data from another class. hence, no data o

[Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Ramon Diaz-Uriarte
Dear All, I am trying to pass columns from an Armadillo matrix to a function, but I'd like to pass just a reference to the column, not a copy of the column and I do not seem to be able to do it "elegantly". The code below (function f1) I think shows that passing X.col to a function creates a co