Re: [Rcpp-devel] type information about elements in Rcpp::List

2012-05-08 Thread Dirk Eddelbuettel
On 8 May 2012 at 23:17, Jiqiang Guo wrote: | Suppose I have a function in CPP as  | | void cppfun(Rcpp::List lst) { |     .. | } | | Then I would like to call this cppfun in R code as say  | cppfun(list(a=a, b=b, c=c, ...)), in which  (Well you need a SEXP somefun(SEXP ...) interface from R

[Rcpp-devel] type information about elements in Rcpp::List

2012-05-08 Thread Jiqiang Guo
Hi, Thank Dirk first for replying to my previous questions so fast. Another question: Suppose I have a function in CPP as void cppfun(Rcpp::List lst) { .. } Then I would like to call this cppfun in R code as say cppfun(list(a=a, b=b, c=c, ...)), in which a, b, c could be of different t

Re: [Rcpp-devel] help packaging Rcpp modules

2012-05-08 Thread Dirk Eddelbuettel
On 8 May 2012 at 18:34, James Simone wrote: | Hi Dirk, | | Thank You for the quick reply. | | | After reading many posts, I found your suggestion works: | | > R.version.string | [1] "R version 2.13.1 (2011-07-08)" | > require(Rcpp) | > dl <- dyn.load("mod.so") | > mod <- Module("mod",PACKA

Re: [Rcpp-devel] help packaging Rcpp modules

2012-05-08 Thread Dirk Eddelbuettel
James, On 8 May 2012 at 17:51, James Simone wrote: | I have followed the Rcpp developer's recommendation that a package | greatly simplifies using RCPP_MODULE wrappering. Unfortunately, I'm | having difficulty building and checking even a simple package | containing an Rcpp module. I have read pr

Re: [Rcpp-devel] help packaging Rcpp modules

2012-05-08 Thread James Simone
Hi Dirk, Thank You for the quick reply. After reading many posts, I found your suggestion works: > R.version.string [1] "R version 2.13.1 (2011-07-08)" > require(Rcpp) > dl <- dyn.load("mod.so") > mod <- Module("mod",PACKAGE=dl) > mod$norm(1,2) [1] 2.236068 On 05/08/2012 06:14 PM, Dirk Eddelb

Re: [Rcpp-devel] help packaging Rcpp modules

2012-05-08 Thread Dirk Eddelbuettel
Hi James, On 8 May 2012 at 17:51, James Simone wrote: | I have followed the Rcpp developer's recommendation that a package | greatly simplifies using RCPP_MODULE wrappering. Unfortunately, I'm | having difficulty building and checking even a simple package | containing an Rcpp module. I have read

[Rcpp-devel] help packaging Rcpp modules

2012-05-08 Thread James Simone
I have followed the Rcpp developer's recommendation that a package greatly simplifies using RCPP_MODULE wrappering. Unfortunately, I'm having difficulty building and checking even a simple package containing an Rcpp module. I have read previous posts on this topic but I did not find anything helpf

Re: [Rcpp-devel] Compilation error using Rcpp::as

2012-05-08 Thread Jelmer Ypma
Dear Douglas, many thanks for your quick reply, that's exactly what I was looking for. Best wishes, Jelmer On Tue, May 8, 2012 at 5:33 PM, Douglas Bates wrote: > Thanks for the report.  It is a problem in the 'as' methods defined > for Eigen objects. > > I will fix that but I think what you are

Re: [Rcpp-devel] Compilation error using Rcpp::as

2012-05-08 Thread Douglas Bates
Thanks for the report. It is a problem in the 'as' methods defined for Eigen objects. I will fix that but I think what you are trying to do is more easily accomplished by using a copy constructor in C++, as in the enclosed On Tue, May 8, 2012 at 10:45 AM, Jelmer Ypma wrote: > Hi all, > > I've b

[Rcpp-devel] Compilation error using Rcpp::as

2012-05-08 Thread Jelmer Ypma
Hi all, I've been happily using the RcppEigen package for a couple of projects, but now I'm running into problems converting a matrix from R into an Eigen::MatrixXd. Converting an R matrix to an Eigen::Map works fine, but I would like to (deep)copy the values from R to a C++ Eigen::MatrixXd object