Ejemplo n.º 1
0
 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()];
 }
Ejemplo n.º 2
0
 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);
 }