CMA-ES / libcmaes

libcmaes is a multithreaded C++11 library with Python bindings for high performance blackbox stochastic optimization using the CMA-ES algorithm for Covariance Matrix Adaptation Evolution Strategy
Other
321 stars 78 forks source link

Debug Assertion Fail #198

Open lihanwei opened 5 years ago

lihanwei commented 5 years ago

Hi, I rewrite the sample code shown as below in the debug mode, but it cause a runtime library fail which is not appeared in release mode. I just change the sigma into a vector and it can not run in debug mode.

int main(int argc, char *argv[]) { int dim = 10; std::vector<double> x0(dim,10.0); std::vector<double> sigma(dim, 0.1); CMAParameters<> cmaparams = CMAParameters<>(x0, sigma); CMASolutions cmasols = cmaes<>(fsphere,cmaparams); return cmasols.run_status(); }

Can anyone tell me what's the problem is?

The error message is shown as below:

Debug Assertion Failed!
Program: C:\WINDOWS\SYSTEM32\MSVCP120D.dll
File:C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\vector
Line: 72
Expression:vector iterator not dereferencable