mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Fix race conditions in differential evolution (#1063)
Through a combination of silly mistakes, I missed a pile of race conditions in the OpenMP threading. Switch to C++ threading. Note that this change requires serial generation of trial vectors. Hopefully I can figure out to parallelize the generation of trial vectors to reduce the serial section a la Ahmdahl's law, while simultaneously keeping thread sanitizer happy.
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <iostream>
|
||||
#include <boost/math/tools/differential_evolution.hpp>
|
||||
#include <boost/math/optimization/differential_evolution.hpp>
|
||||
|
||||
using boost::math::tools::differential_evolution_parameters;
|
||||
using boost::math::tools::differential_evolution;
|
||||
using boost::math::optimization::differential_evolution_parameters;
|
||||
using boost::math::optimization::differential_evolution;
|
||||
|
||||
double rosenbrock(std::vector<double> const & x) {
|
||||
double result = 0;
|
||||
|
||||
Reference in New Issue
Block a user