コード例 #1
0
 public static SquareMatrix Invert(SquareMatrix q, bool write)
 {
     return(new GaussMod()
     {
         invert = true
     }
            .Start(q, SquareMatrix.Id(q.Rows), write));
 }
コード例 #2
0
        static void DegenerateInit()
        {
            if (!degenerate)
            {
                degenerate = true;
                DegenerateGreeting();
                Table.Init();
                SetCell(f0, ff);
                SetLength(f0, Printer.f);
            }
            else
            {
                Reset();
            }

            var    H = SquareMatrix.Id(n);
            var    B = new Vector(n);
            double d = h / m;

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    for (int l = 0; l < m * m; l++)
                    {
                        H[i, j] -= d * Beta(i, a + (0.5 + l) * d)
                                   * Alpha(j, a + (0.5 + l) * d);
                    }
                }

                for (int l = 0; l < m * m; l++)
                {
                    B[i] += d * Beta(i, a + (0.5 + l) * d)
                            * F(a + (0.5 + l) * d);
                }
            }

            A = GaussMod.Do(H, B, false).X;
        }