示例#1
0
 /// <summary>
 /// Стандартный конструктор
 /// </summary>
 /// <param name="function">функция для исследования</param>
 /// <param name="start">начальный вектор</param>
 /// <param name="precision">точность поиска</param>
 /// <param name="operationsAmount">максимальное количество итераций</param>
 public MultivariateNewtonOptimizer(
     Func <Vector, double> function,
     double[] start,
     double precision     = 1E-08,
     int operationsAmount = 8
     )
 {
     _function         = function;
     _derivative       = new Derivative(function);
     _start            = new Vector(start);
     _precision        = precision;
     _operationsAmount = operationsAmount;
     ResetCounter();
 }
示例#2
0
 /// <summary>
 /// Стандартный конструктор
 /// </summary>
 /// <param name="function">функция для исследования</param>
 /// <param name="start">начальный вектор</param>
 /// <param name="precision">точность поиска</param>
 /// <param name="operationsAmount">максимальное количество итераций</param>
 /// <param name="verbose">писать ли в консоль о каждом шаге</param>
 public NewtonOptimizer(
     Func <double, double> function,
     double start         = 0,
     double precision     = 1E-08,
     int operationsAmount = 15,
     bool verbose         = false
     )
 {
     _function         = function;
     _derivative       = new Derivative(function);
     _start            = start;
     _precision        = precision;
     _operationsAmount = operationsAmount;
     _logger           = new Logger(verbose);
     ResetCounter();
 }