Exemple #1
0
        public void ComputeMaximalNonzeroEquivalenceClassRepresentativesStartingAt_TetraforceCenter()
        {
            var settings = GetSettings(detectNonCancellativity: false);
            var qp       = UsefulQPs.GetSquareQP(3);

            DoSetup(qp, out var ruleTree);

            var representativePaths = Computer.ComputeMaximalNonzeroEquivalenceClassRepresentativesStartingAt(qp.Quiver, 5, ruleTree, settings).MaximalNonzeroEquivalenceClassRepresentatives.ToList();
            var expectedMaximalEquivalenceClasses = new ISet <Path <int> >[]
            {
                new HashSet <Path <int> >
                {
                    new Path <int>(5, new Arrow <int>[] { new Arrow <int>(5, 4), new Arrow <int>(4, 1), new Arrow <int>(1, 2), new Arrow <int>(2, 5) }),
                    new Path <int>(5, new Arrow <int>[] { new Arrow <int>(5, 6), new Arrow <int>(6, 3), new Arrow <int>(3, 2), new Arrow <int>(2, 5) }),
                    new Path <int>(5, new Arrow <int>[] { new Arrow <int>(5, 4), new Arrow <int>(4, 7), new Arrow <int>(7, 8), new Arrow <int>(8, 5) }),
                    new Path <int>(5, new Arrow <int>[] { new Arrow <int>(5, 6), new Arrow <int>(6, 9), new Arrow <int>(9, 8), new Arrow <int>(8, 5) }),
                },
            };

            Assert.That(representativePaths, Has.Count.EqualTo(expectedMaximalEquivalenceClasses.Length));
            foreach (var representative in representativePaths)
            {
                Assert.That(expectedMaximalEquivalenceClasses, Has.One.Contains(representative));
            }
        }
Exemple #2
0
        public void Squares_AreSelfInjective_WithUnusualFirstVertex()
        {
            const int FirstVertex = -123;
            var       qps         = Utility.InfiniteRange(1).Select(k => UsefulQPs.GetSquareQP(k, FirstVertex)).TakeWhile(qp => qp.Quiver.Vertices.Count < 30);

            AssertAreSelfInjective(qps);
        }
Exemple #3
0
        public void ComputeMaximalNonzeroEquivalenceClassRepresentativesStartingAt_TetraforceCorner()
        {
            var settings = GetSettings(detectNonCancellativity: false);
            var qp       = UsefulQPs.GetSquareQP(3);

            DoSetup(qp, out var ruleTree);

            var representativePaths    = Computer.ComputeMaximalNonzeroEquivalenceClassRepresentativesStartingAt(qp.Quiver, 1, ruleTree, settings).MaximalNonzeroEquivalenceClassRepresentatives.ToList();
            var expectedRepresentative = new Path <int>(1, new Arrow <int>[] { new Arrow <int>(1, 2), new Arrow <int>(2, 5), new Arrow <int>(5, 6), new Arrow <int>(6, 9) });

            Assert.That(representativePaths, Has.Count.EqualTo(1));
            Assert.That(representativePaths.Single(), Is.EqualTo(expectedRepresentative));
        }
Exemple #4
0
        public void Squares_AreSelfInjective()
        {
            var qps = Utility.InfiniteRange(1).Select(k => UsefulQPs.GetSquareQP(k)).TakeWhile(qp => qp.Quiver.Vertices.Count < 30);

            AssertAreSelfInjective(qps);
        }