public void timeFile(File dir, String filename) throws CDKException, IOException { IAtomContainer atomContainer = readFile(new File(dir, filename)); long start; start = System.currentTimeMillis(); EquivalentClassPartitioner it = new EquivalentClassPartitioner(atomContainer); int equivalentClass[] = it.getTopoEquivClassbyHuXu(atomContainer); Partition huXuPartition = ArrayToPartition.convert(equivalentClass, 1); long elapsedHuXu = System.currentTimeMillis() - start; start = System.currentTimeMillis(); AtomDiscretePartitionRefiner refiner = new AtomDiscretePartitionRefiner(); refiner.refine(atomContainer); Partition refinedPartition = refiner.getAutomorphismPartition(); long elapsedRef = System.currentTimeMillis() - start; long order = refiner.getAutomorphismGroup().order(); boolean partitionsEqual = refinedPartition.equals(huXuPartition); System.out.println( filename + "\t" + atomContainer.getAtomCount() + "\t" + elapsedRef + "\t" + elapsedHuXu + "\t" + order + "\t" + refinedPartition.size() + "\t" + partitionsEqual); }
public void compareResults(IAtomContainer atomContainer, int count) throws NoSuchAtomException { AtomDiscretePartitionRefiner refiner = new AtomDiscretePartitionRefiner(); refiner.refine(atomContainer); Partition refinedPartition = refiner.getAutomorphismPartition(); EquivalentClassPartitioner it = new EquivalentClassPartitioner(atomContainer); int equivalentClass[] = it.getTopoEquivClassbyHuXu(atomContainer); Partition huXuPartition = ArrayToPartition.convert(equivalentClass, 1); if (refinedPartition.equals(huXuPartition)) { System.out.println(count + " Equal"); } else { System.out.println(count + " Failed"); System.out.println(AtomContainerPrinter.toString(atomContainer)); System.out.println(refinedPartition); System.out.println(huXuPartition); } }