Re: [Rcpp-devel] Dynamic Wrapping and Recursion with Rcpp - using an R function?

2013-07-27 Thread Romain Francois
to call any R function, or can you come up with a list of operations you'd do on terminal nodes of your tree ? what do you want to do with your dendrograms ? Romain Le 26/07/13 17:06, Tal Galili a écrit : Hello all, I would like to write an Rcpp function that will get an R object, an R

Re: [Rcpp-devel] Help with accessing and manipulating List objects

2013-07-23 Thread Romain Francois
, but not so easy otherwise. Romain Le 20/07/13 18:44, Tal Galili a écrit : Hello dear Rcpp users, First - I'd like to say that I took Hadley and Romain's workshop at the useR conference this year, and I am very excited about trying out Rcpp - this project looks AMAZING. Second - this is my first post

Re: [Rcpp-devel] What is the best practice to expose a C structure from 3rd party library into R?

2013-07-22 Thread romain
( flag, A_cpp::get_flag, A_cpp::set_flag ) ; function( get_flag, get_flag ) ; } /*** R a - new( A ) a$flag a$flag - 12L a$flag get_flag( a ) ***/ I hope this clarifies a few things, or at least puts you on a good track. Let us know. Romain Thanks. Wush Links: -- [1] http

Re: [Rcpp-devel] Help with accessing and manipulating List objects

2013-07-21 Thread Romain Francois
this. Romain Le 20 juil. 2013 à 18:44, Tal Galili tal.gal...@gmail.com a écrit : Hello dear Rcpp users, First - I'd like to say that I took Hadley and Romain's workshop at the useR conference this year, and I am very excited about trying out Rcpp - this project looks AMAZING. Second

Re: [Rcpp-devel] isT( SEXP )

2013-07-17 Thread Romain Francois
Le 17 juil. 2013 à 13:41, JJ Allaire jj.alla...@gmail.com a écrit : dispatching could also happen in attributes. Why not having something like this: // [[Rcpp::export]] void foo( NumericVector x) { // do some stuff } // [[Rcpp::export]] void foo( IntegerVector x) { // do

Re: [Rcpp-devel] isT( SEXP )

2013-07-17 Thread Romain Francois
Le 17 juil. 2013 à 14:10, JJ Allaire jj.alla...@gmail.com a écrit : But maybe it is not worth the trouble. Maybe this is simply a documentation issue on hiw to dispatch. Yes, I think creating an automatic dispatch system that's general enough to matter might not be worth the effort.

Re: [Rcpp-devel] Forcing a shallow versus deep copy

2013-07-11 Thread romain
. Romain Le 2013-07-11 15:34, Changi Han a écrit : I am sure there are better ways to achieve the goal. I would suggest that these two be similar if possible. I think the naive expectation is for them to be consistent. // [[Rcpp::export]] stuff function(Rcpp::stuff) { } // [[Rcpp::export

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

2013-07-04 Thread Romain Francois
Thanks. This seems like a good idea. And kudos for updating unit tests as well. I'll apply this later if nobody else is faster. Romain Le 4 juil. 2013 à 12:24, QRD q...@sig.com a écrit : Hi, Would you consider adding a convenience overload bool containsElementNamed( const std::string

Re: [Rcpp-devel] What's the most efficient way to convert a NumericVector to an array of doubles

2013-06-29 Thread Romain Francois
inefficient and will make many unecessary copies of the data, each time the std::vctor wants to grow. If you want a std:vector you can do something like this: std::vectordouble vec( input.begin(), input.end() ) ; Or: std::vectordouble vec = as std::vectordouble (input) ; Romain Le 29 juin

Re: [Rcpp-devel] two minor bugs with Rcpp's sugar table

2013-06-26 Thread Romain Francois
Thanks for this. We'll have a look. Romain Le 25/06/13 22:06, Kevin Ushey a écrit : Hi guys, Sorry to be bringing this up so close after the CRAN release, but I just stumbled upon them today. - 1) The table function occasionally produces names as '-0', rather than '0', for numeric

Re: [Rcpp-devel] Seamless Rcpp gives errors with RcppArmadillo

2013-06-26 Thread Romain Francois
Hello, I don't have a copy of the book at hand. Below are some insights on what you are doing wrong. Hope this helps. Romain Le 26/06/13 11:11, John Swan a écrit : Hi, I just purchased Dirk's book on Seamless Rcpp and I'm finding it very useful. However, I'm having a strange error

Re: [Rcpp-devel] macros RCPP_FUNCTION_...,

2013-06-19 Thread Romain Francois
the feature is gone. Considering we release now approximately quarterly, this leaves a period between 6 and 9 months before the feature is gone. I hope everybody will be ok with that. This is more work, and I actually need to remember to do it, but that is a good compromise. Romain Le 19/06/13 14:35

