[Rcpp-devel] Fwd: Re: Filling a big.matrix in Rcpp

2013-03-14 Thread Dirk Eddelbuettel
On 15 March 2013 at 11:12, Aileen Lin wrote: | Do you have the same warning messages? No. And I compile with maximum warning levels by using -Wall -pedantic. | Do you know how to get rid of it? No idea besides stop using Windows. It's an interaction between Boost and your Windows headers. M

Re: [Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Shraddha Pai
Hi all, Thanks for all the responses and for clarifying what big matrices are. I had actually looked through the rcpp-devel site before attempting to use big.matrix with Rcpp. I probably misunderstood this thread about bigmemory; it sounded like bigmemory objects worked "out-of-the-box" with Rcpp

Re: [Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Dirk Eddelbuettel
On 15 March 2013 at 00:51, Romain Francois wrote: | Why do you use wrap here ? Reflex, because I returned an atomistic type. | Wrap will create a SEXP, not a bool ! Quite right but was in a rush while doing other things too. "Forgot" that I was using sourceCpp() which give one additional layer

[Rcpp-devel] Fwd: Re: Filling a big.matrix in Rcpp

2013-03-14 Thread Aileen Lin
Aileen Lin View my profile: au.linkedin.com/in/aileen2 -- Forwarded message -- From: "Aileen Lin" Date: 15 Mar 2013 10:44 Subject: Re: [Rcpp-devel] Filling a big.matrix in Rcpp To: "Dirk Eddelbuettel" Cc: I tried your source code and had two warning messages: g++ -I"C:/R/R-215

Re: [Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Romain Francois
Le 14 mars 2013 à 19:33, Dirk Eddelbuettel a écrit : > > On 14 March 2013 at 12:24, Smith, Dale wrote: > | Write it up for Rcpp Gallery. > > Yup. Our thoughts too. Here is a slightly modified version which works as a > single cpp file thanks to the wonders of sourceCpp() --- bigmemory header

Re: [Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Dirk Eddelbuettel
On 14 March 2013 at 12:24, Smith, Dale wrote: | Write it up for Rcpp Gallery. Yup. Our thoughts too. Here is a slightly modified version which works as a single cpp file thanks to the wonders of sourceCpp() --- bigmemory headers are found automagically, and the example is executed too. Dirk

Re: [Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Smith, Dale
Write it up for Rcpp Gallery. Dale Smith, Ph.D. Senior Financial Quantitative Analyst Risk & Compliance Fiserv Office: 678-375-5315 www.fiserv.com From: rcpp-devel-boun...@r-forge.wu-wien.ac.at [mailto:rcpp-devel-boun...@r-forge.wu-wien.ac.at] On Behalf Of Mic

Re: [Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Michael Kane
OK, I've got it working. You need to add the bigmemory inst directory to the PKG_CPPFLAGS, include MatrixAccessor.hpp, and pass the pointer to the BigMatrix object to your function. The following code should do the trick but note that it does not create a new big.matrix object it simply modifies t

Re: [Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Dirk Eddelbuettel
I do not think we have support for bigmemory's big.matrix objects. So you can't just assum it works. Contributions welcome. This is both 'an obvious one' as it would make sense at the C++ and R levels, and something that should not be so hard as we support XPtr. Dirk -- Dirk Eddelbuettel | e

Re: [Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Michael Kane
Shradda, A big.matrix is not a regular R matrix. It is a completely separate type. The definition can be found in BigMatrix.h. I've rewritten your C++ code but there is still a problem. To build the function the compiler needs to know where the bigmemory header files are. Basically, you need to #i

[Rcpp-devel] Filling a big.matrix in Rcpp

2013-03-14 Thread Shraddha Pai
Hi all, I'm trying unsuccessfully to process a big.matrix in a c++ function in the simple example below. I first tried to pass the object itself ("bigmat") and got an "Error: not a matrix" message during compile time. So I'm now trying to pass the matrix descriptor ("matDesc"). From previous posts