Exemplo n.º 1
0
        /// <summary>
        /// This test is checking all permutations of an atom container to see
        /// if the refiner gives the canonical labelling map (effectively).
        /// </summary>
        /// <param name="atomContainer"></param>
        public void CheckForCanonicalForm(IAtomContainer atomContainer)
        {
            AtomContainerAtomPermutor    permutor = new AtomContainerAtomPermutor(atomContainer);
            AtomDiscretePartitionRefiner refiner  = new AtomDiscretePartitionRefiner();

            refiner.Refine(atomContainer);
            Permutation best = refiner.GetBest().Invert();
            string      cert = AtomContainerPrinter.ToString(atomContainer, best, true);

            while (permutor.MoveNext())
            {
                IAtomContainer permutedContainer = permutor.Current;
                refiner.Refine(permutedContainer);
                best = refiner.GetBest().Invert();
                string permCert = AtomContainerPrinter.ToString(permutedContainer, best, true);
                Assert.AreEqual(cert, permCert);
            }
        }
Exemplo n.º 2
0
 public static string ToString(IAtomContainer atomContainer)
 {
     return(AtomContainerPrinter.ToString(atomContainer, new Permutation(atomContainer.Atoms.Count)));
 }
Exemplo n.º 3
0
 public static void Print(IAtomContainer atomContainer)
 {
     Console.Out.WriteLine(AtomContainerPrinter.ToString(atomContainer));
 }