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); }
public Complex Value(ParyX x) { Complex value = new Complex(0, 0); for (int i = 0; i < coeffs.Count; i++) { value += coeffs.ElementAt(i) * vilenkinFunctions[i].Value(x); } return(value); }
public Complex Value(ParyX x) { Complex value = new Complex(1, 0); for (int j = 0; j < Rj.Count; j++) { value *= (Rj[j].Value(x, n.Ak(Rj[j].GetK()))); } return(value); }
public Complex Value(ParyX x, int pow) { int Xk = x.ElementAt(k); Dictionary <int, Complex> pows; if (values.ContainsKey(Xk)) { pows = values[Xk]; if (values[Xk].ContainsKey(pow)) { return(values[Xk][pow]); } } else { pows = new Dictionary <int, Complex>(); values.Add(Xk, pows); } double phi = 2 * Math.PI * Xk * pow / Pk; Complex value = new Complex(Math.Cos(phi), Math.Sin(phi)); pows.Add(pow, value); return(value); }
public Complex Value(ParyX x) { return(Value(x, 1)); }