From f6af3aedb7df7e3f8239caee02a573025f3d2ede Mon Sep 17 00:00:00 2001 From: Rishabh Gupta Date: Mon, 31 Jul 2017 18:16:04 -0400 Subject: [PATCH] seg fault fixed --- few/lib/epsilon_lexicase.h | 36 ++++-------------------------------- few/selection.py | 5 ----- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/few/lib/epsilon_lexicase.h b/few/lib/epsilon_lexicase.h index e54e6b3..6c8d0a3 100644 --- a/few/lib/epsilon_lexicase.h +++ b/few/lib/epsilon_lexicase.h @@ -96,56 +96,28 @@ void epsilon_lexicase(const ExtMat & F, int n, int d, for (int i = 0; i ind_locs; - if(lex_size){ - //randomly select a size from sizes - int max_index = sizes.size(); - int random_index = rand() % max_index; - - - // individual locations - vector ind_locs_temp(sizes[random_index]); - ind_locs = ind_locs_temp; - //ind_locs.reserve(sizes[random_index]); - } - else{ - // individual locations - vector ind_locs_temp(n); - ind_locs = ind_locs_temp; - //ind_locs.reserve(n); - }*/ - - vector ind_locs; - if(lex_size){ +vector ind_locs(n); +if(lex_size){ char message[200]; - PyOS_snprintf(message, sizeof(message),"lex_size"); //randomly select a size from sizes int max_index = sizes.size(); int random_index = rand() % max_index; - vector ind_locs_temp(n); // individual locations int j=0; for(int i=0;i winner; - for (int i = 0; i