Test & Update for new version

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2681 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
boufaras 2012-01-24 01:37:35 +00:00
commit 89af347c09
4 changed files with 108 additions and 103 deletions

View file

@ -1,6 +1,6 @@
/* /*
<testSimpleTS_CPU.cu> <testSimpleTS_CPU.cu>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2012
Karima Boufaras, Thé Van LUONG Karima Boufaras, Thé Van LUONG

View file

@ -1,6 +1,6 @@
/* /*
<Problem.h> <Problem.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2012
Karima Boufaras, Thé Van LUONG Karima Boufaras, Thé Van LUONG
@ -44,7 +44,8 @@ void load(char * _fileName) {
fstream file(_fileName, ios::in); fstream file(_fileName, ios::in);
if (!file) { if (!file) {
string str = "QAPData: Could not open file [" + (string)_fileName + "]."; string str = "QAPData: Could not open file [" + (string) _fileName
+ "].";
throw runtime_error(str); throw runtime_error(str);
} }
unsigned i, j; unsigned i, j;

View file

@ -1,6 +1,6 @@
/* /*
<QapEval.h> <QapEval.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2012
Karima Boufaras, Thé Van LUONG Karima Boufaras, Thé Van LUONG

View file

@ -1,6 +1,6 @@
/* /*
<QapIncrEval.h> <QapIncrEval.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2012
Karima Boufaras, Thé Van LUONG Karima Boufaras, Thé Van LUONG
@ -53,13 +53,15 @@ class QapIncrEval : public moEval<Neighbor>{
* Constructor * Constructor
*/ */
QapIncrEval(){} QapIncrEval() {
}
/** /**
* Destructor * Destructor
*/ */
~QapIncrEval(){} ~QapIncrEval() {
}
/** /**
* Functor for incremental evaluation of the solution * Functor for incremental evaluation of the solution
@ -83,17 +85,19 @@ class QapIncrEval : public moEval<Neighbor>{
* @param j the second position of swap * @param j the second position of swap
*/ */
unsigned int compute_delta(EOT & _sol,unsigned i,unsigned j) unsigned int compute_delta(EOT & _sol, unsigned i, unsigned j) {
{
int d; int d;
int k; int k;
d = (a[i*n+i]-a[j*n+j])*(b[_sol[j]*n+_sol[j]]-b[_sol[i]*n+_sol[i]]) + d = (a[i * n + i] - a[j * n + j]) * (b[_sol[j] * n + _sol[j]]
(a[i*n+j]-a[j*n+i])*(b[_sol[j]*n+_sol[i]]-b[_sol[i]*n+_sol[j]]); - b[_sol[i] * n + _sol[i]]) + (a[i * n + j] - a[j * n + i])
* (b[_sol[j] * n + _sol[i]] - b[_sol[i] * n + _sol[j]]);
for (k = 0; k < n; k = k + 1) for (k = 0; k < n; k = k + 1)
if (k != i && k != j) if (k != i && k != j)
d = d + (a[k*n+i]-a[k*n+j])*(b[_sol[k]*n+_sol[j]]-b[_sol[k]*n+_sol[i]]) + d = d + (a[k * n + i] - a[k * n + j]) * (b[_sol[k] * n
(a[i*n+k]-a[j*n+k])*(b[_sol[j]*n+_sol[k]]-b[_sol[i]*n+_sol[k]]); + _sol[j]] - b[_sol[k] * n + _sol[i]]) + (a[i * n + k]
- a[j * n + k]) * (b[_sol[j] * n + _sol[k]] - b[_sol[i]
* n + _sol[k]]);
return (d); return (d);
} }
}; };