Re: [Rcpp-devel] macros RCPP_FUNCTION_...,

2013-06-19 Thread Romain Francois
Le 19/06/13 15:41, Dirk Eddelbuettel a écrit : On 19 June 2013 at 15:12, Romain Francois wrote: | So: | - when we release Rcpp 0.10.4 nothing changes. people can still enjoy | using this feature, if anyone is. | - when we release Rcpp 0.10.5 the feature is still there, but with extra | annoying

Re: [Rcpp-devel] macros RCPP_FUNCTION_...,

2013-06-19 Thread Romain Francois
Le 19/06/13 15:49, Romain Francois a écrit : Le 19/06/13 15:41, Dirk Eddelbuettel a écrit : On 19 June 2013 at 15:12, Romain Francois wrote: | So: | - when we release Rcpp 0.10.4 nothing changes. people can still enjoy | using this feature, if anyone is. | - when we release Rcpp 0.10.5

Re: [Rcpp-devel] macros RCPP_FUNCTION_...,

2013-06-19 Thread Romain Francois
Le 19/06/13 15:50, Hadley Wickham a écrit : On Wed, Jun 19, 2013 at 8:41 AM, Dirk Eddelbuettel e...@debian.org wrote: On 19 June 2013 at 15:12, Romain Francois wrote: | So: | - when we release Rcpp 0.10.4 nothing changes. people can still enjoy | using this feature, if anyone is. | - when we

Re: [Rcpp-devel] macros RCPP_FUNCTION_...,

2013-06-19 Thread Romain Francois
. Breaking an API is extremely poor style and annoying as hell to everybody. We all agree on that -- and what Romain proposed (ie removing unused cruft) is generally a good rather than thing. But one has to be extra careful to not accidentally create the former too. The burden only grows

[Rcpp-devel] macros RCPP_FUNCTION_...,

2013-06-18 Thread Romain Francois
% of the lines of the .h files in Rcpp. I don't think many people are using it, and I don't blame them. This was an interesting idea when we introduced it, but we have something better now. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http

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

2013-06-18 Thread Romain Francois
Hi, I have commited adding BEGIN_RCPP and END_RCPP. Could you have a go at testing it on Windows. Romain Le 13/06/13 10:17, QRD a écrit : 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

Re: [Rcpp-devel] Compilation without libR.so ?

2013-06-14 Thread romain
Hello, Thanks for your interest in Rcpp. Le 2013-06-14 07:07, Martin Jakt a écrit : Dear Rcpp developers, I'm rather new to Rcpp but am very excited by it's abilities; especially with the lower degree of effort required to combine R and C++. Thanks! However, I'm still left a bit mystified by

Re: [Rcpp-devel] Compilation without libR.so ?

2013-06-14 Thread Romain Francois
Le 14 juin 2013 à 10:40, Martin Jakt mj...@z2.keio.jp a écrit : Hi Romain (?), thanks for your quick reply, Why do you want that. R CMD essentially takes care all of the details, cooks a Makefile, runs it ... transparently. It never needs to be a concern. You can gain some control

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

2013-06-13 Thread romain
Hello, This is somewhat of a known issue we have with windows for some time. Thanks for looking into it. If I apply your suggestion to the generator file and it does not break existing code (i.e. as defined by our unit tests), would you be willing to test it on your settings ? Romain Le

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

2013-06-13 Thread romain
Thanks. I pushed it as svn rev 4339. Romain Le 2013-06-13 10:27, QRD a écrit : 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

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

2013-06-13 Thread Romain Francois
Great. I'll let you know when i need your help for testing. Might be in a few days as i'm travelling now. Romain Le 13 juin 2013 à 11:47, QRD q...@sig.com a écrit : Hi Romain, Thanks for looking at this. [...] do you think adding BEGIN_RCPP / END_RCPP pairs in all of the CppFunction

Re: [Rcpp-devel] returning array from C

2013-06-11 Thread Romain Francois
Envoyé de mon iPhone Le 11 juin 2013 à 18:33, Steve Jaffe sja...@riskspan.com a écrit : On 11 June 2013, Dirk Eddelbuettel wrote: | On 11 June 2013, Steve Jaffe wrote: | Is there a way to 'wrap', say, an array of double allocated on the heap in C/C++ and return it to R without copying, ie

Re: [Rcpp-devel] returning array from C

2013-06-11 Thread Romain Francois
Le 11 juin 2013 à 20:54, Krzysztof Sakrejda krzysztof.sakre...@gmail.com a écrit : On Tue, Jun 11, 2013 at 2:49 PM, Romain Francois rom...@r-enthusiasts.com wrote: Le 11 juin 2013 à 20:40, Steve Jaffe sja...@riskspan.com a écrit : On Tuesday, June 11, 2013 2:37 PM, Krzysztof Sakrejda

