From ef15b782f7bce6e38bd54787c1198b6320866b30 Mon Sep 17 00:00:00 2001 From: boufaras Date: Wed, 14 Sep 2011 12:22:04 +0000 Subject: [PATCH] Code optimization git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2361 331e1502-861f-0410-8da2-ba01fb791d7f --- .../ParadisEO-GPU/src/problems/eval/PPPIncrEval.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/branches/ParadisEO-GPU/src/problems/eval/PPPIncrEval.h b/branches/ParadisEO-GPU/src/problems/eval/PPPIncrEval.h index fff99f346..9ce5d22fc 100644 --- a/branches/ParadisEO-GPU/src/problems/eval/PPPIncrEval.h +++ b/branches/ParadisEO-GPU/src/problems/eval/PPPIncrEval.h @@ -66,7 +66,7 @@ public: /** * Incremental evaluation of the PPP solution,function inline can be called from host or device - * @param _solthe solution to evaluate + * @param _sol the solution to evaluate * @param _fitness the fitness of the current solution * @param _index an array that contains a set of indexes corresponding to the current thread identifier neighbor the last element of this array contains neighborhood size */ @@ -75,7 +75,6 @@ public: int H[Nd]; int S[Md]; - int tmp=0; int tmp_1=0; int tmp_2=0; @@ -90,10 +89,10 @@ public: H[j]=0; for (unsigned i=0; i0) - H[tmp-1]=H[tmp-1]+1; + S[i]=S[i]-2*dev_a[i*Nd+_index[k]]*_sol[_index[k]]; + tmp_1=tmp_1+abs(S[i])-S[i]; + if(S[i]>0) + H[S[i]-1]=H[S[i]-1]+1; } for (unsigned j=0; j