Пример #1
0
        public static QuiverWithPotential <int> GetCycleQP(int numVertices, int firstVertex = DefaultFirstVertex)
        {
            if (!CycleParameterIsValid(numVertices))
            {
                throw new ArgumentOutOfRangeException(nameof(numVertices));
            }

            int n     = numVertices;
            var cycle = new DetachedCycle <int>(Enumerable.Range(firstVertex, n).Select(k => new Arrow <int>(k, (k + 1 - firstVertex).Modulo(n) + firstVertex)));
            var qp    = new QuiverWithPotential <int>(new Potential <int>(cycle, +1));

            return(qp);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="Potential{TVertex}"/> class to contain a
 /// single cycle.
 /// </summary>
 /// <param name="cycle">The cycle.</param>
 /// <param name="coefficient">The coefficient of the cycle.</param>
 public Potential(DetachedCycle <TVertex> cycle, int coefficient)
 {
     LinearCombinationOfCycles = new LinearCombination <DetachedCycle <TVertex> >(coefficient, cycle);
 }