Re: [Rcpp-devel] Delayed usage of auxiliary memory in RcppArmadillo

2013-06-10 Thread romain
, but I'm pretty sure that is not what you were talking about. Romain Best Simon ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Re: [Rcpp-devel] Integer matrices in Rcpp and Armadillo

2013-06-07 Thread Romain Francois
Le 07/06/13 15:14, Simon Zehnder a écrit : Hi Romain, hi Dirk, sorry for posting here again, but I found something in some way connected to this discussion - and pretty interesting concerning the Rcpp::as() function: 1. I create a class containing a list: setClass(myclass, representation(par

Re: [Rcpp-devel] Setting the R random seed from Rcpp

2013-06-07 Thread Romain Francois
want to set the variable: you just do : RandomSeed = someVariable ; The Environment::Binding class acts a a proxy class. Romain Le 7 juin 2013 à 16:22, Matteo Fasiolo matteo.fasi...@gmail.com a écrit : Dear Rcpp experts, I would like to be able to store the R random seed from a Rcpp

Re: [Rcpp-devel] Integer matrices in Rcpp and Armadillo

2013-06-06 Thread Romain Francois
-- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:http://blog.r-enthusiasts.com |- http://bit.ly/Zs97qg : highlight 0.4.1 `- http://bit.ly/10X94UM : Mobile version of the graph gallery

Re: [Rcpp-devel] Integer matrices in Rcpp and Armadillo

2013-06-06 Thread Romain Francois
. Is this possible? R itself has no unsigned integers (just as it has no [signed or unsigned] short or long integeger). You should be able to write wrappers though, but this MUST entail copies for that very reason. So maybe stick to ints? Dirk -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30

Re: [Rcpp-devel] Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Romain Francois
) # sourceCpp(truncateTest.cpp) # truncateTest() # #prints 6 and 5 */ -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:http://blog.r-enthusiasts.com |- http://bit.ly/Zs97qg : highlight 0.4.1 `- http://bit.ly/10X94UM

Re: [Rcpp-devel] Warnings in build of RcppArmadillo project

2013-06-05 Thread Romain Francois
, fn_as_scalar.hpp and class.h it seems that there is something about typedefs, but I am not sure. It seems to me just not right, that all these warnings occur in my build output. Best Simon -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r

Re: [Rcpp-devel] Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Romain Francois
This is now fixed in rev 4330. I'm looking at the other issue you reported. Le 05/06/13 14:50, Romain Francois a écrit : Thanks. I'll have a look. Le 05/06/13 14:09, Toni Giorgino a écrit : Dears, I am a newbie to Rcpp. I may have found an off-by-one inconsistency in the handling of List

Re: [Rcpp-devel] Warnings in build of RcppArmadillo project

2013-06-05 Thread Romain Francois
The change affects Rcpp, not RcppArmadillo. Le 05/06/13 16:45, Simon Zehnder a écrit : Hi Romain, is revision 4331 already in RcppArmadillo 3.9.0? Best Simon On Jun 5, 2013, at 4:30 PM, Romain Francois rom...@r-enthusiasts.com wrote: Most of these are in fact happening in armadillo's

Re: [Rcpp-devel] [RCPP Sugar] sapply function

2013-05-30 Thread Romain Francois
]] NumericVector mapply_fun(NumericVector x, NumericVector y, NumericVector z){ return mapply(x, y, z, fun ) ; } So mapply'ing fun over x, y and z. works for 2 or 3 objects for now. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r

Re: [Rcpp-devel] [RCPP Sugar] sapply function

2013-05-10 Thread Romain Francois
Iirc we have mapply2 and mapply3. Otherwise you can make Foo a helper class instead of a function. And you embed the 3 variables in your class. Le 10 mai 2013 à 17:40, Julien Duvanel julien.duva...@epfl.ch a écrit : Hello again, I hope I don't disturb you too much. I have again a small

Re: [Rcpp-devel] [Rcpp Modules] Static functions

2013-05-09 Thread Romain Francois
(){ return Foo::myFunction() ; } We might support direct syntactic sugar for exposing static functions later, but i'm not sure the concept of staric functions is supported by reference classes which is the texhnology we use to expose module classes. Romain Le 9 mai 2013 à 16:47, Julien Duvanel

Re: [Rcpp-devel] Fwd: How can I avoid calls to coerceToReal

2013-05-02 Thread Romain Francois
What is the type of df[i] ? i.e. what does it says: SEXP tmp = df[i] ; Rprintf( TYPEOF(tmp)=%d, TYPEOF(tmp) ) ; If this is anything but REALSXP (i.e. 14), then you have to coerce the data to bne able to use it as a NumericVector. Romain Le 30/04/13 17:19, Pratibha Rana a écrit : Hi, MY

Re: [Rcpp-devel] Rcpp::List::create(...) with more than 20 elements ?

