Re: [Rcpp-devel] ColDatum constructors memory safety

2010-03-16 Thread Dirk Eddelbuettel
On 16 March 2010 at 16:59, Alistair Gee wrote: | Here are patches to RcppFrame.h: Sweet! Thanks a lot! Now, just to top it off, could provide a unit test that would ideally trigger the issue (or something related) pre-fix but not post-fix? Dirk | --- RcppFrame.h~2010-02-16 10:54:01

Re: [Rcpp-devel] ColDatum constructors memory safety

2010-03-16 Thread Alistair Gee
Here are patches to RcppFrame.h: --- RcppFrame.h~2010-02-16 10:54:01.0 -0500 +++ RcppFrame.h 2010-03-16 19:48:29.847994574 -0400 @@ -30,7 +30,8 @@ enum ColType { // Supported data frame column types. COLTYPE_DOUBLE, COLTYPE_INT, COLTYPE_STRING, COLTYPE_FA

Re: [Rcpp-devel] Organization of C++ classes for glm families

2010-03-16 Thread Romain Francois
Le 16/03/10 23:19, Romain Francois a écrit : > > Le 16/03/10 22:09, Douglas Bates a écrit : >> >> On Tue, Mar 16, 2010 at 3:24 PM, Dirk Eddelbuettel wrote: >> >>> That's an interesting problem. AFAICT folks prefer iterators and >>> transform() >>> and its ilk because it allows you to swap vecto

Re: [Rcpp-devel] Good idioms for creating a named list?

2010-03-16 Thread Romain Francois
Oops. commited now. Le 16/03/10 23:16, Douglas Bates a écrit : > > I don't see that commit. I have SVN revision 909, which AFAICS is the > latest version, and there is no mention of make_list or Rcpp::Argument > that I can find. > > On Tue, Mar 16, 2010 at 5:49 AM, Romain Francois > wrote: >> H

Re: [Rcpp-devel] Organization of C++ classes for glm families

2010-03-16 Thread Romain Francois
Le 16/03/10 22:09, Douglas Bates a écrit : > > On Tue, Mar 16, 2010 at 3:24 PM, Dirk Eddelbuettel wrote: > >> That's an interesting problem. AFAICT folks prefer iterators and transform() >> and its ilk because it allows you to swap vector() for, say, list() with >> minimal >> fuss. It is less c

Re: [Rcpp-devel] Good idioms for creating a named list?

2010-03-16 Thread Douglas Bates
I don't see that commit. I have SVN revision 909, which AFAICS is the latest version, and there is no mention of make_list or Rcpp::Argument that I can find. On Tue, Mar 16, 2010 at 5:49 AM, Romain Francois wrote: > Hello, > > I have now commited make_list as a set of templates taking variable n

Re: [Rcpp-devel] Organization of C++ classes for glm families

2010-03-16 Thread Douglas Bates
On Tue, Mar 16, 2010 at 3:24 PM, Dirk Eddelbuettel wrote: > That's an interesting problem.  AFAICT folks prefer iterators and transform() > and its ilk because it allows you to swap vector() for, say, list() with > minimal > fuss.  It is less clear that you pick up speed that way.  Wouldn't the

Re: [Rcpp-devel] Organization of C++ classes for glm families

2010-03-16 Thread Romain Francois
Le 16/03/10 21:01, Douglas Bates a écrit : > > On Tue, Mar 16, 2010 at 2:00 PM, Douglas Bates wrote: >> In profiling some of the code for generalized linear mixed models I >> discovered that a considerable amount of the time was being taken up >> in evaluation of some of the functions in the glm f

Re: [Rcpp-devel] Organization of C++ classes for glm families

2010-03-16 Thread Dirk Eddelbuettel
That's an interesting problem. AFAICT folks prefer iterators and transform() and its ilk because it allows you to swap vector() for, say, list() with minimal fuss. It is less clear that you pick up speed that way. Wouldn't the cost of log() dominate the looping, whether it's old school C style

Re: [Rcpp-devel] Organization of C++ classes for glm families

2010-03-16 Thread Douglas Bates
On Tue, Mar 16, 2010 at 3:01 PM, Douglas Bates wrote: > On Tue, Mar 16, 2010 at 2:00 PM, Douglas Bates wrote: >> In profiling some of the code for generalized linear mixed models I >> discovered that a considerable amount of the time was being taken up >> in evaluation of some of the functions in

Re: [Rcpp-devel] Organization of C++ classes for glm families

2010-03-16 Thread Douglas Bates
On Tue, Mar 16, 2010 at 2:00 PM, Douglas Bates wrote: > In profiling some of the code for generalized linear mixed models I > discovered that a considerable amount of the time was being taken up > in evaluation of some of the functions in the glm family.  Many of > these functions in the family ar

[Rcpp-devel] Organization of C++ classes for glm families

2010-03-16 Thread Douglas Bates
In profiling some of the code for generalized linear mixed models I discovered that a considerable amount of the time was being taken up in evaluation of some of the functions in the glm family. Many of these functions in the family are candidates for a std::transform application > str(poisson())

Re: [Rcpp-devel] Good idioms for creating a named list?

2010-03-16 Thread Romain Francois
Le 16/03/10 12:26, Dirk Eddelbuettel a écrit : > > > On 16 March 2010 at 11:49, Romain Francois wrote: > | Hello, > | > | I have now commited make_list as a set of templates taking variable > | number of arguments and creating named generic vectors. There is again > | some code bloat involved and i

Re: [Rcpp-devel] Good idioms for creating a named list?

2010-03-16 Thread Dirk Eddelbuettel
On 16 March 2010 at 11:49, Romain Francois wrote: | Hello, | | I have now commited make_list as a set of templates taking variable | number of arguments and creating named generic vectors. There is again | some code bloat involved and it handles up to 20 arguments. (this is not | painful to ma

Re: [Rcpp-devel] Good idioms for creating a named list?

2010-03-16 Thread Romain Francois
Hello, I have now commited make_list as a set of templates taking variable number of arguments and creating named generic vectors. There is again some code bloat involved and it handles up to 20 arguments. (this is not painful to make it 50 or 100, but I think 20 is good enough for now). For e

Re: [Rcpp-devel] Preferred idiom for obtaining a pointer in Rcpp

2010-03-16 Thread Romain Francois
Le 16/03/10 01:33, Douglas Bates a écrit : > > I have been using the begin method to obtain a pointer to the contents > of an Rcpp::Vector object. For example > > Rcpp::NumericVector foo(10); > double *ptr = foo.begin(); > > Would a preferred idiom be > > double *ptr =&foo[0]: > > In C I would use