Re: [Rcpp-devel] Additional parameters for an objective function, e.g. in RcppDE

2013-05-02 Thread Dirk Eddelbuettel
Hi Christoph, On 30 April 2013 at 10:20, Christoph Bergmeir wrote: | Hi Dirk (and the rest of the list), | | I think I have it working; attached is a patch that adds this | functionality to RcppDE. I also came along something which is probably a | bug: The passed environment is never used. In

Re: [Rcpp-devel] Additional parameters for an objective function, e.g. in RcppDE

2013-04-29 Thread Christoph Bergmeir
Hi Dirk (and the rest of the list), I think I have it working; attached is a patch that adds this functionality to RcppDE. I also came along something which is probably a bug: The passed environment is never used. In line 75 of DEoptim.R you just create one. I changed this to if(!hasArg(env)

Re: [Rcpp-devel] Additional parameters for an objective function, e.g. in RcppDE

2013-04-28 Thread Dirk Eddelbuettel
On 29 April 2013 at 14:22, Christoph Bergmeir wrote: | Hi, | | ok, that's exactly the file I was looking at right now. The problem is | that my objective function is implemented in C++, and passed as an | external pointer. So in evaluate.h, instead of in the EvalStandard case | I'm in the Eval

Re: [Rcpp-devel] Additional parameters for an objective function, e.g. in RcppDE

2013-04-28 Thread Christoph Bergmeir
Hi, ok, that's exactly the file I was looking at right now. The problem is that my objective function is implemented in C++, and passed as an external pointer. So in evaluate.h, instead of in the EvalStandard case I'm in the EvalCompiled case, where the environment is not used. My question no

Re: [Rcpp-devel] Additional parameters for an objective function, e.g. in RcppDE

2013-04-28 Thread Dirk Eddelbuettel
On 29 April 2013 at 13:55, Christoph Bergmeir wrote: | Hi, | | thanks Dirk for the prompt reply. Ok, this was also the solution I had | in mind. I'll try to find the code in RcppDE or try to implement it | myself..I'll keep you posted with any advances. I think this may do the trick: demo/env

Re: [Rcpp-devel] Additional parameters for an objective function, e.g. in RcppDE

2013-04-28 Thread Christoph Bergmeir
Hi, thanks Dirk for the prompt reply. Ok, this was also the solution I had in mind. I'll try to find the code in RcppDE or try to implement it myself..I'll keep you posted with any advances. Regards, Christoph On 04/29/2013 01:44 PM, Dirk Eddelbuettel wrote: On 29 April 2013 at 12:37, Chri

Re: [Rcpp-devel] Additional parameters for an objective function, e.g. in RcppDE

2013-04-28 Thread Dirk Eddelbuettel
On 29 April 2013 at 12:37, Christoph Bergmeir wrote: | Dear list, | | I'm looking for some advice on a specific problem. Using RcppDE there is | the possibility to give the optimizer directly an external pointer to | the C++ function it will use as the objective function. I found this | mechan

[Rcpp-devel] Additional parameters for an objective function, e.g. in RcppDE

2013-04-28 Thread Christoph Bergmeir
Dear list, I'm looking for some advice on a specific problem. Using RcppDE there is the possibility to give the optimizer directly an external pointer to the C++ function it will use as the objective function. I found this mechanism pretty useful as it may speed up things quite a lot (I have a