2013-04-17 Thread Romain Francois
[foo] = wrap( bar1 ) ; map[foo2] = wrap( bar2 ) ; wrap( map ) ; Or perhaps even : std::mapstring,SEXP map ; map[foo] = wrap( bar1 ) ; map[foo2] = wrap( bar2 ) ; wrap( map ) ; Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com

Re: [Rcpp-devel] Module with vector of a class with inheritance, how to avoid slicing

2013-04-04 Thread Romain Francois
$whoAmI(1) Good luck - Mail original - De: Robin Girard robin.gir...@mines-paristech.fr À: Romain Francois rom...@r-enthusiasts.com Cc: rcpp-devel@lists.r-forge.r-project.org Envoyé: Jeudi 4 Avril 2013 18:08:50 Objet: Re: [Rcpp-devel] Module with vector of a class with inheritance, how

Re: [Rcpp-devel] Module with vector of a class with inheritance, how to avoid slicing

2013-04-03 Thread Romain Francois
::push_back ) .method([[,vector_Of_father::vec_get) ; } Romain Le 03/04/13 18:43, Robin Girard a écrit : I am still working on my vector of a class father with inheritance (polymorphic subclasses ?). I created an exemple below that works fine but I face the known problem of slicing as named here

Re: [Rcpp-devel] Module with vector of a class with inheritance, how to avoid slicing

2013-04-03 Thread Romain Francois
Please note that this is the in progress section of modules, so things can change. There are probably open questions. e.g. at the moment you have to deal with who is responsible for the pointers. Le 03/04/13 22:12, Romain Francois a écrit : Hi, Fasten your seatbelts. First, the problem

Re: [Rcpp-devel] module with vectorMytype when Mytype has children with inheritence

2013-04-02 Thread Romain Francois
)( ) ) ; } ... Romain Le 02/04/13 13:15, Robin Girard a écrit : Hello list, I'm having troubles using module on a class that redefines a vector of Mytype where Mytype is type that has several children types. Mytype has only methods while cihldren inherit methods and have fields that are double or integer

Re: [Rcpp-devel] Datetime substraction bug ?

2013-04-02 Thread Romain Francois
stocker ou copier l'information | qu'il contient sur un quelconque support. | | ___ | Rcpp-devel mailing list | Rcpp-devel@lists.r-forge.r-project.org | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Romain Francois Professional R

Re: [Rcpp-devel] Bug with table sugar and NumericVector in Rcpp 0.10.3

2013-04-02 Thread Romain Francois
1 ERROR: compilation failed for package ‘Rcpp’ * removing ‘/tmp/RtmpfejSO9/Rinst312b332a9a19/Rcpp’ --- ERROR: package installation failed edd@max:~/svn/rcpp/pkg$ | | Romain | | Le 2013-03-29 16:00, Dirk Eddelbuettel a écrit : | On 29 March 2013 at 09:40, Dirk

Re: [Rcpp-devel] Rcpp can not return big DataFrame

2013-04-02 Thread Romain Francois
(and not attached): [1] compiler_2.15.3 tools_2.15.3 ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R

Re: [Rcpp-devel] Bug with table sugar and NumericVector in Rcpp 0.10.3

2013-04-02 Thread Romain Francois
Le 02/04/13 17:01, Dirk Eddelbuettel a écrit : On 2 April 2013 at 16:36, Romain Francois wrote: | Le 29/03/13 16:37, Dirk Eddelbuettel a écrit : | | On 29 March 2013 at 16:20, rom...@r-enthusiasts.com wrote: | | Cool. I'll have a look when I'm back from easter weekend. | | Sounds good

Re: [Rcpp-devel] Datetime substraction bug ?

2013-04-02 Thread Romain Francois
that `-`(1, 3) should be negative. But we don't have a purely abstract setting. I agree with Dirk's New Year's/Easter example -- if the dates are in order, then the diff should be positive to my mind. Note also: diff(c(1, 3)) [1] 2 Pat On 02/04/2013 15:33, Romain Francois wrote: Le 30/03/13 00

Re: [Rcpp-devel] Datetime substraction bug ?

2013-04-02 Thread Romain Francois
also: diff(c(1, 3)) [1] 2 Pat On 02/04/2013 15:33, Romain Francois wrote: Le 30/03/13 00:44, Dirk Eddelbuettel a écrit : On 29 March 2013 at 23:37, Robin Girard wrote: | Hi List | | why is it that we have in the Datetime definition | (here http://dirk.eddelbuettel.com/code/rcpp/html

Re: [Rcpp-devel] Datetime substraction bug ?

2013-04-02 Thread Romain Francois
) { return b - a; }') R ddiff(NewYear, Easter) [1] 89## I find this more logical R ddiff2(NewYear, Easter) [1] -89 ## closer to R's difftime and 'odd' to me R If it isn't used here, where is it actually used? Dirk -- Romain

