Пример #1
0
 void Main()
 {
     IAtomContainer someMolecule = null;
     {
         #region 1
         IAtomContainer ac = someMolecule; // get an atom container somehow
         BondDiscretePartitionRefiner refiner = new BondDiscretePartitionRefiner();
         PermutationGroup             autG    = refiner.GetAutomorphismGroup(ac);
         foreach (var automorphism in autG.GenerateAll())
         {
             // do something with the permutation
         }
         #endregion
     }
     {
         #region 2
         IAtomContainer ac = someMolecule; // get an atom container somehow
         BondDiscretePartitionRefiner refiner = new BondDiscretePartitionRefiner();
         if (refiner.IsCanonical(ac))
         {
             // do something with the atom container
         }
         #endregion
     }
     {
         IAtomContainer ac = someMolecule;
         #region 3
         BondDiscretePartitionRefiner refiner = new BondDiscretePartitionRefiner();
         refiner.Refine(ac);
         bool             isCanon = refiner.IsCanonical();
         PermutationGroup autG    = refiner.GetAutomorphismGroup();
         #endregion
     }
 }
Пример #2
0
        public void IsCanonical_FalseTest()
        {
            string         acpString             = "C0C1C2O3 0:1(2),0:3(1),1:2(1),2:3(1)";
            IAtomContainer ac                    = AtomContainerPrinter.FromString(acpString, builder);
            BondDiscretePartitionRefiner refiner = new BondDiscretePartitionRefiner();

            Assert.IsFalse(refiner.IsCanonical(ac));
        }