Esempio n. 1
0
 private FSnCollection IfVerticalStabilizer()
 {
     if (this.IsVertical() == true)
     {
         FSnCollection      result = new FSnCollection();
         int                a      = DiagElemCol[0];
         List <Permutation> cs     = Common.GeneratePermutations(this.Number);
         for (int j = 0; j < cs.Count; j++)
         {
             FSnElement aa = new FSnElement();
             aa.SnElement = cs[j];
             if (cs[j].IsEven() == true)
             {
                 aa.FElement = 1;
             }
             else
             {
                 aa.FElement = -1;
             }
             result.Add(aa);
         }
         return(result);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 2
0
        private static void FromFSnCollectionToTXTFile(FSnCollection Collection, Basis bhigh)
        {
            Array right = Array.CreateInstance(typeof(int), Factorial(bhigh.Number));

            for (int i = 0; i < Collection.Count; i++)
            {
                for (int i4 = 0; i4 < bhigh.order.Count; i4++)
                {
                    if (Collection[i].SnElement == bhigh.order[i4])
                    {
                        right.SetValue((int)Collection[i].FElement, i4);
                        break;
                    }
                }
            }

            FileInfo     f      = new FileInfo("right.txt");
            StreamWriter writer = f.CreateText();

            writer.WriteLine(bhigh.Number.ToString() + ",bas" + bhigh.Number.ToString() + ".txt");
            for (int i = 0; i < Factorial(bhigh.Number); i++)
            {
                writer.Write("{0}.,", (int)right.GetValue(i));
            }
            writer.Close();
        }
Esempio n. 3
0
        private static List <BasElem> TranslateEdTauToBasElems(STTableau tab, Basis bhigh)
        {
            FSnCollection Sym = tab.YoungSymmetrizer();

            foreach (FSnElement fse in Sym)
            {
                fse.SnElement = fse.SnElement * tab.Numeration.RevPerm();
                fse.SnElement.Add(bhigh.Number);
            }
            FromFSnCollectionToTXTFile(Sym, bhigh);
            UmfpackSolve();
            return(FromTXTFileToBasElems(bhigh));
        }
Esempio n. 4
0
        public static FSnCollection operator *(FSnCollection a, Permutation b)
        {
            FSnCollection result = new FSnCollection();

            for (int i = 0; i < a.Count; i++)
            {
                FSnElement el = new FSnElement();
                el.FElement  = a[i].FElement;
                el.SnElement = (Permutation)(a[i].SnElement * b);
                result.Add(el);
            }
            return(result);
        }
Esempio n. 5
0
 private FSnCollection IfHorizontalStabilizer()
 {
     if (this.IsHorizontal() == true)
     {
         FSnCollection      result = new FSnCollection();
         int                a      = (int)diagElemRow[0];
         List <Permutation> rs     = Common.GeneratePermutations(this.Number);
         for (int j = 0; j < rs.Count; j++)
         {
             FSnElement aa = new FSnElement();
             aa.SnElement = (Permutation)rs[j];
             aa.FElement  = 1;
             result.Add(aa);
         }
         return(result);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 6
0
        internal FSnCollection YoungSymmetrizer()
        {
            Array         source = this.ToMatrix();
            FSnCollection result = new FSnCollection();

            if (this.IsVertical() == true)
            {
                result = IfVerticalStabilizer();
                return(result);
            }
            if (this.IsHorizontal() == true)
            {
                result = IfHorizontalStabilizer();
                return(result);
            }
            List <Permutation> rs = this.RowStabilizer(source);
            List <Permutation> cs = this.ColStabilizer(source);

            for (int i = 0; i < cs.Count; i++)
            {
                int sign = 0;
                if (cs[i].IsEven() == true)
                {
                    sign = 1;
                }
                else
                {
                    sign = -1;
                }
                for (int j = 0; j < rs.Count; j++)
                {
                    FSnElement a = new FSnElement();
                    a.SnElement = (Permutation)(rs[j] * cs[i]);
                    a.FElement  = sign;
                    result.Add(a);
                }
            }
            return(result);
        }
Esempio n. 7
0
        //сохранение матрицы базиса в текстовый файл для UMFPACK
        internal void CreateForUMF()
        {
            //Заполнение массивов для проекта UmfSolver
            Ap = new List <int>();
            Ai = new List <int>();
            Ax = new List <int>();

            //отдельно для первой группы - вертикаль
            Ap.Add(numberToAp);
            for (int k = 0; k < this.order.Count; k++)
            {
                bool sign = order[k].IsEven();
                Ax.Add((sign == false) ? -1 : 1);
                Ai.Add(k);
                numberToAp++;
            }

            int columnmatr = 1;

            for (int ii = 1; ii < this.SaveTabGroups.Count - 1; ii++)//для каждой группы
            {
                Permutation perm = new Permutation(this.number);
                for (int i = 0; i < this.number; i++)
                {
                    perm.Add(i + 1);
                }
                FSnCollection YSym = (new STTableau(perm, this.SaveTabGroups[ii].TabGroupPartition)).YoungSymmetrizer();
                //вычислен симметризатор тривиальной таблицы

                for (int gk = 0; gk < SaveTabGroups[ii].TabGroupNumerations.Count; gk++)
                {
                    for (int gg = 0; gg < SaveTabGroups[ii].TabGroupNumerations.Count; gg++)
                    {
                        Ap.Add(numberToAp);
                        Array st = Array.CreateInstance(typeof(int), Common.Factorial(this.number));
                        for (int ghH = 0; ghH < YSym.Count; ghH++)
                        {
                            //выбираем произвольно две стандартные таблицы, записанные подстановками, и перемножаем si*ed*(ta-1)
                            Permutation tt = this.SaveTabGroups[ii].TabGroupNumerations[gk] * YSym[ghH].SnElement *
                                             this.SaveTabGroups[ii].TabGroupNumerations[gg].RevPerm();
                            //поиск подстановки в ордере и занеение в большую матрицу
                            Common.Factorial(this.number);
                            for (int i4 = 0; i4 < this.order.Count; i4++)
                            {
                                if (tt == this.order[i4])
                                {
                                    st.SetValue(YSym[ghH].FElement, i4);
                                    numberToAp++;
                                    break;
                                }
                            }
                        }
                        for (int i = 0; i < st.Length; i++)
                        {
                            if ((int)st.GetValue(i) != 0)
                            {
                                Ax.Add((int)st.GetValue(i));
                                Ai.Add(i);
                            }
                        }
                    }
                }
            }
            //отдельно для последней группы - горизонталь
            Ap.Add(numberToAp);
            for (int i = 0; i < Common.Factorial(this.number); i++)
            {
                Ax.Add(1);
                Ai.Add(i);
                numberToAp++;
            }
            Ap.Add(numberToAp);
            FileInfo     f      = new FileInfo("bas" + this.number.ToString() + ".txt");
            StreamWriter writer = f.CreateText();

            writer.WriteLine("{0},{1},{2}", Ap.Count, Ai.Count, Ax.Count);
            for (int i = 0; i < Ap.Count; i++)
            {
                writer.Write("{0},", Ap[i]);
            }
            writer.WriteLine();
            for (int i = 0; i < Ai.Count; i++)
            {
                writer.Write("{0},", Ai[i]);
            }
            writer.WriteLine();
            for (int i = 0; i < Ax.Count; i++)
            {
                writer.Write("{0}.,", Ax[i]);
            }
            writer.WriteLine();
            writer.Close();
        }