public void TestICountFingerprintComparison()
        {
            var mol1          = TestMoleculeFactory.MakeIndole();
            var mol2          = TestMoleculeFactory.MakeIndole();
            var fingerprinter = new SignatureFingerprinter();
            var fp1           = fingerprinter.GetCountFingerprint(mol1);
            var fp2           = fingerprinter.GetCountFingerprint(mol2);
            var tanimoto      = Tanimoto.Calculate(fp1, fp2);

            Assert.AreEqual(1.0, tanimoto, 0.001);
        }
        public void CompareCountFingerprintAndRawFingerprintTanimoto()
        {
            var mol1          = TestMoleculeFactory.Make123Triazole();
            var mol2          = TestMoleculeFactory.MakeImidazole();
            var fingerprinter = new SignatureFingerprinter(1);
            var countFp1      = fingerprinter.GetCountFingerprint(mol1);
            var countFp2      = fingerprinter.GetCountFingerprint(mol2);
            var feat1         = fingerprinter.GetRawFingerprint(mol1);
            var feat2         = fingerprinter.GetRawFingerprint(mol2);
            var rawTanimoto   = Tanimoto.Calculate(feat1, feat2);
            var countTanimoto = Tanimoto.Method1(countFp1, countFp2);

            Assert.AreEqual(rawTanimoto, countTanimoto, 0.001);
        }
        public void TestCompaRingBitFingerprintAndCountBehavingAsBit()
        {
            var mol1 = TestMoleculeFactory.Make123Triazole();
            var mol2 = TestMoleculeFactory.MakeImidazole();

            var fingerprinter          = new SignatureFingerprinter(1);
            ICountFingerprint countFp1 = fingerprinter.GetCountFingerprint(mol1);
            ICountFingerprint countFp2 = fingerprinter.GetCountFingerprint(mol2);

            countFp1.SetBehaveAsBitFingerprint(true);
            countFp2.SetBehaveAsBitFingerprint(true);
            var bitFp1         = fingerprinter.GetBitFingerprint(mol1);
            var bitFp2         = fingerprinter.GetBitFingerprint(mol2);
            var bitTanimoto    = Tanimoto.Calculate(bitFp1, bitFp2);
            var countTanimoto1 = Tanimoto.Method1(countFp1, countFp2);
            var countTanimoto2 = Tanimoto.Method2(countFp1, countFp2);

            Assert.AreEqual(countTanimoto1, countTanimoto2, 0.001);
            Assert.AreEqual(bitTanimoto, countTanimoto1, 0.001);
        }
        public void TestCountMethod1and2()
        {
            ICountFingerprint fp1 = new IntArrayCountFingerprint(new Dictionary <string, int>()
            {
                { "A", 3 }
            });
            ICountFingerprint fp2 = new IntArrayCountFingerprint(new Dictionary <string, int>()
            {
                { "A", 4 }
            });

            Assert.AreEqual(0.923, Tanimoto.Method1(fp1, fp2), 0.001);
            Assert.AreEqual(0.75, Tanimoto.Method2(fp1, fp2), 0.001);

            var mol1          = TestMoleculeFactory.MakeIndole();
            var mol2          = TestMoleculeFactory.MakeIndole();
            var fingerprinter = new SignatureFingerprinter();

            fp1 = fingerprinter.GetCountFingerprint(mol1);
            fp2 = fingerprinter.GetCountFingerprint(mol2);
            Assert.AreEqual(1.0, Tanimoto.Method1(fp1, fp2), 0.001);
            Assert.AreEqual(1.0, Tanimoto.Method2(fp1, fp2), 0.001);
        }