Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De multi thread #553

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions include/pagmo/algorithms/de.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ see https://www.gnu.org/licenses/. */
#include <tuple>
#include <vector>

#include <boost/optional.hpp>

#include <pagmo/algorithm.hpp>
#include <pagmo/bfe.hpp>
#include <pagmo/detail/visibility.hpp>
#include <pagmo/population.hpp>
#include <pagmo/rng.hpp>
Expand Down Expand Up @@ -159,6 +162,10 @@ class PAGMO_DLL_PUBLIC de
{
return m_gen;
}

// Sets the bfe
void set_bfe(const bfe &b);

/// Algorithm name
/**
* One of the optional methods of any user-defined algorithm (UDA).
Expand All @@ -184,6 +191,16 @@ class PAGMO_DLL_PUBLIC de
}

private:
vector_double mutate(const population &pop, population::size_type i, const vector_double &gbIter,
std::uniform_real_distribution<double> drng,
std::uniform_int_distribution<vector_double::size_type> c_idx,
const std::vector<vector_double> &popold) const;

void update_pop(population &pop, const vector_double &newfitness, population::size_type i,
std::vector<vector_double> &fit, vector_double &gbfit, vector_double &gbX,
std::vector<vector_double> &popnew, const std::vector<vector_double> &popold,
const vector_double &tmp) const;

// Object serialization
friend class boost::serialization::access;
template <typename Archive>
Expand All @@ -199,6 +216,7 @@ class PAGMO_DLL_PUBLIC de
unsigned m_seed;
unsigned m_verbosity;
mutable log_type m_log;
boost::optional<bfe> m_bfe;
};

} // namespace pagmo
Expand Down
Loading