Re: [Rcpp-devel] Internals: how does DataFrame get initialized?

2012-02-28 Thread Darren Cook
> It also includes "DataFrame_generated.h", which contains > automatically generated constructors with 1 to X (currently X=20) > "Named" arguments. Thanks. (your URL didn't give me permission, but I found it on my machine in /usr/local/lib/R/site-library/Rcpp/include/Rcpp ) It does: return Data

Re: [Rcpp-devel] Internals: how does DataFrame get initialized?

2012-02-28 Thread Davor Cubranic
It also includes "DataFrame_generated.h", which contains automatically generated constructors with 1 to X (currently X=20) "Named" arguments. See it directly in the Subversion repo at R-Forge: https://r-forge.r-project.org/scm/viewvc.php/pkg/Rcpp/inst/include/Rcpp/?root=r$ Davor On Wed, 29 Fe

Re: [Rcpp-devel] Problem with undefined symbols when building RcppArmadillo

2012-02-28 Thread Comanor, Katherine
Problem solved by upgrading RcppArmadillo and Rcpp! Yeah! Thanks for your help, Katherine On 2/27/12 5:40 PM, "Dirk Eddelbuettel" wrote: > >Hi Katherine, > >Thanks for posting here. > >On 27 February 2012 at 17:23, Comanor, Katherine wrote: >| Hello Dirk, >| >| I went through the thread at:

Re: [Rcpp-devel] DataFrame::create() in endless loop

2012-02-28 Thread Dirk Eddelbuettel
On 29 February 2012 at 08:39, Darren Cook wrote: | > I used IntegerVector and friends, | > and changed from DataFrame to List. | | Hello Steffen, | Do you mean you needed to do both those changes to get it to work? Or | either would have fixed your problem, but you decided to do both "just | in

[Rcpp-devel] Internals: how does DataFrame get initialized?

2012-02-28 Thread Darren Cook
I wanted to understand what this code [1] actually does: std::vector vt, vpx, vsz; std::vector vsrc, vtype; ... Rcpp::DataFrame df = Rcpp::DataFrame::create( Rcpp::Named("t", vt), Rcpp::Named("type", vtype), Rcpp::Named("src", vsrc), Rcpp::Named("px", vpx), Rcpp::Named("sz", vs

Re: [Rcpp-devel] DataFrame::create() in endless loop

2012-02-28 Thread Darren Cook
> I used IntegerVector and friends, > and changed from DataFrame to List. Hello Steffen, Do you mean you needed to do both those changes to get it to work? Or either would have fixed your problem, but you decided to do both "just in case"? Slava wrote: >> I had the same problem a while ago and t

Re: [Rcpp-devel] DataFrame::create() in endless loop

2012-02-28 Thread Steffen Neumann
Hi, thanks everyone for the help, I used IntegerVector and friends, and changed from DataFrame to List. Thanks, Steffen On Tue, 2012-02-28 at 14:59 -0500, Slava Mazur wrote: > > It's a memory problem from R. It is trying to do garbage collection > > > (RunGenCollector) and getting hung up, p

Re: [Rcpp-devel] Linking a package to -ltmalloc from the google perftools

2012-02-28 Thread Dirk Eddelbuettel
On 28 February 2012 at 13:56, Douglas Bates wrote: | >> You do have libgoogle-perftools-dev installed, right? | > | > Well, actually, no I didn't have that package installed.  Thanks for | > the pointer. | | Followup question: How does one invoke the cpu-profiler? You need to | give a path to th

Re: [Rcpp-devel] Segfaults for a function returning list of vectors of indices

2012-02-28 Thread Dirk Eddelbuettel
On 28 February 2012 at 13:52, Douglas Bates wrote: | On Tue, Feb 28, 2012 at 1:22 PM, Dirk Eddelbuettel wrote: | > | > On 28 February 2012 at 10:54, Chris DuBois wrote: | > | Hi all, | > | | > | Given a vector of integers x = sample(1:K,N,replace=TRUE) with N > K, | > | I want to return a list wh

Re: [Rcpp-devel] DataFrame::create() in endless loop

2012-02-28 Thread Slava Mazur
> It's a memory problem from R. It is trying to do garbage collection > (RunGenCollector) and getting hung up, probably because of exhausting > one of the stacks in R. Your std::vector objects need to be > copied to R objects. Is it possible to define them as IntegerVector's > instead, in which

Re: [Rcpp-devel] Linking a package to -ltmalloc from the google perftools

2012-02-28 Thread Douglas Bates
On Tue, Feb 28, 2012 at 1:24 PM, Douglas Bates wrote: > On Tue, Feb 28, 2012 at 1:17 PM, Dirk Eddelbuettel wrote: >> >> On 28 February 2012 at 12:43, Douglas Bates wrote: >> | As the google perftools are specifically designed for multi-threaded >> | C++ programs I ask this here rather than on R-d

Re: [Rcpp-devel] Segfaults for a function returning list of vectors of indices

2012-02-28 Thread Douglas Bates
On Tue, Feb 28, 2012 at 1:22 PM, Dirk Eddelbuettel wrote: > > On 28 February 2012 at 10:54, Chris DuBois wrote: > | Hi all, > | > | Given a vector of integers x = sample(1:K,N,replace=TRUE) with N > K, > | I want to return a list where element k is a vector of indices i where > | x[i] = k.  (If th

Re: [Rcpp-devel] Linking a package to -ltmalloc from the google perftools

2012-02-28 Thread Douglas Bates
On Tue, Feb 28, 2012 at 1:17 PM, Dirk Eddelbuettel wrote: > > On 28 February 2012 at 12:43, Douglas Bates wrote: > | As the google perftools are specifically designed for multi-threaded > | C++ programs I ask this here rather than on R-devel. > | > | On a Linux system (Ubuntu 11.10) I have been un

Re: [Rcpp-devel] Segfaults for a function returning list of vectors of indices

2012-02-28 Thread Dirk Eddelbuettel
On 28 February 2012 at 10:54, Chris DuBois wrote: | Hi all, | | Given a vector of integers x = sample(1:K,N,replace=TRUE) with N > K, | I want to return a list where element k is a vector of indices i where | x[i] = k.  (If there is already an R function for this, please let me | know!)  Here is

Re: [Rcpp-devel] Linking a package to -ltmalloc from the google perftools

2012-02-28 Thread Dirk Eddelbuettel
On 28 February 2012 at 12:43, Douglas Bates wrote: | As the google perftools are specifically designed for multi-threaded | C++ programs I ask this here rather than on R-devel. | | On a Linux system (Ubuntu 11.10) I have been unsuccessful linking a | package, say Rcpp, against -ltcmalloc. I do h

[Rcpp-devel] Segfaults for a function returning list of vectors of indices

2012-02-28 Thread Chris DuBois
Hi all, Given a vector of integers x = sample(1:K,N,replace=TRUE) with N > K, I want to return a list where element k is a vector of indices i where x[i] = k.  (If there is already an R function for this, please let me know!)  Here is the Rcpp code: // xr: vector of integers // mr: max superwhich

[Rcpp-devel] Linking a package to -ltmalloc from the google perftools

2012-02-28 Thread Douglas Bates
As the google perftools are specifically designed for multi-threaded C++ programs I ask this here rather than on R-devel. On a Linux system (Ubuntu 11.10) I have been unsuccessful linking a package, say Rcpp, against -ltcmalloc. I do have /usr/lib/libtcmalloc.so.0 and friends installed but the li

Re: [Rcpp-devel] DataFrame::create() in endless loop

2012-02-28 Thread Dirk Eddelbuettel
On 28 February 2012 at 17:16, Steffen Neumann wrote: | Hi, | | I am currently hunting a problem where a call to | Rcpp::DataFrame::create() goes into a seemingly | endless loop. seqNum,acquisitionNum and msLevel | are all std::vector of length N (~3.9 million), | and if I change the code to onl

Re: [Rcpp-devel] DataFrame::create() in endless loop

2012-02-28 Thread Douglas Bates
On Tue, Feb 28, 2012 at 10:16 AM, Steffen Neumann wrote: > Hi, > > I am currently hunting a problem where a call to > Rcpp::DataFrame::create() goes into a seemingly > endless loop. seqNum,acquisitionNum and msLevel > are all std::vector of length N (~3.9 million), > and if I change the code to on

[Rcpp-devel] DataFrame::create() in endless loop

2012-02-28 Thread Steffen Neumann
Hi, I am currently hunting a problem where a call to Rcpp::DataFrame::create() goes into a seemingly endless loop. seqNum,acquisitionNum and msLevel are all std::vector of length N (~3.9 million), and if I change the code to only include seqNum,acquisitionNum this runs fine. msLevel contains val

Re: [Rcpp-devel] RInside wt example runtime error

2012-02-28 Thread Dirk Eddelbuettel
Hi Cedric, Thanks for posting here. I'll reply to post email in this one. On 28 February 2012 at 16:09, GOUY-PAILLER Cedric wrote: | Dear list, | | I am trying to use the wt example provided in RInside. The sources have | just been downloaded from the svn : | | ~ svn checkout svn://svn.r-for

Re: [Rcpp-devel] RInside wt example runtime error

2012-02-28 Thread GOUY-PAILLER Cedric
I forgot to mention that the other Rinside examples work well (even the qt one). Cedric * GOUY-PAILLER Cedric [2012-02-28 16:09:10 +0100]: > Dear list, > > I am trying to use the wt example provided in RInside. The sources have > just been downloaded from the svn : > > ~ svn checkout svn://sv

[Rcpp-devel] RInside wt example runtime error

2012-02-28 Thread GOUY-PAILLER Cedric
Dear list, I am trying to use the wt example provided in RInside. The sources have just been downloaded from the svn : ~ svn checkout svn://svn.r-forge.r-project.org/svnroot/rinside/ ~ cd rinside/pkg/inst/examples/wt then it compile without problem ~ make g++ -Wall -I/usr/local/include -I/home/c