コード例 #1
0
        public static CompositeDictionary <IPermutation, int> GetOrbit(
            this IPermutation perm, uint maxSize = 1000)
        {
            var pd   = PermutationEx.PermutationDictionary(perm.Order);
            var cume = perm;

            for (var i = 0; i < maxSize; i++)
            {
                if (pd.ContainsKey(cume))
                {
                    return(pd);
                }

                pd.Add(cume, 1);
                cume = cume.Multiply(perm);
            }

            return(pd);
        }
コード例 #2
0
        public static CompositeDictionary <IPermutation, int> GetConjOrbit(
            this IPermutation perm, IPermutation conj, uint maxSize = 1000)
        {
            var pd      = PermutationEx.PermutationDictionary(perm.Order);
            var curConj = conj;
            var curRes  = perm;

            for (var i = 0; i < maxSize; i++)
            {
                if (pd.ContainsKey(curRes))
                {
                    return(pd);
                }
                pd.Add(curRes, 1);

                curRes  = perm.ConjugateBy(curConj);
                curConj = curConj.Multiply(conj);
            }

            return(pd);
        }