简体   繁体   English

DEOptim访问冲突/崩溃

[英]DEOptim access violation / crash

The following code causes an access violation in R (using RGui). 以下代码在R中导致访问冲突(使用RGui)。 If I use RStudio, then RStudio crashes citing DEOptim.dll. 如果我使用RStudio,则RStudio会由于DEOptim.dll而崩溃。 I am using DEoptim 2.1-1. 我正在使用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). 该文档指出,从2.0-3版本开始,要优化的参数数量限制已取消(在DEoptim到C代码的转换中)。 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. 正如Ben Bolker所说,崩溃是一个错误。 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. 更新:在R-forge的修订版73上进行了修补。将在两天内推向CRAN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM