The following code causes an access violation in R (using RGui). If I use RStudio, then RStudio crashes citing DEOptim.dll. I am using DEoptim 2.1-1. Everything works fine if I reduce the length of lower/upper. The documentation states that as of 2.0-3 the limit on the number of parameters to optimize has been lifted (in the conversion of DEoptim to C code). Is this a bug or am I missing something? Advice on how to proceed?
library(DEoptim)
objFunc = function( x )
{
return(mean(x))
}
lower = rep( -.1 , 400 )
upper = rep( .1 , 400 )
result = DEoptim( objFunc , lower = lower , upper = upper )
Traceback:
1: .Call("DEoptimC", lower, upper, fn, ctrl, new.env(), PACKAGE = "DEoptim")
2: DEoptim(objFunc, lower = lower, upper = upper)
Error in DEoptim(objFunc, lower = lower, upper = upper) :
caught access violation - continue with care
As Ben Bolker said, a crash is a bug. Thank you for the minimal reproducible example. I will fix this today.
UPDATE: Patched on R-forge, revision 73. Will push to CRAN in a couple days.