From 099d36b7df234e007932d57bb12fc270076628da Mon Sep 17 00:00:00 2001 From: Tobias Glaubach Date: Tue, 17 Jul 2018 09:08:25 +0200 Subject: [PATCH] added root finding for polynomials of all degrees --- src/Numerics/FindRoots.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Numerics/FindRoots.cs b/src/Numerics/FindRoots.cs index 3e8af9a7..d8dc8963 100644 --- a/src/Numerics/FindRoots.cs +++ b/src/Numerics/FindRoots.cs @@ -110,6 +110,15 @@ namespace MathNet.Numerics { return RootFinding.Cubic.Roots(d, c, b, a); } + /// + /// Find all roots of a polynomial by calculating the characteristic polynomial of the companion matrix + /// + /// the values for the polynomial in ascending order e.G new double[] {5, 0, 2} = "5 + 0 x^1 + 2 x^2" + /// the roots of the polynomial + public static Complex[] Polynomial(double[] poly) + { + return new Polynomial(poly).GetRoots(); + } /// /// Find all roots of the Chebychev polynomial of the first kind.