开发者

R instantiation when called from c++

开发者 https://www.devze.com 2023-02-12 22:38 出处:网络
I am using Rcpp and RInside, to interconnectmy 开发者_JAVA百科R based code to c++. I make multiple distinct calls to R from c++. I wanted to know if each call to R, creates a new instance of R ?

I am using Rcpp and RInside, to interconnect my 开发者_JAVA百科R based code to c++. I make multiple distinct calls to R from c++. I wanted to know if each call to R, creates a new instance of R ?

The reason I want to know this is cos I want to optimize my c++ code, by pre-computing stuff, etc. But I don't know how the calls are internally handled ?

Thnx

-egon.


As R is single-threaded, there is precisely one instance. It is stateful. You create it once at startup, and do whichever inits you need to make.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号