|
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.Roots
public class Roots
This class provides utility functions to access the roots returned by Solver.
This design separately the algorithms for finding roots and the algorithms for reading/accessing the results.
| Constructor Summary | |
|---|---|
Roots(NumberList roots)
Construct a Roots instance to collect all the roots of a polynomial equation. |
|
| Method Summary | |
|---|---|
NumberList |
allRoots()
Get a copy of all the roots of the polynomial. |
java.util.List<Complex> |
complexRoots()
Get a copy of all the Complex but not real roots of the polynomial. |
java.lang.Number |
get(int i)
Get the i-th root of the polynomial. |
double[] |
realRoots()
Get a copy of all the real roots of the polynomial. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Roots(NumberList roots)
roots - the roots of a polynomial equation| Method Detail |
|---|
public java.lang.Number get(int i)
i - the index, counting from 1
Solver.RootFindingException - if i exceeds the number of roots (the polynomial degree)public NumberList allRoots()
double array of the real rootspublic double[] realRoots()
The union of these and complexRoots() equal to those of allRoots().
double array of the real rootspublic java.util.List<Complex> complexRoots()
Complex but not real roots of the polynomial.
The union of these and realRoots() equal to those of allRoots().
Complex roots
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||