Re: [Rcpp-devel] Bug with table sugar and NumericVector in Rcpp 0.10.3

2013-04-02 Thread Romain Francois
` or `as.factor`. stringsAsFactor is an important feature at R side, but does RCpp have to match the exact interface of R? For now, RCpp doesn't really support factor. Returning a data.frame with factor element would make it useless for RCpp. Hi Romain, I'm curious about the difference between the code

Re: [Rcpp-devel] Bug with table sugar and NumericVector in Rcpp 0.10.3

2013-03-29 Thread romain
’, ‘Rf_formatComplex’ So maybe Dirk has a plan to fix it. Romain Le 2013-03-29 07:27, Kevin Ushey a écrit : Hi guys, When I attempt to 'sourceCpp' the following code, the R session crashes: #include Rcpp.h using namespace Rcpp; // [[Rcpp::export]] IntegerVector counts(NumericVector x) {   return

Re: [Rcpp-devel] using Roxygen2 in a methods exported via a module

2013-03-29 Thread romain
Hello, This is just not supported (yet). Romain Le 2013-03-29 09:39, Robin Girard a écrit : Hi list, I have a c++ class and associated methods in my package wich are exported through a module, but I cannot find how to export the documentation of the method and the class. I am using Rcpp

Re: [Rcpp-devel] Bug with table sugar and NumericVector in Rcpp 0.10.3

2013-03-29 Thread romain
violates some CRAN guidelines (which unfortunately change over time) and some break other things. So sometimes we do need to revert. Dirk | Romain | | Le 2013-03-29 07:27, Kevin Ushey a écrit : | Hi guys, | | When I attempt to 'sourceCpp' the following code, the R session | crashes

Re: [Rcpp-devel] Bug with table sugar and NumericVector in Rcpp 0.10.3

2013-03-29 Thread romain
Cool. I'll have a look when I'm back from easter weekend. Romain Le 2013-03-29 16:00, Dirk Eddelbuettel a écrit : On 29 March 2013 at 09:40, Dirk Eddelbuettel wrote: | | On 29 March 2013 at 15:24, rom...@r-enthusiasts.com wrote: | | Le 2013-03-29 14:31, Dirk Eddelbuettel a écrit : | | On 29

Re: [Rcpp-devel] fill a NumericMatrix row by row

2013-03-27 Thread Romain Francois
I removed it in the revision 4294. Sorry for the inconvenience. Romain Le 27/03/13 09:23, Michael Love a écrit : Not a question here, but a note. Earlier there was an email about filling a NumericMatrix row by row. http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-March/005390

Re: [Rcpp-devel] Rcpp can not return big DataFrame

2013-03-27 Thread Romain Francois
data.table_1.8.8 loaded via a namespace (and not attached): [1] compiler_2.15.3 tools_2.15.3 ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Romain Francois

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

2013-03-14 Thread Romain Francois
a SEXP, not a bool ! Actually why is this not void ? Romain // R code for testing below /*** R require(bigmemory) # set up big.matrix nrows - 1 bkFile - bigmat.bk descFile - bigmatk.desc bigmat - filebacked.big.matrix(nrow=nrows, ncol=3,type=integer, init=1

Re: [Rcpp-devel] compiler warning (-Wdelete-non-virtual-dtor)

2013-03-10 Thread romain
thanks for the heads up. I will have a look at what needs to be done in a few days. Romain Le 2013-03-10 14:56, Greg Minshall a écrit : hi. i normally build under macosx, but trying to track down a memory problem have started using (the wonderful) valgrind under linux. the linux machine has

Re: [Rcpp-devel] Initiate NumericMatrix in class constructor from S4 slot

2013-03-05 Thread Romain Francois
: FirstClass::FirstClass(Rcpp::S4 classS4) : M( (SEXP)classS4.slot(M_R)) {} Hiwever, i will add the missing constructor if this does not break anything else. Romain Le 6 mars 2013 à 08:14, Simon Zehnder szehn...@uni-bonn.de a écrit : Dear Rcpp-Devels, I am a little confused right now

Re: [Rcpp-devel] Rcpp: Distinguishing between input types to function call

2013-02-20 Thread Romain Francois
RCPP_RETURN_VECTOR( _FUN_, _SEXP_ ) ___RCPP_RETURN___( _FUN_, _SEXP_ , Vector ) #define RCPP_RETURN_MATRIX( _FUN_, _SEXP_ ) ___RCPP_RETURN___( _FUN_, _SEXP_ , Matrix ) Romain Le 20/02/13 00:15, Søren Højsgaard a écrit : Dear all I have tried to follow Romains suggestion (thanks) below to obtain

Re: [Rcpp-devel] Efficient DataFrame access by row column

2013-02-20 Thread Romain Francois
list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:http://romainfrancois.blog.free.fr |- http

Re: [Rcpp-devel] Rcpp: Distinguishing between input types to function call

2013-02-20 Thread Romain Francois
Hello, Soren and I had the same idea, so we'll jointly write it for the Rcpp gallery. Romain Le 20/02/13 17:55, Kevin Ushey a écrit : Hi Romain, Just wanted to give you a thanks for putting together this answer. It's a really great example of more generic programming with Rcpp

Re: [Rcpp-devel] Splitting a matrix by its rows into a list

2013-02-19 Thread Romain Francois
This was a bug, and is fixed in rev 4262. Romain Le 19/02/13 00:37, Søren Højsgaard a écrit : I want to split a matrix by its rows into a list as: a- matrix(letters[1:6],ncol=2) split(a,row(a)) $`1` [1] a d $`2` [1] b e $`3` [1] c f I do as follows and get a strange result. Any

Re: [Rcpp-devel] rcpp sugar elementary question

2013-02-19 Thread Romain Francois
_ is defined in the Rcpp namespace, so perhaps you want to add : using namespace Rcpp ; somewhere on top. Also, you could use mat.row(1) instead of mat(1,_) Romain Le 19/02/13 16:49, Bharath Govindarajan a écrit : Hi , I am trying a simple example to assign entire rows to a Rcpp

Re: [Rcpp-devel] Rcpp modules and parsing an object back and forth between R C++

2013-02-19 Thread Romain Francois
declaration: RCPP_EXPOSED_CLASS(Simple) So that as and wrap are taken care of. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:http://romainfrancois.blog.free.fr |- http://bit.ly/14LJhmm : bibtex 0.3-5

Re: [Rcpp-devel] A though on Rcpp::wrap

2013-02-08 Thread Romain Francois
Thank you for this detailed email, i will study it carefully. Romain Le 8 févr. 2013 à 13:16, Yan Zhou zhou...@me.com a écrit : This morning I was frustrated by a compilation error, below is a scratch of the problem // MyClass1.h template typename T class MyClass

Re: [Rcpp-devel] expecting a string and not finding it in a CharacterVector

2013-02-07 Thread Romain Francois
Thanks. I will fix it. Romain Le 8 févr. 2013 à 05:28, Davor Cubranic cubra...@stat.ubc.ca a écrit : On 13-02-07 07:24 PM, Davor Cubranic wrote: The version assigning an element of a const CharacterVector to a const std::string (named bar below) compiles and works fine in Rcpp 0.9.14, so

Re: [Rcpp-devel] Rcpp and boost on Windows 7

2013-02-03 Thread Romain Francois
shared library. Regards, André Hello, You should have a look at the BH package, with which all you have to do (I think) is to have this in your DESCRIPTION: LinkingTo: BH, Rcpp And you're good to go. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery

Re: [Rcpp-devel] package with module not compiling on Mac

2013-01-31 Thread Romain Francois
, it looks like they only ever return *this. Why are you doing this ? I'd suggest you return void. Romain Le 29/01/13 16:04, Robin Girard a écrit : The Mac version of my package http://cran.r-project.org/web/packages/ConConPiWiFun/index.html (using Rcpp module) does not compile. the error message

Re: [Rcpp-devel] Performance question about DataFrame

2013-01-31 Thread Romain Francois
9 10 10 10 Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:http://romainfrancois.blog.free.fr |- http://bit.ly/RE6sYH : OOP with Rcpp modules `- http://bit.ly/Thw7IK : Rcpp modules more flexible

