initialGuess property

List<Complex> initialGuess
final

The initial guess from which the algorithm has to start finding the roots.

By default, this is an empty list because this class can provide some pre-built values that are good in most of the cases (but not always).

You can provide specific initial guesses with this param.

The length of the initialGuess must equals the coefficients length minus one. For example, this is ok...

final durandKerner = DurandKerner(
  coefficients: [
    Complex.fromReal(-5),
    Complex.fromReal(3),
    Complex.i(),
  ],
  initialGuess: [
    Complex(1, -2),
    Complex.fromReal(3),
  ],
);

... but this is not ok:

final durandKerner = DurandKerner(
  coefficients: [
    Complex.fromReal(-5),
    Complex.fromReal(3),
    Complex.i(),
  ],
  initialGuess: [
    Complex(1, -2),
  ],
);

Implementation

final List<Complex> initialGuess;