|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.math.Polynomial
public class Polynomial
Polynomial functions.
Constructor Summary | |
---|---|
protected |
Polynomial()
Don't allow instantiation but do allow overrides. |
Method Summary | |
---|---|
static double |
evaluateChebyschev(double[] coeffs,
double x)
Evaluates a Chebyschev series. |
static double |
hornersMethod(double[] polycoefs,
double x)
Evaluate a polynomial expression using Horner's method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Polynomial()
Method Detail |
---|
public static double hornersMethod(double[] polycoefs, double x)
polycoefs
- Array of polynomial coefficients.
The coefficients should be ordered
with the constant term first and the
coefficient for the highest powered term
last.x
- Value for which to evaluate polynomial.
Horner's method is given by the following recurrence relation: c[i]*x^i + ... + c[1]*x + c[0] = c[0] + x*(c[i-1]*x^[i-1] + ... + c[1])
Horner's method avoids loss of precision which can occur when the higher-power values of x are computed directly.
public static double evaluateChebyschev(double[] coeffs, double x)
coeffs
- The Chebyschev polynomial coefficients.x
- The value for which to evaluate
the polynomial.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |