Changeset 8 for src/main/java/weka/clusterers/forMetisMQI/Coarse.java
- Timestamp:
- Sep 11, 2010, 4:12:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/weka/clusterers/forMetisMQI/Coarse.java
r7 r8 13 13 private static boolean debug = true; 14 14 private static PrintStream debugStream = System.err; 15 private static int nodesContracted= 5;15 private static int finerSize = 5; 16 16 17 17 /** … … 61 61 map.set(g.getIndex(matchedNode), labelCounter); 62 62 if(debug) debugStream.println("Contracting node " + u + " with " + matchedNode + ". Node id: " + getMappedNode(g, map, u)); 63 } else 63 } else { 64 64 map.set(g.getIndex(u), labelCounter); 65 if(debug) debugStream.println("Node " + u + " with " + " new node id: " + getMappedNode(g, map, u)); 66 } 65 67 labelCounter++; 66 68 } … … 106 108 //calcolo dei pesi del nuovo grafo: per ogni arco (u,v) && u < v. 107 109 //w(map(u),map(v)) += w(u,v). 108 for(int u=0; u < g.size(); u++) { 110 for(int i=0; i < g.size(); i++) { 111 int u = g.getLabel(i); 109 112 Iterator<Integer> it = g.getNeighbors(u).iterator(); 110 113 while(it.hasNext()) { … … 115 118 } 116 119 } 117 for(int u = 0; u < g.size(); u++) { 120 for(int i=0; i < g.size(); i++) { 121 int u = g.getLabel(i); 118 122 if(isMatched(g,match,u)) { 119 123 int v = getMatchedNode(g,match,u); … … 159 163 if(debug) 160 164 debugStream.println("-----------------------------------------------------"); 161 } while(e.getProjected().size() > e.getContracted().size() && e.getContracted().size() > nodesContracted);165 } while(e.getProjected().size() > e.getContracted().size() && e.getContracted().size() > finerSize); 162 166 return stack; 163 167 } 168 169 public static void setFinerSize(int i) { 170 finerSize = i; 171 } 164 172 }
Note: See TracChangeset
for help on using the changeset viewer.