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

update

parent efdf2c05
......@@ -78,24 +78,21 @@ public:
}
double minDistanceFromPrev = numeric_limits<double>::infinity();
double minDistanceFromFirst = numeric_limits<double>::infinity();
for (size_t i = 0; i < v.size(); i++){
double distance = distanceMatrix[v[i].index][path[permLength - 1]];
if (distance == 0){
distanceMatrix[v[i].index][path[permLength - 1]] = distance = pokeDistance(v[i].index, path[permLength - 1]);
double distancePrev = distanceMatrix[v[i].index][path[permLength - 1]];
double distanceFirst = distanceMatrix[v[i].index][path[0]];
if (distancePrev == 0){
distanceMatrix[v[i].index][path[permLength - 1]] = distancePrev = pokeDistance(v[i].index, path[permLength - 1]);
}
if (distance < minDistanceFromPrev){
minDistanceFromPrev = distance;
if (distancePrev < minDistanceFromPrev){
minDistanceFromPrev = distancePrev;
}
}
double minDistanceFromFirst = numeric_limits<double>::infinity();
for (size_t i = 0; i < v.size(); i++){
double distance = distanceMatrix[v[i].index][path[0]];
if (distance == 0){
distanceMatrix[v[i].index][path[0]] = distance = pokeDistance(v[i].index, path[0]);
if (distanceFirst == 0){
distanceMatrix[v[i].index][path[0]] = distanceFirst = pokeDistance(v[i].index, path[0]);
}
if (distance < minDistanceFromFirst){
minDistanceFromFirst = distance;
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