[math] Solving quadratic, cubic & quartic functions
I've run into an eigenvalue problem where I need to compute the roots of a cubic polynomial. This is a straight-forward problem to solve analytically, but I want to avoid reinventing the wheel if possible. The boost::math doc mentions some root-finding functions, but they all seem to be iterative - which should not be neccesary in my case. Can anyone tell me if boost includes any functions for analytically computing the roots of quadratic, cubic and possibly quartic polynomials? Thanks in advance, Fredrik Orderud
I've run into an eigenvalue problem where I need to compute the roots of a cubic polynomial.
Hi Fredrik, If you're trying to solve the characteristic equation det(A-\lambda I) = 0 by hand, it's the wrong path. Try using an appropriate library for solving eigenproblems. Best, Júlio.
On Sun, Aug 18, 2013 at 4:02 PM, Júlio Hoffimann
I've run into an eigenvalue problem where I need to compute the roots of a
cubic polynomial.
If you're trying to solve the characteristic equation det(A-\lambda I) = 0 by hand, it's the wrong path. Try using an appropriate library for solving eigenproblems.
I'm aware that some lin-alg libraries, such as e.g. Eigen, includes eigenvalue solvers that might suit my needs. It would, however, be an advantage for me to avoid introducing any additional dependencies just to solve this "tiny" problem. Boost math already includes several math functions for root finding, so I was surprised over the lack of functions to solve lower order polynomials. Fredrik
participants (2)
-
Fredrik Orderud
-
Júlio Hoffimann