예제 #1
0
        public void TestFind_Distinct()
        {
            IAtomContainer dummy = new Mock <IAtomContainer>().Object;

            int[][] g = new int[][] { new[] { 1, 5, 6 }, new[] { 0, 2 }, new[] { 1, 3 }, new[] { 2, 4, 7 }, new[] { 3, 5 }, new[] { 0, 4 }, new[] { 0 }, new[] { 3 } };
            // all values distinct
            long[] values = new long[] { 10, 11, 12, 13, 14, 15, 16, 17 };

            EquivalentSetFinder finder = new AllEquivalentCyclicSet();
            var set = finder.Find(values, dummy, g);

            Assert.AreEqual(0, set.Count);
        }
예제 #2
0
        public void TestFind_Distinct()
        {
            IAtomContainer dummy = new Mock <IAtomContainer>().Object;

            int[][] g = new int[][] { new[] { 1, 5, 6 }, new[] { 0, 2 }, new[] { 1, 3 }, new[] { 2, 4, 7 }, new[] { 3, 5 }, new[] { 0, 4 }, new[] { 0 }, new[] { 3 } };

            // mock the invariants
            long[] values = new long[] { 1, 2, 3, 4, 5, 6, 7, 8 };

            EquivalentSetFinder finder = new AllEquivalentCyclicSet();
            var set = finder.Find(values, dummy, g);

            Assert.AreEqual(0, set.Count);
        }
예제 #3
0
        public void TestFind()
        {
            IAtomContainer dummy = new Mock <IAtomContainer>().Object;

            int[][] g = new int[][] { new[] { 1, 5, 6 }, new[] { 0, 2 }, new[] { 1, 3 }, new[] { 2, 4, 7 }, new[] { 3, 5 }, new[] { 0, 4 }, new[] { 0 }, new[] { 3 } };

            // mock the invariants
            long[] values = new long[] { 1, 4, 3, 1, 3, 5, 7, 8 };

            EquivalentSetFinder finder = new AllEquivalentCyclicSet();
            var set = finder.Find(values, dummy, g);

            Assert.AreEqual(4, set.Count);
            // the first size vertex are all in a cycle
            Assert.IsTrue(set.Contains(0));
            Assert.IsTrue(set.Contains(2));
            Assert.IsTrue(set.Contains(3));
            Assert.IsTrue(set.Contains(4));
        }