Exemplo n.º 1
0
        public void PointedFlowers_AreSelfInjective_WithUnusualFirstVertex()
        {
            const int FirstVertex = -123;
            var       qps         = Utility.InfiniteRange(3, 2).Select(k => UsefulQPs.GetPointedFlowerQP(k, FirstVertex)).TakeWhile(qp => qp.Quiver.Vertices.Count <= 49);

            AssertAreSelfInjective(qps);
        }
        /// <summary>
        /// Prompts the user for a QP.
        /// </summary>
        /// <param name="qp">Output parameter for the QP.</param>
        /// <param name="periods">Output parameter for the periods of the QP.</param>
        /// <param name="fixedPoint">Output parameter for the fixed-point of the QP (or
        /// <see langword="null"/> if there is none).</param>
        /// <returns><see langword="true"/> if the user specified a QP;
        /// <see langword="false"/> otherwise.</returns>
        private bool TryGetQP(
            out QuiverWithPotential <int> qp,
            out IEnumerable <IEnumerable <int> > periods,
            out int?fixedPoint)
        {
            if (!TryGetQPType(out var qpType) || !TryGetNumPeriods(qpType, out int numPeriods))
            {
                qp         = null;
                periods    = null;
                fixedPoint = null;
                return(false);
            }

            switch (qpType)
            {
            case QPType.OddFlower:
                qp         = UsefulQPs.GetOddFlowerQP(numPeriods, DefaultFirstVertex);
                periods    = UsefulQPs.GetPeriodsOfOddFlowerQP(numPeriods, DefaultFirstVertex);
                fixedPoint = null;
                break;

            case QPType.EvenFlowerType1:
                qp         = UsefulQPs.GetEvenFlowerType1QP(numPeriods, DefaultFirstVertex);
                periods    = UsefulQPs.GetPeriodsOfEvenFlowerType1QP(numPeriods, DefaultFirstVertex);
                fixedPoint = null;
                break;

            case QPType.EvenFlowerType2:
                qp         = UsefulQPs.GetEvenFlowerType2QP(numPeriods, DefaultFirstVertex);
                periods    = UsefulQPs.GetPeriodsOfEvenFlowerType2QP(numPeriods, DefaultFirstVertex);
                fixedPoint = null;
                break;

            case QPType.PointedFlower:
                qp      = UsefulQPs.GetPointedFlowerQP(numPeriods, DefaultFirstVertex);
                periods = UsefulQPs.GetPeriodsOfPointedFlowerQPWithoutFixedPoint(numPeriods, DefaultFirstVertex);
                throw new NotImplementedException();
                break;

            default:
                Debug.Fail($"Invalid QP type ({qpType}) specified.");
                qp         = null;
                periods    = null;
                fixedPoint = null;
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        public void PointedFlowers_AreSelfInjective()
        {
            var qps = Utility.InfiniteRange(3, 2).Select(k => UsefulQPs.GetPointedFlowerQP(k)).TakeWhile(qp => qp.Quiver.Vertices.Count <= 50);

            AssertAreSelfInjective(qps);
        }