Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-25 Thread Søren Højsgaard
: Søren Højsgaard; rcpp-devel@lists.r-forge.r-project.org Subject: Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix On Sat, Jan 19, 2013 at 10:38 AM, Douglas Bates mailto:ba...@stat.wisc.edu>> wrote: On thinking about this a bit more, the dimnames should be cloned

Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-19 Thread Dirk Eddelbuettel
Hi again, On 19 January 2013 at 22:13, Søren Højsgaard wrote: | Thanks for your help. As I understand it, Dougs solution is to first wrap the | result and then deal with attributes afterwards. An example in the gallery | would perhaps be welcome? Yes, the gallery is open for contributions. So i

Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-19 Thread Søren Højsgaard
Bates Sent: 19. januar 2013 16:58 To: Dirk Eddelbuettel Cc: Søren Højsgaard; rcpp-devel@lists.r-forge.r-project.org Subject: Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix On Sat, Jan 19, 2013 at 10:38 AM, Douglas Bates mailto:ba...@stat.wisc.edu>> wrote: On th

Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-19 Thread Dirk Eddelbuettel
On 19 January 2013 at 10:38, Douglas Bates wrote: | The Eigen sparse matrix only contains the numeric information, it doesn't | contain information like Dimnames that are specific to the R structure.  If | you want to access the slots or set their values it is easiest to do that with | the Rcpp::S

Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-19 Thread Douglas Bates
On Sat, Jan 19, 2013 at 10:38 AM, Douglas Bates wrote: > On thinking about this a bit more, the dimnames should be cloned before being assigned, otherwise you end up with two references to the same storage. And once you try to clone you get into the SlotProxy area where you need to know what you

Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-19 Thread Douglas Bates
The Eigen sparse matrix only contains the numeric information, it doesn't contain information like Dimnames that are specific to the R structure. If you want to access the slots or set their values it is easiest to do that with the Rcpp::S4 class object. Of course it helps to use R's str function

Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-19 Thread Dirk Eddelbuettel
sts.r-forge.r-project.org | Subject: Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix | | | Hi Søren, | | On 18 January 2013 at 23:07, Søren Højsgaard wrote: | | Dear all, | | I put a sparse "dgCMatrix" into RcppEigen code as a sparse matrix. In Rcpp I create

Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-19 Thread Søren Højsgaard
Message- From: Dirk Eddelbuettel [mailto:e...@debian.org] Sent: 19. januar 2013 00:18 To: Søren Højsgaard Cc: rcpp-devel@lists.r-forge.r-project.org Subject: Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix Hi Søren, On 18 January 2013 at 23:07, Søren Højsgaard wrote

Re: [Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-18 Thread Dirk Eddelbuettel
Hi Søren, On 18 January 2013 at 23:07, Søren Højsgaard wrote: | Dear all, | I put a sparse "dgCMatrix" into RcppEigen code as a sparse matrix. In Rcpp I create a new matrix of same dimensions as the input matrix. I would like to copy the dimnames from the input matrix to the output matrix. Can

[Rcpp-devel] RcppEigen: Getting and setting dimnames of sparse matrix

2013-01-18 Thread Søren Højsgaard
Dear all, I put a sparse "dgCMatrix" into RcppEigen code as a sparse matrix. In Rcpp I create a new matrix of same dimensions as the input matrix. I would like to copy the dimnames from the input matrix to the output matrix. Can this be done? (It is essential that I can stick to working with spa