[Rcpp-devel] Rcpp syntactic sugar equivalent for R's optimize() function
romain at r-enthusiasts.com
Fri Feb 28 14:08:34 CET 2014
Le 28 févr. 2014 à 11:52, Gregor Kastner <gregor.kastner at wu.ac.at> a écrit :
> Hi Hideyoshi,
>> Is there a way I can just call that function in Rcpp rather than having to
>> install new libraries or create my own? (I presume that there is probably a
>> “C_do_fmin.c” file somewhere that I can use?)
> This questions has been discussed in this list about a month ago:
As Dirk said, this is not the same thing. The level of complexity of calling an internal function of the stats package is quite high.
I’d suggest :
- reimplement clean c++ code as Dirk says
- call the R function optimize form C++. Chances are the overhead of doing that is minimal and anecdotic compared to calling the objective function.
- use something else as Dale says.
> I am now using the approach that Romain suggested in this thread. Be sure to
As it has been reported to me by Brian Ripley, += is a gnu-ism so it is not portable.
Also, you should not have the last `/` So:
PKG_CPPFLAGS = -I../inst/include
> in the Makevars and Makevars.win files. AFAIK know this mechanism is not
> automated (yet), see
More information about the Rcpp-devel