From 7b8b687bd4f29701d4b207b902f4001f7237def7 Mon Sep 17 00:00:00 2001 From: jhumeau Date: Mon, 21 Jun 2010 15:29:13 +0000 Subject: [PATCH] debug erreur reconnu par le compilateur de Visual Studio git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1860 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-mo/src/problems/eval/moRoyalRoadIncrEval.h | 4 ++-- .../paradiseo-moeo/src/utils/moeoObjectiveVectorNormalizer.h | 2 +- trunk/problems/eval/maxSATeval.h | 4 +++- trunk/problems/eval/royalRoadEval.h | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/trunk/paradiseo-mo/src/problems/eval/moRoyalRoadIncrEval.h b/trunk/paradiseo-mo/src/problems/eval/moRoyalRoadIncrEval.h index e600b5bfd..3296ab25f 100644 --- a/trunk/paradiseo-mo/src/problems/eval/moRoyalRoadIncrEval.h +++ b/trunk/paradiseo-mo/src/problems/eval/moRoyalRoadIncrEval.h @@ -61,14 +61,14 @@ public: unsigned int offset = n * k; unsigned int j = 0; - while (_solution[offset + j] && j < k) j++; + while (j < k && _solution[offset + j]) j++; if (j == k) // the block is complete, so the fitness decreases from one _neighbor.fitness(_solution.fitness() - 1); else { if ((_solution[_neighbor.index()] == 0) && (offset + j == _neighbor.index())) { // can the block be filled? j++; // next bit - while (_solution[offset + j] && j < k) j++; + while ( j < k && _solution[offset + j]) j++; if (j == k) // the block can be filled, so the fitness increases from one _neighbor.fitness(_solution.fitness() + 1); diff --git a/trunk/paradiseo-moeo/src/utils/moeoObjectiveVectorNormalizer.h b/trunk/paradiseo-moeo/src/utils/moeoObjectiveVectorNormalizer.h index 110d3ddac..009fd9725 100644 --- a/trunk/paradiseo-moeo/src/utils/moeoObjectiveVectorNormalizer.h +++ b/trunk/paradiseo-moeo/src/utils/moeoObjectiveVectorNormalizer.h @@ -97,7 +97,7 @@ class moeoObjectiveVectorNormalizer * @param max_param worst vector is set to it * @return a scale to use with the normalizer */ - static Scale make_scale_from_pop(eoPop &_pop, Type &max_param=100){ + static Scale make_scale_from_pop(eoPop &_pop, Type max_param=100){ Scale res; if (_pop.empty()) { std::cout<<"makeScale in moeoObjectiveVEctorNormalizer.h: pop is empty"<[nbVar + 1]; - int var[nbVar]; + //int var[nbVar]; + std::vector var; + var.resize(nbVar); unsigned i, j, ind; // to selected nbLitteral different variables in the clauses diff --git a/trunk/problems/eval/royalRoadEval.h b/trunk/problems/eval/royalRoadEval.h index 2a3df8495..8e866cf48 100644 --- a/trunk/problems/eval/royalRoadEval.h +++ b/trunk/problems/eval/royalRoadEval.h @@ -61,7 +61,7 @@ public: offset = i * k; j = 0; - while (_solution[offset + j] && j < k) j++; + while (j < k && _solution[offset + j]) j++; if (j == k) sum++;