private double PartialSum1(int n, double x) { var s = coeff1(0); for (int j = 1; j <= n; j++) { s += coeff1(j) * MixHaar.MixedHaar(1, j + 1)(x); } return(s); }
private double PartialSum2(int n, double x) { var s = coeff2(0) + coeff2(1) * x; for (int j = 2; j <= n; j++) { s += coeff2(j) * MixHaar.MixedHaar(2, j + 1)(x); } return(s); }
public static void TestingForward() { double[] d = new double[m]; d = SobolevHaarLinearCombination.Decomposition(F, m); double[] x = new double[n]; double[] f = new double[n]; double[] s = new double[n]; for (int i = 0; i < n; i++) { x[i] = i / (n - 1.0); f[i] = F(x[i]); for (int j = 0; j < m; j++) { s[i] += d[j] * MixHaar.Haar(j + 1)(x[i]); } Console.WriteLine("f({0}) = {1};\ts({0}) = {2};", x[i], f[i], s[i]); } }