private void expCompare() throws jplag.ExitException { int size = validSubmissions(); int[] similarity = new int[(size * size - size) / 2]; int anzSub = submissions.size(); int i, j, count = 0; Submission s1, s2; AllMatches match; long msec = System.currentTimeMillis(); for (i = 0; i < (anzSub - 1); i++) { s1 = submissions.elementAt(i); if (s1.struct == null) continue; for (j = (i + 1); j < anzSub; j++) { s2 = submissions.elementAt(j); if (s2.struct == null) continue; match = this.gSTiling.compare(s1, s2); similarity[count++] = (int) match.percent(); } } long time = System.currentTimeMillis() - msec; // output System.out.print(options.root_dir + " "); System.out.print(options.min_token_match + " "); System.out.print(options.filtername + " "); System.out.print((time) + " "); for (i = 0; i < similarity.length; i++) System.out.print(similarity[i] + " "); System.out.println(); }
public final AllBasecodeMatches compareWithBasecode(Submission subA, Submission subB) { Submission A, B, tmp; if (subA.struct.size() > subB.struct.size()) { A = subB; B = subA; } else { A = subB; B = subA; } // if hashtable exists in first but not in second structure: flip around! if (B.struct.table == null && A.struct.table != null) { tmp = A; A = B; B = tmp; } return compareWithBasecode(A, B, this.program.get_min_token_match()); }
gSTiling.create_hashes(subm.struct, options.min_token_match, true); if (options.externalSearch) { if (subm.struct != null) { gSTiling.create_hashes(subm.struct, options.min_token_match, false); subm.struct.save(new File("temp", subm.dir.getName() + subm.name)); subm.struct = null;
s1 = submissions.elementAt(i); bcmatch = this.gSTiling.compareWithBasecode(s1, basecodeSubmission); htBasecodeMatches.put(s1.name, bcmatch); this.gSTiling.resetBaseSubmission(basecodeSubmission); countBC++; options.setProgress(countBC * 100 / size); match = this.gSTiling.compare(s1, s2);
for (int i = 0; i < size; i++) { s1 = submissions.elementAt(i); bcmatch = gSTiling.compareWithBasecode(s1, basecodeSubmission); htBasecodeMatches.put(s1.name, bcmatch); gSTiling.resetBaseSubmission(basecodeSubmission); options.setProgress((i + 1) * 100 / size); } while (s2.struct == null); match = this.gSTiling.compare(s1, s2);
public final AllMatches compare(Submission subA, Submission subB) { Submission A, B, tmp; if (subA.struct.size() > subB.struct.size()) { A = subB; B = subA; } else { A = subB; B = subA; } // if hashtable exists in first but not in second structure: flip around! if (B.struct.table == null && A.struct.table != null) { tmp = A; A = B; B = tmp; } return compare(A, B, this.program.get_min_token_match()); }
this.gSTiling.create_hashes(subm.struct, options.min_token_match, false); subm.struct.save(new File("temp", subm.dir.getName() + subm.name)); subm.struct = null;
create_hashes(structA, mml, true); create_hashes(structB, mml, true);
match = this.gSTiling.compare(s1, s2); anz++;
create_hashes(structA, mml, false); create_hashes(structB, mml, true);