-
Notifications
You must be signed in to change notification settings - Fork 184
Fb fix pso memory #487
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
base: master
Are you sure you want to change the base?
Fb fix pso memory #487
Changes from 2 commits
d9eb8ee
e3b6d08
003f435
e74abb3
c4ef9bf
091c1f4
462e1c5
9daa54f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ see https://www.gnu.org/licenses/. */ | |
|
|
||
| #include <string> | ||
| #include <tuple> | ||
| #include <type_traits> | ||
| #include <vector> | ||
|
|
||
| #include <pagmo/algorithm.hpp> | ||
|
|
@@ -223,6 +224,18 @@ class PAGMO_DLL_PUBLIC pso | |
| } | ||
|
|
||
| private: | ||
| struct memory { | ||
| using population_size_t = decltype(std::declval<population>().size()); | ||
|
tarcisiofischer marked this conversation as resolved.
Outdated
|
||
|
|
||
| std::vector<vector_double> m_X; | ||
| std::vector<vector_double> m_lbX; | ||
| std::vector<vector_double> m_fit; | ||
| std::vector<vector_double> m_lbfit; | ||
| vector_double m_best_fit; | ||
| std::vector<std::vector<population_size_t>> m_neighb; | ||
| vector_double m_best_neighb; | ||
| }; | ||
|
|
||
| // Object serialization | ||
| friend class boost::serialization::access; | ||
| template <typename Archive> | ||
|
|
@@ -254,9 +267,10 @@ class PAGMO_DLL_PUBLIC pso | |
| unsigned m_neighb_param; | ||
| // memory | ||
| bool m_memory; | ||
| mutable std::optional<pso::memory> m_memory_data; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've changed this to |
||
|
|
||
| // paricles' velocities | ||
| mutable std::vector<vector_double> m_V; | ||
|
tarcisiofischer marked this conversation as resolved.
Outdated
|
||
|
|
||
| mutable detail::random_engine_type m_e; | ||
| unsigned m_seed; | ||
| unsigned m_verbosity; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.