Re: [Rcpp-devel] package with module not compiling on Mac

2013-01-31 Thread Romain Francois
Le 31/01/13 12:15, Robin Girard a écrit : Merci Romain ! I am doing this to make possible a direct use of the result such as in A=Sum(f1.Swap(0),f2.Etoile()) I see. I figured you were using some sort of chaining. I'm not a big fan of methods that return a reference to the object

Re: [Rcpp-devel] Most efficient way to apply function over rows of a matrix with Rcpp?

2013-01-30 Thread Romain Francois
0 0 Maybe there is something we can do at our end to improve this by making a more efficient iterator over a matrix row. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:http

Re: [Rcpp-devel] #include gretl libraries in Rcpp

2012-12-19 Thread Romain Francois
The extern C looks suspicious. What happens if you don't include it ? e.g. #include Rcpp.h #include gretl/libgretl.h #include gretl/kalman.h or perhaps: #include gretl/libgretl.h #include gretl/kalman.h #include Rcpp.h Romain Le 20/12/12 00:39, jea...@hushmail.com a écrit : Hi, I am

Re: [Rcpp-devel] Build of Rcpp from svn failure

2012-12-16 Thread Romain Francois
Thanks for the notice, will fix when i get a chance if nobody else does it first. I simplified this file yesterday to trim some old unused code, so i'll take the blame... The fix should just be to add #include typeinfo On top of the file somewhere. Romain Le 16 déc. 2012 à 17:53

