Commit e8f5873a authored by Colby Green's avatar Colby Green
Browse files

symmetric indexing without using references

parent b9334b6d
......@@ -88,13 +88,13 @@ public:
double distancePrev = distanceMatrix[vertex.index][path[permLength - 1]];
double distanceFirst = distanceMatrix[vertex.index][path[0]];
if (distancePrev == 0){
distanceMatrix[vertex.index][path[permLength - 1]] = distancePrev = pokeDistance(vertex.index, path[permLength - 1]);
distanceMatrix[vertex.index][path[permLength - 1]] = distanceMatrix[path[permLength - 1]][vertex.index] = distancePrev = pokeDistance(vertex.index, path[permLength - 1]);
}
if (distancePrev < minDistanceFromPrev){
minDistanceFromPrev = distancePrev;
}
if (distanceFirst == 0){
distanceMatrix[vertex.index][path[0]] = distanceFirst = pokeDistance(vertex.index, path[0]);
distanceMatrix[vertex.index][path[0]] = distanceMatrix[path[0]][vertex.index] = distanceFirst = pokeDistance(vertex.index, path[0]);
}
if (distanceFirst < minDistanceFromFirst){
minDistanceFromFirst = distanceFirst;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment