示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="numRows">The number of rows of vertices.</param>
        /// <param name="firstVertex"></param>
        /// <returns></returns>
        public static Quiver <int> GetSquareQuiver(int numRows, int firstVertex = DefaultFirstVertex)
        {
            if (!SquareParameterIsValid(numRows))
            {
                throw new ArgumentOutOfRangeException(nameof(numRows));
            }

            if (numRows == 1)
            {
                return(new Quiver <int>(vertices: new int[] { firstVertex }, arrows: new Arrow <int> [0]));
            }

            // Sort of backwards to construct the entire QP only to return just the quiver
            // But this reduces duplicated logic
            var qp = UsefulQPs.GetSquareQP(numRows, firstVertex);

            return(qp.Quiver);
        }
        public SelfInjectiveQP <int> GetSelfInjectiveSquareQP(int numRows, int firstVertex = DefaultFirstVertex)
        {
            if (!SquareParameterIsValid(numRows))
            {
                throw new ArgumentOutOfRangeException(nameof(numRows));
            }

            var qp = UsefulQPs.GetSquareQP(numRows);

            int numVerticesInRow = numRows;
            int numVertices      = numRows * numVerticesInRow;

            // Rotation "twice" clockwise/counterclockwise to get the Nakayama permutation
            // This map happens to be just "x mapsto (n+1)-x" (labeling the vertices from 0 would be cleaner here I guess)
            var nakayamaPermutation = Enumerable.Range(1, numVertices).ToDictionary(x => x, x => numVertices + 1 - x);

            return(new SelfInjectiveQP <int>(qp, nakayamaPermutation));
        }