Re: [Rcpp-devel] Build of Rcpp from svn failure

2012-12-16 Thread Romain Francois
Sure. Something like that, typeinfo is pretty orthogonal to features of the other includes, so no issue of header order. While you're there, does R CMD check Rcpp work fine ? Romain Le 16 déc. 2012 à 18:04, Thell Fowler tbfowl...@gmail.com a écrit : diff --git a/pkg/Rcpp/src

Re: [Rcpp-devel] How to free memory in Rcpp

2012-12-14 Thread Romain Francois
I dont know. This looks like a deeply hidden problem. Maybe you can enable some rcpp debugging by adding #define RCPP_DEBUG_LEVEL 1 Before you include Rcpp.h, this will give you verbose output, maybe this will help locating the issue. Romain Envoyé de mon iPhone Le 14 déc. 2012 à 16:31

[Rcpp-devel] binding, combining vectors

2012-12-13 Thread Romain Francois
] = x[i] ; for( int j=0; jy.size(); i++, j++) z[i] = y[j] ; I know it is not a big deal for people to write this code, but for example this does not handle the names of the elements, ... and internally I can use more efficient code Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28

Re: [Rcpp-devel] iak problem -- dyn.load unable to load shared object

2012-12-13 Thread Romain Francois
to be the case here. I suppose you have two versions of Rcpp installed; Romain Le 13/12/12 17:08, Glenn Lawyer a écrit : The problem seems to be file privileges. When I run R as superuser, it works. When I run as a normal user, I continue getting Error in dyn.load(libLFile) : unable to load

Re: [Rcpp-devel] binding, combining vectors

2012-12-13 Thread Romain Francois
Le 13/12/12 17:29, Dirk Eddelbuettel a écrit : On 13 December 2012 at 10:01, Romain Francois wrote: | Hello, | | I'd like to add a functionality to bind vectors of the same type (well | sugar expressions really, but let's say it is vectors for the sake of | this email). | | So essentially I'd

Re: [Rcpp-devel] How to free memory in Rcpp

2012-12-13 Thread romain
Hello, What memory do you want to free ? Can you give an example of code where there is memory you'd like to free ? Romain Le 2012-12-13 22:52, Honglang Wang a écrit : Dear All, How to free memory in Rcpp? What's the command? Thanks. Best wishes!   Honglang Wang   Office C402 Wells Hall

Re: [Rcpp-devel] Is 10.1 intentionally stricter than 9.15?

2012-12-13 Thread romain
class can help you. Can you show some examples ? The intention is (and has always been) to hide the macros from the R API so this is not expected. Romain ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r

Re: [Rcpp-devel] How to free memory in Rcpp

2012-12-13 Thread Romain Francois
then gets protected by the result object. If this does not work, then you can do some debugging as indicated by others. Romain Best wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan State University 1579 I Spartan Village, East Lansing, MI 48823 wangh

Re: [Rcpp-devel] RcppArmadillo: passing matrix columns by reference

2012-12-10 Thread Romain Francois
, no data of its own, so cheap copy. double f3(arma::subview_colunsigned int Z) { Z(1, 0) = 223; return 99.9; } Also, including RcppArmadillo.h after Rcpp.h is wrong. You should only include RcppArmadillo.h. I should do something so that the compiler tells you this. Romain Le 10/12/12 16:49

Re: [Rcpp-devel] For a Matrix A, is A(i, j) or A[i, j] preferred as an accessor for an element

2012-12-10 Thread Romain Francois
Le 10/12/12 17:45, Douglas Bates a écrit : On Mon, Dec 10, 2012 at 10:38 AM, Romain Francois rom...@r-enthusiasts.com mailto:rom...@r-enthusiasts.com wrote: Le 10/12/12 17:29, Douglas Bates a écrit : or does it matter? A[i,j] is wrong, not valid C or C++ code. so

Re: [Rcpp-devel] Joining each row of CharacterMatrix to return a CharacterVector?

2012-12-10 Thread Romain Francois
mailto:hic...@wehi.edu.au http://www.wehi.edu.au -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:http://romainfrancois.blog.free.fr |- http://bit.ly/RE6sYH : OOP with Rcpp modules `- http://bit.ly/Thw7IK : Rcpp

Re: [Rcpp-devel] Sparse matrices with RcppArmadillo

2012-12-09 Thread Romain Francois
Thanks for the valuable information. I will look into it more seriously at some point when I have some more time. Romain Le 09/12/12 14:40, c s a écrit : Hi Romain Doug, Two points to note: (1) When poking around internal Armadillo pointers and arrays for sparse matrices, please take

Re: [Rcpp-devel] Sparse matrices with RcppArmadillo

