Modify incremental eval QAP

This commit is contained in:
verel 2013-02-06 12:08:15 +01:00
commit 3e78afdd59
2 changed files with 19 additions and 3 deletions

View file

@ -61,10 +61,10 @@ public:
int d;
int k;
unsigned i, j;
_neighbor.getIndices(n, i, j);
unsigned i = _neighbor.first();
unsigned j = _neighbor.second();
// _neighbor.getIndices(n, i, j);
d = (A[i][i]-A[j][j])*(B[_solution[j]][_solution[j]]-B[_solution[i]][_solution[i]]) +
(A[i][j]-A[j][i])*(B[_solution[j]][_solution[i]]-B[_solution[i]][_solution[j]]);

View file

@ -107,6 +107,22 @@ public:
index( _first + n * (n - 1) / 2 );
}
/**
* Getter of the firt location
* @return first indice
*/
unsigned int first() {
return indices.first;
}
/**
* Getter of the second location
* @return second indice
*/
unsigned int second() {
return indices.second;
}
private:
std::pair<unsigned int, unsigned int> indices;