From 15112432b8c0c66809904b356e6573cdba6bb42d Mon Sep 17 00:00:00 2001 From: boufaras Date: Wed, 14 Sep 2011 12:02:41 +0000 Subject: [PATCH] code optimization git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2360 331e1502-861f-0410-8da2-ba01fb791d7f --- .../ParadisEO-GPU/src/problems/eval/PPPIncrEval.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/branches/ParadisEO-GPU/src/problems/eval/PPPIncrEval.h b/branches/ParadisEO-GPU/src/problems/eval/PPPIncrEval.h index 3728e86b5..fff99f346 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 _bitVector the solution to evaluate + * @param _solthe 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,6 +75,7 @@ public: int H[Nd]; int S[Md]; + int tmp=0; int tmp_1=0; int tmp_2=0; @@ -89,10 +90,10 @@ public: H[j]=0; for (unsigned i=0; i0) - H[S[i]-1]=H[S[i]-1]+1; + tmp=S[i]-2*dev_a[i*Nd+_index[k]]*_sol[_index[k]]; + tmp_1=tmp_1+abs(tmp)-tmp; + if(tmp>0) + H[tmp-1]=H[tmp-1]+1; } for (unsigned j=0; j