public void Execute_ResultsInSelfInjectiveQP_WhenShouldBeCobMinus5()
        {
            var gen          = new RecipeExecutor();
            var instructions = new IPotentialRecipeInstruction[]
            {
                new AtomicGlueInstruction(0, 1, 4),
                new AtomicGlueInstruction(3, 1, 4),
                new AtomicGlueInstruction(6, 1, 4),
                new AtomicGlueInstruction(9, 1, 4),
                new AtomicGlueInstruction(12, 1, 4),
                new AtomicGlueInstruction(2, 2, 3),
                new AtomicGlueInstruction(4, 2, 3),
                new AtomicGlueInstruction(6, 2, 3),
                new AtomicGlueInstruction(8, 2, 3),
                new AtomicGlueInstruction(10, 2, 3),
            };

            var recipe   = new PotentialRecipe(instructions);
            var qp       = gen.ExecuteRecipe(recipe, 5);
            var analyzer = new QPAnalyzer();
            var settings = GetSettings(detectNonCancellativity: true);
            var result   = analyzer.Analyze(qp, settings);

            Assert.That(result.MainResults.IndicatesSelfInjectivity());
        }
Exemplo n.º 2
0
        public void ComputeMaximalNonzeroEquivalenceClassRepresentativesStartingAt_UncertainTest1_NonAdmissibilityHandlingWorks()
        {
            if (!Computer.SupportsNonCancellativityDetection || !Computer.SupportsNonAdmissibilityHandling)
            {
                return;
            }

            var qpAnalysisSettings = GetQPAnalysisSettings(detectNonCancellativity: true, maxPathLength: 40);
            var qpAnalyzer         = new QPAnalyzer();

            foreach (var(qp, index) in GetQPsForTest1().EnumerateWithIndex())
            {
                var  results = qpAnalyzer.Analyze(qp, qpAnalysisSettings, Computer);
                bool nonAdmissibilityDefinitelyExpected = NonAdmissibleIndicesForTest1.Except(NonCancellativeIndicesForTest1).Contains(index);
                bool eitherOfNonAdmissibilityAndNonCancellativityExpected = NonAdmissibleIndicesForTest1.Intersect(NonCancellativeIndicesForTest1).Contains(index);

                if (nonAdmissibilityDefinitelyExpected)
                {
                    Assert.That(results.MainResults.HasFlag(QPAnalysisMainResults.Aborted));
                }
                else if (eitherOfNonAdmissibilityAndNonCancellativityExpected)
                {
                    Assert.That(results.MainResults.HasFlag(QPAnalysisMainResults.Aborted) || results.MainResults.HasFlag(QPAnalysisMainResults.NotCancellative));
                }
                else
                {
                    Assert.That(results.MainResults.HasFlag(QPAnalysisMainResults.Aborted), Is.False);
                }
            }
        }
Exemplo n.º 3
0
        private void AssertIsSelfInjective <TVertex>(QuiverWithPotential <TVertex> qp)
            where TVertex : IEquatable <TVertex>, IComparable <TVertex>
        {
            var analyzer = new QPAnalyzer();
            var result   = analyzer.Analyze(qp, new QPAnalysisSettings(CancellativityTypes.Cancellativity));

            Assert.That(result.MainResults.IndicatesSelfInjectivity());
        }
Exemplo n.º 4
0
        private void AssertIsSelfInjectiveWithCorrectNakayamaPermutation <TVertex>(SelfInjectiveQP <TVertex> selfInjectiveQP)
            where TVertex : IEquatable <TVertex>, IComparable <TVertex>
        {
            var analyzer = new QPAnalyzer();
            var settings = GetSettings(detectNonCancellativity: true);
            var result   = analyzer.Analyze(selfInjectiveQP.QP, settings);

            Assert.That(result.MainResults.IndicatesSelfInjectivity());
            Assert.That(selfInjectiveQP.NakayamaPermutation.Equals(result.NakayamaPermutation));
        }