|
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.HornerScheme
public class HornerScheme
Horner scheme is an algorithm for the efficient evaluation of polynomials in monomial form. It can also be viewed as a fast algorithm for dividing a polynomial by a linear polynomial with Ruffini's rule.
By polynomial remainder theorem,
P(x) = Q(x)(x - x0) + P(x0)That is, it computes the value of a polynomial P(x) at x0, i.e., P(x0), and at the same time gives the quotient Q(x).
| Constructor Summary | |
|---|---|
HornerScheme(Polynomial polynomial,
double x)
Evaluate a polynomial at x. |
|
| Method Summary | |
|---|---|
Polynomial |
quotient()
Get the quotient, the value of P(x). |
double |
remainder()
Get the remainder. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HornerScheme(Polynomial polynomial,
double x)
x.
polynomial - a polynomialx - a point to evaluate at| Method Detail |
|---|
public double remainder()
public Polynomial quotient()
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||