예제 #1
0
        public void TestAtomPermutation2()
        {
            IAtomContainer  pamine = TestMoleculeFactory.MakeCyclopentane();
            Fingerprinter   fp     = new Fingerprinter();
            IBitFingerprint bs1    = fp.GetBitFingerprint(pamine);

            AtomContainerAtomPermutor acp = new AtomContainerAtomPermutor(pamine);

            while (acp.MoveNext())
            {
                IAtomContainer  container = acp.Current;
                IBitFingerprint bs2       = fp.GetBitFingerprint(container);
                Assert.IsTrue(bs1.Equals(bs2));
            }
        }
        public void TestAtomPermutation()
        {
            IAtomContainer            pamine = MakePropylAmine();
            ShortestPathFingerprinter fp     = new ShortestPathFingerprinter();
            IBitFingerprint           bs1    = fp.GetBitFingerprint(pamine);

            AtomContainerAtomPermutor acp = new AtomContainerAtomPermutor(pamine);

            while (acp.MoveNext())
            {
                IAtomContainer  container = acp.Current;
                IBitFingerprint bs2       = fp.GetBitFingerprint(container);
                Assert.IsTrue(bs1.Equals(bs2));
            }
        }
예제 #3
0
        public void TestEquals()
        {
            IBitFingerprint fp1 = (IBitFingerprint)C.GetConstructor(Type.EmptyTypes).Invoke(new object[] { });
            IBitFingerprint fp2 = (IBitFingerprint)C.GetConstructor(Type.EmptyTypes).Invoke(new object[] { });

            foreach (var fp in new IBitFingerprint[] { fp1, fp2 })
            {
                fp[0] = true;
                fp[1] = false;
                fp[2] = true;
            }
            Assert.IsTrue(fp1.Equals(fp2), "identical fingerprints should be equal");
            Assert.IsFalse(bitsetFP.Equals(fp1), "different fingerprints should not be equal");
            Assert.IsTrue(fp1.GetHashCode() == fp2.GetHashCode(), "equal fingerprints must have same hashcode");
        }
        public void TestAtomPermutation2()
        {
            IAtomContainer pamine = TestMoleculeFactory.MakeCyclopentane();

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(pamine);
            ShortestPathFingerprinter fp  = new ShortestPathFingerprinter();
            IBitFingerprint           bs1 = fp.GetBitFingerprint(pamine);

            AtomContainerAtomPermutor acp = new AtomContainerAtomPermutor(pamine);

            while (acp.MoveNext())
            {
                IAtomContainer  container = acp.Current;
                IBitFingerprint bs2       = fp.GetBitFingerprint(container);
                Assert.IsTrue(bs1.Equals(bs2));
            }
        }