Laguerre.realEquation constructor

Laguerre.realEquation({
  1. required List<double> coefficients,
  2. Complex initialGuess = const Complex.zero(),
  3. double precision = 1.0e-10,
  4. int maxSteps = 8000,
})

Instantiates a new object to find all the roots of a polynomial equation using Laguerre's method. The polynomial can have both complex (Complex) and real (double) values.

  • coefficients: the coefficients of the polynomial;
  • initialGuess: the initial guess from which the algorithm has to start finding the roots;
  • precision: the accuracy of the algorithm;
  • maxSteps: the maximum steps to be made by the algorithm.

Note that the coefficient with the highest degree goes first. For example, the coefficients of the -5x^2 + 3x + 1 = 0 has to be inserted in the following way:

final laguerre = Laguerre(
  coefficients [-5, 3, 1],
);

Since -5 is the coefficient with the highest degree (2), it goes first. If the coefficients of your polynomial contain complex numbers, consider using the Laguerre() constructor instead.

Implementation

Laguerre.realEquation({
  required List<double> coefficients,
  this.initialGuess = const Complex.zero(),
  this.precision = 1.0e-10,
  this.maxSteps = 8000,
}) : super.realEquation(coefficients);