solvePoly function

(double, Mat) solvePoly(
  1. InputArray coeffs, {
  2. OutputArray? roots,
  3. int maxIters = 300,
})

SolvePoly finds the real or complex roots of a polynomial equation.

For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gac2f5e953016fabcdf793d762f4ec5dce

Implementation

(double rval, Mat roots) solvePoly(
  InputArray coeffs, {
  OutputArray? roots,
  int maxIters = 300,
}) {
  roots ??= Mat.empty();
  final rval = cvRunArena<double>((arena) {
    final p = arena<ffi.Double>();
    cvRun(() => ccore.Mat_SolvePoly(coeffs.ref, roots!.ref, maxIters, p));
    return p.value;
  });
  return (rval, roots);
}