Re: [Rcpp-devel] exposing a C++ function to RInside

2012-08-18 Thread Stephen J. Barr
On Sat, Aug 18, 2012 at 3:46 PM, Dirk Eddelbuettel wrote: > > On 18 August 2012 at 14:08, Stephen J. Barr wrote: > | Hello, > | > | I have a quick design question. I am working on a program that uses > RInside and > | RcppEigen, and I want to expose a function back to R. Spe

[Rcpp-devel] exposing a C++ function to RInside

2012-08-18 Thread Stephen J. Barr
Hello, I have a quick design question. I am working on a program that uses RInside and RcppEigen, and I want to expose a function back to R. Specifically, I have a C++ function with the following signature: double nll_singleton( const VectorXd& theta, const MatrixXd& ua, const Matr

Re: [Rcpp-devel] compiling an RInside and RCppEigen application using the Intel compiler, icpc

2012-08-13 Thread Stephen J. Barr
On Mon, Aug 13, 2012 at 5:20 AM, Dirk Eddelbuettel wrote: > > On 13 August 2012 at 00:19, Stephen J. Barr wrote: > | Greetings, > | > | Over the weekend I had wanted to compile an application using RInside and > | RCppEigen using icpc. I found the following two pieces of inf

[Rcpp-devel] compiling an RInside and RCppEigen application using the Intel compiler, icpc

2012-08-13 Thread Stephen J. Barr
Greetings, Over the weekend I had wanted to compile an application using RInside and RCppEigen using icpc. I found the following two pieces of information helpful. 1. The order of the includes in important. In particular #include "mpi.h" #include #include #include mpi.h must be first. If mpi

Re: [Rcpp-devel] clarification of interaction between RInside and RcppEigen

2012-08-08 Thread Stephen J. Barr
Hello again, I am just trying to straighten this out. Say I want to have the exact same random matrix in C++ as I do in R using rnorm. Is what I am doing below on the right track? Thanks, Stephen // // Stephen J. Barr // - trying to combine RInside and Eigen #include #include using

Re: [Rcpp-devel] clarification of interaction between RInside and RcppEigen

2012-08-08 Thread Stephen J. Barr
Ah, that made it click. Thank you so much for the help. On Tue, Aug 7, 2012 at 2:56 PM, Dirk Eddelbuettel wrote: > > On 7 August 2012 at 14:43, Stephen J. Barr wrote: > | Thanks for the pointer to sugar. > | > | I was just trying to think of a simple example. So my C

Re: [Rcpp-devel] clarification of interaction between RInside and RcppEigen

2012-08-08 Thread Stephen J. Barr
Thanks for the pointer to sugar. I was just trying to think of a simple example. So my C++ code will be essentially: int main() { RInside R(argc, argv); // create an embedded R instance R.parseEval("X = generateSomeMatrix()"); Eigen::MatrixXd Xeigen; // this is the par

Re: [Rcpp-devel] clarification of interaction between RInside and RcppEigen

2012-08-08 Thread Stephen J. Barr
Ah, I see the error. Please disregard this. I see how Rcpp::as works now. Best, Stephen On Tue, Aug 7, 2012 at 2:08 PM, Stephen J. Barr wrote: > Hello again, > > I am just trying to straighten this out. Say I want to have the exact same > random matrix in C++ as I do in R using rnor

Re: [Rcpp-devel] clarification of interaction between RInside and RcppEigen

2012-08-07 Thread Stephen J. Barr
Thank you Dirk and also Douglas. This definitely helps. I think I can get this going. Thank you so much for the quick replies. Best, Stephen On Tue, Aug 7, 2012 at 11:29 AM, Dirk Eddelbuettel wrote: > > Hi Stephen, > > On 7 August 2012 at 10:55, Stephen J. Barr wrote: > | Greet

[Rcpp-devel] clarification of interaction between RInside and RcppEigen

2012-08-07 Thread Stephen J. Barr
Greetings, I am new to Rcpp, RInside and the entire family of related packages. I am experienced with R and also C++ using Eigen but I have never combined the two before. I would like to create a matrix using R and then play with it using Eigen. From what I have read so far, it seems like I can us