internal OneDimDiffFunction(IDiffFunction function, double[] initial, double[] direction) { this.function = function; this.initial = CopyArray(initial); this.direction = CopyArray(direction); this.tempVector = new double[function.DomainDimension()]; }
public static void GradientCheck(IDiffFunction f, double eps) { double[] x = new double[f.DomainDimension()]; for (int i = 0; i < x.Length; i++) { x[i] = Math.Random() - 0.5; } // 0.03; (i - 0.5) * 4; GradientCheck(f, x, eps); }