Ejemplo n.º 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);
        }
Ejemplo n.º 2
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++;
            }
        }
Ejemplo n.º 3
0
        public ParyX Build(decimal x)
        {
            List <int> expansion = new List <int>(expansionBase.GetK());

            ArrayUtils.Fill(expansion, 0, expansionBase.GetK());
            int     i = 0;
            decimal k = x;
            int     r;

            while (k != 0 && i < expansionBase.GetK())
            {
                k = Math.Round(k * expansionBase.Pk(i), roundDecimals);
                r = (int)k / 1;
                k = k % 1;
                expansion.RemoveAt(i);
                expansion.Insert(i, r);
                i++;
            }
            return(new ParyX(expansion, x));
        }
Ejemplo n.º 4
0
 public RademacherFunction(ExpansionBase expBase, int k)
 {
     this.k = k;
     Pk     = expBase.Pk(k);
     values = new Dictionary <int, Dictionary <int, Complex> >();
 }