/**{@inheritDoc} */ @Override public Iterator<int[]> iterator() { if (subgraph) { return new StateStream(new VFSubState(container1, container2, g1, g2, bonds1, bonds2, atomMatcher, bondMatcher)); } return new StateStream( new VFState(container1, container2, g1, g2, bonds1, bonds2, atomMatcher, bondMatcher)); } }
/** * Create a sub state for matching benzene to naphthalene Benzene: * InChI=1/C6H6/c1-2-4-6-5-3-1/h1-6H Naphthalene: InChI=1/C10H8/c1-2-6-10-8-4-3-7-9(10)5-1/h1-8H */ VFState createBenzeneToNaphthalene(AtomMatcher atomMatcher, BondMatcher bondMatcher) throws Exception { IAtomContainer container1 = TestMoleculeFactory.makeBenzene(); IAtomContainer container2 = TestMoleculeFactory.makeNaphthalene(); GraphUtil.EdgeToBondMap bonds1 = GraphUtil.EdgeToBondMap.withSpaceFor(container1); GraphUtil.EdgeToBondMap bonds2 = GraphUtil.EdgeToBondMap.withSpaceFor(container2); int[][] g1 = GraphUtil.toAdjList(container1, bonds1); int[][] g2 = GraphUtil.toAdjList(container2, bonds2); return new VFState(container1, container2, g1, g2, bonds1, bonds2, atomMatcher, bondMatcher); }