Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 73989d59 authored by David Parsons's avatar David Parsons
Browse files

move fn defs to .cpp

parent 61a2f463
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,28 @@
namespace aevol {
DnaFactory::DnaFactory(DnaFactory_Policy policy, int pool_size, int init_size, int pop_size) {
policy_ = policy;
pool_size_ = pool_size;
// printf("Pool init \n");
init(init_size, pop_size);
}
DnaFactory::~DnaFactory() {
for (auto &&it_dna: list_unused_dna_) {
delete it_dna;
}
list_unused_dna_.clear();
for (size_t j = 0; j < local_list_unused_dna_.size(); j++) {
for (auto &&it_dna: local_list_unused_dna_[j]) {
delete it_dna;
}
local_list_unused_dna_[j].clear();
}
local_list_unused_dna_.clear();
}
void DnaFactory::init(int init_size, int pop_size) {
if (policy_ != DnaFactory_Policy::LOCAL_GLOBAL_FIT) {
if (policy_ != DnaFactory_Policy::ALLOCATE) {
......
......@@ -51,27 +51,8 @@ class ExpManager_7;
class DnaFactory {
public:
DnaFactory(DnaFactory_Policy policy, int pool_size, int init_size, int pop_size = -1) {
policy_ = policy;
pool_size_ = pool_size;
// printf("Pool init \n");
init(init_size, pop_size);
}
~DnaFactory() {
for (auto &&it_dna: list_unused_dna_) {
delete it_dna;
}
list_unused_dna_.clear();
for (size_t j = 0; j < local_list_unused_dna_.size(); j++) {
for (auto &&it_dna: local_list_unused_dna_[j]) {
delete it_dna;
}
local_list_unused_dna_[j].clear();
}
local_list_unused_dna_.clear();
}
DnaFactory(DnaFactory_Policy policy, int pool_size, int init_size, int pop_size = -1);
~DnaFactory();
void init(int init_size, int pop_size = -1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment