public void BenzeneIdentical() { int[] match = VentoFoggia.FindIdentical(TestMoleculeFactory.MakeBenzene()).Match(TestMoleculeFactory.MakeBenzene()); Assert.IsTrue(Compares.AreDeepEqual(new int[] { 0, 1, 2, 3, 4, 5 }, match)); int count = VentoFoggia.FindIdentical(TestMoleculeFactory.MakeBenzene()).MatchAll(TestMoleculeFactory.MakeBenzene()).ToReadOnlyList().Count; Assert.AreEqual(6, count); // note: aromatic one would be 12 }
public void BenzeneNonIdentical() { int[] match = VentoFoggia.FindIdentical(TestMoleculeFactory.MakeBenzene()).Match(TestMoleculeFactory.MakeNaphthalene()); Assert.IsTrue(Compares.AreDeepEqual(Array.Empty <int>(), match)); int count = VentoFoggia.FindIdentical(TestMoleculeFactory.MakeBenzene()).MatchAll(TestMoleculeFactory.MakeNaphthalene()).ToReadOnlyList().Count; Assert.AreEqual(0, count); }
/// <summary> /// Create a pattern which can be used to find molecules which are the same /// as the <paramref name="query"/> structure. The default structure search /// implementation is <see cref="VentoFoggia"/>. /// </summary> /// <param name="query">the substructure to find</param> /// <returns>a pattern for finding the <paramref name="query"/></returns> /// <seealso cref="VentoFoggia"/> public static Pattern FindIdentical(IAtomContainer query) { return(VentoFoggia.FindIdentical(query)); }