Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2015-01-04 Thread Simon Riddell
Dear all, Thank you for your responses. I will look into the resources and code you have shared and hopefully I can figure something out! I appreciate your time and help. Simon On Fri, Jan 2, 2015 at 12:45 PM, Mark Clements wrote: > Alternatively, one could use the code for Brent_fmin() from t

Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2015-01-02 Thread Mark Clements
Alternatively, one could use the code for Brent_fmin() from the stats library (e.g. https://github.com/lgautier/R-3-0-branch-alt/blob/master/src/library/stats/src/optimize.c). I have done this for the rstpm2 library (https://github.com/mclements/rstpm2/blob/develop/src/c_optim.cpp). This does use

Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2014-12-23 Thread Dirk Eddelbuettel
On 23 December 2014 at 08:21, Hao Ye wrote: | There are also some minima-finding functions in GSL that you may want to look | into. The source for RcppGSL might help with a fully c++ version. Yes. And there are a bazillion optimisation packages on CRAN: http://cran.r-project.org/web/views/O

Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2014-12-23 Thread Hao Ye
Simon, There are also some minima-finding functions in GSL that you may want to look into. The source for RcppGSL might help with a fully c++ version. Best, -- Hao Ye h...@ucsd.edu On Dec 23, 2014, at 12:04 AM, Simon Riddell wrote: > Hello, > > I have been judiciously using RCPP for six mont

Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2014-12-23 Thread Gabor Grothendieck
On Tue, Dec 23, 2014 at 12:04 AM, Simon Riddell wrote: > Hello, > > I have been judiciously using RCPP for six months, and have had my numerous > questions answered so far from previous threads. I have now run into an > issue I cannot get a handle on: > > I have converted a fairly large (recursive

Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2014-12-22 Thread jashander
Simon,  If you're using Boost, // [[Rcpp::depends(BH)]] might be very helpful (if tools/minima.hpp is in the BH package). See  http://gallery.rcpp.org/articles/a-first-boost-example/ - Jaime On Mon, Dec 22, 2014 at 10:37 PM, Simon Riddell wrote: > Brief Update, > Avraham's advice helpe

Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2014-12-22 Thread Simon Riddell
Brief Update, Avraham's advice helped me get a better idea of where to start. What I am now trying to do is learn from this post, which explains how to use external libraries in RCPP ( http://stackoverflow.com/questions/13995266/using-3rd-party-header-files-with-rcpp). And secondly, try to use tha

Re: [Rcpp-devel] Best Practice for Optimize Functions in RCPP

2014-12-22 Thread Avraham Adler
Hello, Simon. I ran into a similar problem before (with uniroot ), and what I found was that the function in R is actually written in C. I found the original code, but not being a real programmer, I stopped working on what I wa

[Rcpp-devel] Best Practice for Optimize Functions in RCPP

2014-12-22 Thread Simon Riddell
Hello, I have been judiciously using RCPP for six months, and have had my numerous questions answered so far from previous threads. I have now run into an issue I cannot get a handle on: I have converted a fairly large (recursive) Kalman filter function from R to C++ using RCPP. This function is