Newton constructor

const Newton({
  1. required String function,
  2. required double x0,
  3. double tolerance = 1.0e-10,
  4. int maxSteps = 10,
})

Instantiates a new object to find the root of an equation by using the Newton method.

  • function: the function f(x)
  • x0: the initial guess x0
  • tolerance: how accurate the algorithm has to be
  • maxSteps: how many iterations at most the algorithm has to do

Implementation

const Newton({
  required String function,
  required this.x0,
  double tolerance = 1.0e-10,
  int maxSteps = 10,
}) : super(
        function: function,
        tolerance: tolerance,
        maxSteps: maxSteps,
      );