Re: [Rcpp-devel] Testing for existence of named components

2012-03-28 Thread Jonas Rauch
If I remember correctly, environments use hash tables to lookup names. In pure R to check if an element L[["key"]] exists I would usually use > "key" %in% names(L) which seems to be reasonably fast. `%in%` works in vectors, too > keys %in% L returning exactly what Dirks suggestion was supposed to

Re: [Rcpp-devel] C++ code for ordinary differential equations

2011-10-05 Thread Jonas Rauch
;-( Jonas On Thu, Oct 6, 2011 at 12:18 AM, Dirk Eddelbuettel wrote: > > On 5 October 2011 at 16:59, Douglas Bates wrote: > | On Wed, Oct 5, 2011 at 2:45 PM, Dirk Eddelbuettel > wrote: > | > > | > On 5 October 2011 at 14:07, Douglas Bates wrote: > | > | O

Re: [Rcpp-devel] C++ code for ordinary differential equations

2011-10-05 Thread Jonas Rauch
I am using the deSolve package successfully and I think it is probably your best option if you want to do things in R. The most widespread solver in C++ is the Sundials Suite as far as I know: https://computation.llnl.gov/casc/sundials/main.html I think someone starting writing an interface to R, b

Re: [Rcpp-devel] is std::sort function broken??

2011-09-22 Thread Jonas Rauch
Hi, I don't have access to a computer with R atm so I can't try. But the includes="#include , #include , #include . #include " looks fishy to me. First of all, note the dot before the last "include" instead of a comma. Secondly: wouldn't you need something like the below? includes=c("#include ","#i

Re: [Rcpp-devel] Where is compileCode() ?

2011-08-23 Thread Jonas Rauch
It's in the inline package in the file R/cfunction.R Jonas On Wed, Aug 24, 2011 at 6:49 AM, Darren Cook wrote: > Trying to understand some of the Rcpp/inline internals I was led to a > call to compileCode() [1]. This is called from both cxxfunction and > cfunction, but I cannot find it anywher

Re: [Rcpp-devel] Fwd: Rcpp and rpy2

2011-08-15 Thread Jonas Rauch
ction is very expensive to evaluate and is implemented in R using Rcpp and various other R libraries. Using OpenOpt allows to try a lot of different solvers without having to change my implementation. On Mon, Aug 15, 2011 at 2:59 PM, Dirk Eddelbuettel wrote: > > On 15 August 2011 at 10:00,

Re: [Rcpp-devel] Fwd: Rcpp and rpy2

2011-08-15 Thread Jonas Rauch
On 12 August 2011 at 14:33, Jonas Rauch wrote: > | Hi Dirk and Romain, > | > | Aparrently libR is not loaded by rpy2, at least not in a way such that > Rcpp can > | access it. I have solved the problem by adding -lR to the linker flags > when > | building Rcpp. Since for normal u

[Rcpp-devel] Fwd: Rcpp and rpy2

2011-08-12 Thread Jonas Rauch
Makevars file in a future version of Rcpp? Or does this lead to problems in case R is build without libR.so? Best regards, Jonas -- Forwarded message -- From: Jonas Rauch Date: Fri, Aug 12, 2011 at 10:36 AM Subject: Rcpp and rpy2 To: rcpp-devel Is Rcpp compatible with rpy2? I

[Rcpp-devel] Rcpp and rpy2

2011-08-12 Thread Jonas Rauch
Is Rcpp compatible with rpy2? I would like to call a very complex R function from python. My function depends on code implemented with Rcpp. When I try to load Rcpp from python via import rpy2.robjects as robjects robjects.r('library(Rcpp)') I get the following: Error in dyn.load(file, DLLpath =

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-07-08 Thread Jonas Rauch
, Douglas Bates a écrit : >> >>> On Wed, Jun 15, 2011 at 6:38 AM, Jonas >>> Rauch> wrote: >>> >>>> Hey again, >>>> >>>> just to clarify: The final solution was to implement all methods of the >>>> derived cl

Re: [Rcpp-devel] Presentation of Rcpp in Meielisalp

2011-06-29 Thread Jonas Rauch
Just as a remark: As a long term R user I have to object to your use of "=" in the R code (e.g. on page 20). There is a difference between the operator "<-", which us usually used for assignment, and "=", although in your examples they do the same [1]. Best regards, Jonas [1] http://stat.ethz.ch/

Re: [Rcpp-devel] Rcpp Module Errors

2011-06-21 Thread Jonas Rauch
I had the same problem before I realized that when a Module is loaded as part of a package (instead of manually loading the shared lib) you don't need the whole > Module('yada','test')$ ... just try >bla() The exposed classes and functions are automatically made available in the namespace of the p

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-15 Thread Jonas Rauch
but works perfectly. Best regards, Jonas On Wed, Jun 15, 2011 at 7:16 AM, Jonas Rauch wrote: > Actually, having just the declaration like this compiled fine but and ended > up in an unresolved symbol when loading the library. > > class Bar : public Foo { > ... >

[Rcpp-devel] Rcpp modules: Classes as arguments

2011-06-14 Thread Jonas Rauch
On a related note to the question on derived classes I sent yesterday, here is another interesting idea. Assume I have classes class Foo { ... }; class Bar { ... //pass Foo pointer as parameter void myMethod(Foo* X) { ... } //or Foo reference void myMethod2(Fo

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-14 Thread Jonas Rauch
, Jonas On Tue, Jun 14, 2011 at 7:36 PM, Dirk Eddelbuettel wrote: > > Hi Jonas, > > On 14 June 2011 at 19:06, Jonas Rauch wrote: > | I am trying to write an R interface to a library that uses derived > classes in > | the following manner: > | > | class Foo { > | .

[Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-14 Thread Jonas Rauch
implementations of "Action". Is it possible to expose Bar::doSomething() to R using Rcpp modules? I have tried different things and did not get it to work. I would appreciate any help. Best regards, Jonas Rauch ___ Rcpp-devel mailing list Rcpp-devel@lists