public void splayn(double[] x, double[] y) { functions = new SplaynFunc[x.Length]; for (int i = 0; i < x.Length; ++i) { functions[i] = new SplaynFunc(); functions[i].x = x[i]; functions[i].a = y[i]; } functions[0].c = 0.0; functions[x.Length - 1].c = 0.0; progonka(x, y); for (int i = x.Length - 1; i > 0; --i) { double o = x[i] - x[i - 1]; functions[i].d = (functions[i].c - functions[i - 1].c)/o; functions[i].b = o*(2.0*functions[i].c + functions[i - 1].c) /6.0 + (y[i] - y[i - 1])/o; } }
public void splayn(double[] x, double[] y) { functions = new SplaynFunc[x.Length]; for (int i = 0; i < x.Length; ++i) { functions[i] = new SplaynFunc(); functions[i].x = x[i]; functions[i].a = y[i]; } functions[0].c = 0.0; functions[x.Length - 1].c = 0.0; progonka(x, y); for (int i = x.Length - 1; i > 0; --i) { double o = x[i] - x[i - 1]; functions[i].d = (functions[i].c - functions[i - 1].c) / o; functions[i].b = o * (2.0 * functions[i].c + functions[i - 1].c) / 6.0 + (y[i] - y[i - 1]) / o; } }