forum.alglib.nethttp://forum.alglib.net/ termination and minlmrequesttermination(state) issueshttp://forum.alglib.net/viewtopic.php?f=2&t=4383 Page 1 of 1

 Author: thirteenPhysics [ Tue Jun 01, 2021 10:36 am ] Post subject: termination and minlmrequesttermination(state) issues Hello,I'm using the Levenberg Marquardt algorithm to optimize a simulation based problem. Algo works fine but I have some issues with the termination. I'm tracking the different iterations and the final solution is not the best that have been tested for my problem. I tried to call "minlmrequesttermination(state);" in my call-back function to force termination at the right moment, but i'm not sure how to do it. If you have any suggestions on why the final result of optimisation isn't the best one and/or can I code "minlmrequesttermination(state) properly, I'll be glad.Thanks in advance !Here is my call back function :void functionRT_fvec(const real_1d_array &x, real_1d_array &fi, void *ptr){ InputDataRT temp = *((InputDataRT *)ptr); int size = temp.vec.size(); std::ofstream indices("./data/indices/TEMP-Optimisation.dat"); for (size_t j = 0; j> freq; RTERad >> R; RTERad >> Tr; RTERad >> rad; RTERad >> E; } } } else {std::cout << "Can't open MCRT output file !" << std::endl;} //std::cout << "indexes are : " << x[0] << " " << x[1] << std::endl; fi[0] = temp.data_R-R; fi[1] = temp.data_T-Tr; if(abs(fi[0]) <= 1e-2 && abs(fi[1]) <= 1e-2) { minlmstate state; /* redefining state is certainly not the right way */ std::cout << "STOP REQUIRED" << std::endl; minlmrequesttermination(state); }};

 Page 1 of 1 All times are UTC Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Grouphttp://www.phpbb.com/