Commit b65ee66f authored by sbalev's avatar sbalev

Quick fix for #60.

I leave it open, all this modularity stuff needs to be rewritten.
parent f1b4622a
...@@ -732,13 +732,21 @@ public class Toolkit extends ...@@ -732,13 +732,21 @@ public class Toolkit extends
double sumE = 0, Tr = 0; double sumE = 0, Tr = 0;
double communityCount = E.length; double communityCount = E.length;
for (int y = 0; y < communityCount; ++y) { // for (int y = 0; y < communityCount; ++y) {
for (int x = y; x < communityCount; ++x) { // for (int x = y; x < communityCount; ++x) {
if (x == y) // if (x == y)
Tr += E[x][y]; // Tr += E[x][y];
//
sumE += E[x][y] * E[x][y]; // sumE += E[x][y] * E[x][y];
} // }
// }
for (int i = 0; i < communityCount; i++) {
Tr += E[i][i];
double a = 0;
for (int j = 0; j < communityCount; j++)
a += E[i][j];
sumE += a * a;
} }
return (Tr - sumE); return (Tr - sumE);
......
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