[Rcpp-devel] Add Vector::containsElementNamed(string) overload?

2013-07-04 Thread QRD
Hi, Would you consider adding a convenience overload bool containsElementNamed( const std::string & target ) const; to the Rcpp::Vector class? The attached patch does this, chaining down to the existing (const char *) method. It also updates the unit test to check both overloads. Against 0

Re: [Rcpp-devel] Problem with exceptions from standalone functions (Windows only)

2013-06-19 Thread QRD
Hi Romain, > > I've just had some trouble, on Windows with Rtools-3.0, throwing > > exceptions from within a standalone function belonging to a module > > I have commited adding BEGIN_RCPP and END_RCPP. > Could you have a go at testing it on Windows. I don't have SVN access through the firewall h

Re: [Rcpp-devel] Problem with exceptions from standalone functions (Windows only)

2013-06-13 Thread QRD
Hi Romain, Thanks for looking at this. > > [...] do you think adding BEGIN_RCPP / END_RCPP pairs in all of the > > CppFunction-derived classes would be acceptable [...] ? > If I apply your suggestion to the generator file and it does not break > existing code (i.e. as defined by our unit tests),

[Rcpp-devel] Typo in macro UNPACK_EXTERNAL_ARGS (Module.cpp)

2013-06-13 Thread QRD
Hi, Minor typo in the macro UNPACK_EXTERNAL_ARGS in Module.cpp; all existing callers don't notice because they use the variable 'p' but it might trip someone up in future. Thanks, Ben. - - - - 8< - - - - [Also attached in case email mangles whitespace.] diff -rU4 Rcpp-orig/src/Module.cpp Rcpp-

[Rcpp-devel] Problem with exceptions from standalone functions (Windows only)

2013-06-13 Thread QRD
Hi, I've just had some trouble, on Windows with Rtools-3.0, throwing exceptions from within a standalone function belonging to a module: - - - - 8< - - - - crash.cpp #include #include int calculate(int x) { throw std::invalid_argument("x is invalid"); } RCPP_MODULE(Crash) { Rcpp::fun

[Rcpp-devel] Debug string typo fix in wrap.h

2013-05-17 Thread QRD
Minor typo fix. (In case the patch gets mangled, line 449 of wrap.h should emit a debug string including "true" rather than "false".) --- Rcpp-orig/inst/include/Rcpp/internal/wrap.h 2013-03-20 19:00:56.0 + +++ Rcpp/inst/include/Rcpp/internal/wrap.h 2013-05-17 11:45:53.978029200

Re: [Rcpp-devel] Segfault error during simulation in Rcpp: explanation/fix

2013-05-17 Thread QRD
Hi, On Thu, May 16, 2013 at 11:02 AM, Dirk Eddelbuettel wrote: > Here is the self-contained example I asked for. > > And yes, it crashes for me too. So let's not create 1e6 temp matrices. > Until someone has time to debug memory management internals. Which is > really hard, so this may not get