private Func <double, double> SumOfAbs(int n) { double SumOfn(double x) { var s = 0d; for (int k = 2; k <= n; k++) { s += Math.Abs(WalshSobolev.Get2(k)(x)); } return(s); } return(SumOfn); }
private Func <double, double> PartialSum(Func <double, double> f, int n) { var coeffs = new List <double> { f(0) }; coeffs.AddRange(Range(1, n).Select(j => coeff(f, j))); //var coeffs = Range(1, n - 1).Select(j => coeffByDef(j)).ToArray(); double partSum(double x) { var s = 0d; for (int j = 0; j <= n; j++) { s += coeffs[j] * WalshSobolev.Get2(j)(x); } return(s); } return(partSum); }