|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.analysis.function.polynomial.root.Polyroot
public class Polyroot
A solver for polynomial equations.
A root (or a zero) of a function f is a member x in
the domain of f such that f(x) vanishes at
x.
That is
f(x) = 0
This is a wrapper class that solves for a Polynomial equation with non-negative, whole number exponents,
e.g.,
ax4 + bx3 + cx2 + dx + e = 0
By the fundamental theorem of algebra, every polynomial of degree n has n roots.
The roots can be both real (in double) or Complex.
By default, all polynomial equations are solved using Jenkins-Traub algorithm.
Customized solvers of various types, such as Linear, Quadratic,
Cubic, Quartic, can be registered via the constructor.
By Abel–Ruffini theorem, we have analytical solution for polynomials of degree up to 4.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.analysis.function.polynomial.root.Solver |
|---|
Solver.RootFindingException, Solver.Type |
| Constructor Summary | |
|---|---|
Polyroot(Solver... solvers)
Construct a Polyroot instance to solve polynomial equations. |
|
| Method Summary | |
|---|---|
NumberList |
solve(Polynomial polynomial)
Call the appropriate solver to find roots/zeros for the polynomial. |
Solver.Type |
type()
Get the type of the solver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Polyroot(Solver... solvers)
Polyroot instance to solve polynomial equations.
Customized solver for a particular type of polynomial can be registered
via the solvers argument. For example,
Polyroot solver = new Polyroot(new Cubic(), new Quartic());
The default polynomial solver, JenkinsTraubReal,
can be used to solve any polynomial equations.
solvers - customized solver implementations| Method Detail |
|---|
public Solver.Type type()
Solver
type in interface Solverpublic NumberList solve(Polynomial polynomial)
solve in interface Solverpolynomial - the polynomial to be solved
java.lang.IllegalArgumentException - if the polynomial is a constant, hence no variable
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||