2012-12-08 Thread Romain Francois
don't think there is a better way to fill multiple values ina SpMat, maybe Conrad has insights. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:http://romainfrancois.blog.free.fr |- http://bit.ly

[Rcpp-devel] Rcpp internal benchmark tool

2012-12-08 Thread Romain Francois
raw, so if people have ideas to improve it. See the header: https://r-forge.r-project.org/scm/viewvc.php/pkg/Rcpp/inst/include/Rcpp/Benchmark/Timer.h?view=markuproot=rcpp and the implementation: https://r-forge.r-project.org/scm/viewvc.php/pkg/Rcpp/src/Timer.cpp?view=markuproot=rcpp Romain

Re: [Rcpp-devel] Sparse matrices with RcppArmadillo

2012-12-08 Thread Romain Francois
That looks very similar, if not identical to what dgCMatrix uses. Can you direct me to a constructor where I could feed such information ? Romain Le 08/12/12 17:35, c s a écrit : Armadillo sparse matrices are stored in Compressed Sparse Column format: http://en.wikipedia.org/wiki

Re: [Rcpp-devel] Sparse matrices with RcppArmadillo

2012-12-08 Thread Romain Francois
Ah. One thing I could do is leverage this: #ifdef ARMA_EXTRA_SPMAT_PROTO #include ARMA_INCFILE_WRAP(ARMA_EXTRA_SPMAT_PROTO) #endif Not sure how yet. Le 08/12/12 19:17, Romain Francois a écrit : That looks very similar, if not identical to what dgCMatrix uses. Can you direct me

Re: [Rcpp-devel] Sparse matrices with RcppArmadillo

2012-12-08 Thread Romain Francois
Romain: In general it is very slow to insert non-zero elements into this format. In the worst case the entire structure must be copied and extended for each insertion. We have to keep telling people about this when they tell us that sparse matrices in R are so slow to work with. You have seen

Re: [Rcpp-devel] No matching function for call to as(double) error at compile time

2012-12-06 Thread Romain Francois
should give you enough of a clue. The argument for as is a SEXP : template typename T T as( SEXP m_sexp) and NumericVector::operator[](int) gives you a reference to a double Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r

Re: [Rcpp-devel] How to increase the coding efficiency

2012-12-04 Thread Romain Francois
You are calling back to R using Function. This is expensive. What is ker ? Can you implement it in C++. This is a wild guess, but that is I think where the bottleneck is. Romain Le 04/12/12 20:14, Honglang Wang a écrit : Dear All, I have tried out the first example by using RcppArmadillo

Re: [Rcpp-devel] How to increase the coding efficiency

2012-12-04 Thread Romain Francois
wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan State University 1579 I Spartan Village, East Lansing, MI 48823 wangh...@msu.edu mailto:wangh...@msu.edu On Tue, Dec 4, 2012 at 2:19 PM, Romain Francois rom...@r-enthusiasts.com mailto:rom...@r

Re: [Rcpp-devel] Patch for using Rcpp with proper check of TR1/C++11 headers

2012-12-03 Thread Romain Francois
change in SVN so we have to catch it there. Your patch looks good and careful, nice work. At a first glance, tThe only thing I am a little hesitant about the comparator const change. Romain has/is doing a lot of work on const correctness (and we need a lot more work). But maybe this was something

Re: [Rcpp-devel] Rcpp: Distinguishing between input types to function call

2012-12-03 Thread Romain Francois
out more about C++ templates. Romain The functions are listed below. Best regards Søren -- # include RcppEigen.h # include Rcpp.h #ifndef BEGIN_RCPP #define BEGIN_RCPP #endif #ifndef END_RCPP #define END_RCPP #endif using namespace Rcpp; // standard matrix

Re: [Rcpp-devel] Rcpp 0.10.1 and RcppEigen

2012-11-29 Thread Romain Francois
revision 4049 should really fix RcppEigen. I have checked against unit test from home this time ... as opposed to check that the package compiles from some free wifi in a mall. Romain Le 27/11/12 22:54, Kasper Daniel Hansen a écrit : Rcpp 0.10.1 was released yesterday (?). Installing

Re: [Rcpp-devel] A beginners guide to Rcpp

2012-11-29 Thread Romain Francois
. Thanks for your efforts on this! You're welcome, and any feedback will be greatly appreciated. Hadley -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com `- http://bit.ly/SweN1Z : SuperStorm Sandy blog:http

Re: [Rcpp-devel] Rcpp 0.10.1 and RcppEigen

2012-11-28 Thread romain
detail in Rcpp, which apparently I used in RcppEigen as if it was part of the API. When things like this happen, things like that happen. If anyone wants to fix it before me, it is essentially just about removing one template argument from r_vector_start call. Romain Le 2012-11-27 22:54, Kasper

<    1   2   3   4   5   6   7   >