/** * Checks whether a given molecule is isomorphic with the one * that has been assigned to this IsomorphismTester at construction time. * * @param mol1 A first molecule to check against the second one * @param mol2 A second molecule to check against the first * @return True, if the two molecules are isomorphic */ public boolean isIsomorphic(IAtomContainer mol1, IAtomContainer mol2) { setBaseTable(mol1); return isIsomorphic(mol2); }
@Test public void testIsIsomorphic_IAtomContainer_IAtomContainer() throws Exception { IsomorphismTester it = new IsomorphismTester(); Assert.assertTrue(it.isIsomorphic(pinene_2, pinene_1)); Assert.assertFalse(it.isIsomorphic(pinene_2, pinene_non)); }
@Test public void testIsomorphismTester_IAtomContainer() throws Exception { IsomorphismTester it = new IsomorphismTester(pinene_1); Assert.assertNotNull(it); }
/** * Constructor for the IsomorphismTester object */ public IsomorphismTester(IAtomContainer mol) throws NoSuchAtomException { setBaseTable(mol); }
IAtom atom1 = null; IAtom atom2 = null; setCompareTable(mol2); for (int f = 0; f < sortedBaseTable.length; f++) { if (sortedBaseTable[f] != sortedCompareTable[f]) {
@Test public void testIsIsomorphic_IAtomContainer() throws Exception { IsomorphismTester it = new IsomorphismTester(pinene_1); Assert.assertTrue(it.isIsomorphic(pinene_2)); Assert.assertFalse(it.isIsomorphic(pinene_non)); }
@Test public void testIsomorphismTester() throws Exception { IsomorphismTester it = new IsomorphismTester(); Assert.assertNotNull(it); }
IsomorphismTester it = new IsomorphismTester(apinene); assertTrue(it.isIsomorphic(mol.getBuilder().newInstance(IAtomContainer.class, mol)));