Created
December 4, 2016 22:55
-
-
Save ArchdukeTim/fccec51a8ace93e13a63e1597c83d4fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (change >= tolerance) | |
{ | |
change = 0.0; | |
for (int i = 1; i < path.length - 1; i++) | |
{ | |
for (int j = 0; j < path[i].length; j++) | |
{ | |
double aux = newPath[i][j]; | |
newPath[i][j] += (weight_data * (path[i][j] - newPath[i][j])) + (weight_smooth * (newPath[i - 1][j] + newPath[i + 1][j] - (2.0 * newPath[i][j]))); | |
change += Math.abs(aux - newPath[i][j]); | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while change >= tolerance: | |
change = 0.0 | |
for i in range(1, len(path) - 1): | |
for j in range(0, len(path[i])): | |
aux = newPath[i][j] | |
index+=1 | |
newPath[i][j] += (weight_data * (path[i][j] - newPath[i][j])) + (weight_smooth * (newPath[i - 1][j] + newPath[i + 1][j] - (2.0 * newPath[i][j]))) | |
change += abs(aux - newPath[i][j]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment