Пример #1
0
        public static ParyX[] Intervals(ExpansionBase expBase, int k)
        {
            ParyXBuilder xBuilder = new ParyXBuilder(expBase, 13);
            int          N        = expBase.Mk(k + 1);

            ParyX[] xs = new ParyX[N];
            decimal dN = new decimal(N);

            int[] exp     = new int[k + 1];
            int   current = k;

            xs[0] = xBuilder.Build(exp, new decimal(0) / dN);
            for (int j = 1; j < N; j++)
            {
                exp[current]++;
                while (exp[current] == expBase.Pk(current))
                {
                    exp[current--] = 0;
                    exp[current]++;
                }
                current = k;
                xs[j]   = xBuilder.Build(exp, new decimal(j) / dN);
            }
            return(xs);
        }
Пример #2
0
        public RademaxerMatrix(ExpansionBase expansionBase, ParyX[] xs, int K, Complex N)
        {
            matrix = MatrixUtils <Complex[, ]> .BuildRadamacher(expansionBase, xs, K);

            conjugatedMatrix = MatrixUtils <Complex[, ]> .Conjugate(matrix);

            MatrixUtils <Complex> .Multiply(conjugatedMatrix, N);
        }
Пример #3
0
        public VilenkinFunction(ExpansionBase expBase, ParyN n)
        {
            cache = new Dictionary <ParyX, Complex>();
            Rj    = new List <RademacherFunction>();
            List <int> notZeroIndexes = n.GetNotZeroCoeffs();

            foreach (int j in notZeroIndexes)
            {
                Rj.Add(new RademacherFunction(expBase, j));
            }
            ExpBase = expBase;
            this.n  = n;
        }
Пример #4
0
        public ParyN(ExpansionBase expansionBase, int n)
        {
            expansion = new List <int>(expansionBase.GetK());
            ArrayUtils.Fill(expansion, 0, expansionBase.GetK());
            int i = 0;
            int r;
            int k = n;

            while (k != 0)
            {
                r = k % expansionBase.Pk(i);
                k = k / expansionBase.Pk(i);
                expansion.RemoveAt(i);
                expansion.Insert(i, r);
                i++;
            }
        }
Пример #5
0
        private void ChangeSetupPage(FrameworkElement in_new_page, ExpansionBase in_main_class)
        {
            FrameworkElement old_page;

            // get old page
            if (gSetupFormContainer.Content != null)
            {
                old_page = (FrameworkElement)gSetupFormContainer.Content;
            }
            else
            {
                old_page = null;
            }

            // do nothing if the same page is selected
            if (old_page != null && in_new_page != null && old_page.GetType() == in_new_page.GetType())
            {
                return;
            }

            gSetupFormContainer.Content = null;

            // event arg
            SetupPageBase.SetupPageEventArgs event_args = new SetupPageBase.SetupPageEventArgs();
            event_args.NewPage   = in_new_page;
            event_args.OldPage   = old_page;
            event_args.MainClass = in_main_class;

            // call changed event handler of the old page
            if (old_page is SetupPageBase)
            {
                ((SetupPageBase)old_page).OnSetupPageDeactivating(this, event_args);
            }

            // add new page to the container
            if (in_new_page != null)
            {
                gSetupFormContainer.Content = in_new_page;

                if (in_new_page is SetupPageBase)
                {
                    ((SetupPageBase)in_new_page).OnSetupPageActivating(this, event_args);
                }
            }
        }
Пример #6
0
 public ParyXBuilder(ExpansionBase expansionBase, int roundDecimals)
 {
     this.expansionBase = expansionBase;
     this.roundDecimals = roundDecimals;
 }
Пример #7
0
 public RademacherFunction(ExpansionBase expBase, int k)
 {
     this.k = k;
     Pk     = expBase.Pk(k);
     values = new Dictionary <int, Dictionary <int, Complex> >();
 }