Пример #1
0
        private void GetPivot(long[][] A, int di, out int pi, out int pj, out long pd, out int pr)
        {
            long d;
            int  r;

            pr = int.MaxValue;
            pd = 0;
            pi = -1;
            pj = -1;
            for (int j = di; j < var_n; j++)
            {
                for (int i = di; i < var_n; i++)
                {
                    if (A[i][j] > 0)
                    {
                        r = b.Reduction(A[i][j], out d);
                        if (r < pr)
                        {
                            pi = i;
                            pj = j;
                            pd = d;
                            pr = r;
                        }
                    }
                }
            }
        }
        private void AddEven(LeadVector tvr)
        {
            int  r;
            long d;

            r = b.Reduction(tvr.Lentry, out d);

            long x = 1L << (var_w - r);

            int l = tvr.Vr.Length;

            long[] wr = new long[l];
            for (int i = 0; i < l; i++)
            {
                wr[i] = (x * tvr.Vr[i]) % var_m;
            }

            LeadVector twr = new LeadVector(wr);

            if (twr.Lidx >= 0)
            {
                AddVector(twr);
            }
        }