|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nr.Polynomial
public class Polynomial
Polynomial evaluations, from CERN
Method Summary | |
---|---|
static double |
eval(double x,
double[] coef)
Evaluates the given polynomial of degree N at x. |
static double |
eval1(double x,
double[] coef)
Evaluates the given polynomial of degree N at x, assuming coefficient of N is 1.0. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double eval1(double x, double[] coef)
y = C0 + C1x + C2x2
+ … + CNxN
CN = 1
and hence is omitted from the array.
x
- argument to the polynomial.coef
- the coefficients of the polynomial.public static double eval(double x, double[] coef) throws java.lang.ArithmeticException
y = C0 + C1x + C2x2
+ … + CNxN
x
- argument to the polynomial.coef
- the coefficients of the polynomial.N
- the degree of the polynomial.
java.lang.ArithmeticException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |