|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--calc.Polynom
Field Summary | |
protected double[] |
coefficients
An Array of the coefficients, in ascending power (i.e. beginning with the constant summand) |
Constructor Summary | |
Polynom()
the default constructor creates the nullpolynomial |
|
Polynom(double[] coefficients)
Nullpolynomials (i.e. coefficients.length == 0) are allowed, but not a nullpointer argument! |
|
Polynom(Polynom p)
Copy-Constructor |
Method Summary | |
void |
add(Polynom p)
adds two polynomials |
int |
degree()
|
Complex |
eval(Complex z)
evaluates the polynomial for a certain complex number |
double |
getCoefficient(int i)
|
double[] |
getCoefficients()
|
BaseCalc |
getOperationTree()
builds and returns the corresponding operational tree for further calculations |
void |
integrate(double constant)
integrates the polynomial analytically, using the argument as integration constant |
static void |
main(java.lang.String[] args)
for testing purposes |
void |
multiply(double d)
multiplication with a number |
void |
multiply(Polynom p)
multiplication with another polynomial |
void |
setCoefficient(int i,
double value)
|
java.lang.String |
toString()
for pretty printing: output is of form: X^6 - 3.0X^5 + 2.5X^4 - 0.49999999999999956X^2 + 0.023809523809523885 |
void |
translate(double k)
performs the operation f(x) -> f(x+k) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected double[] coefficients
Constructor Detail |
public Polynom()
public Polynom(double[] coefficients)
public Polynom(Polynom p)
Method Detail |
public int degree()
public double getCoefficient(int i)
public void setCoefficient(int i, double value)
public double[] getCoefficients()
public void add(Polynom p)
public void multiply(double d)
public void multiply(Polynom p)
public void translate(double k)
public Complex eval(Complex z)
public void integrate(double constant)
public java.lang.String toString()
X^6 - 3.0X^5 + 2.5X^4 - 0.49999999999999956X^2 + 0.023809523809523885
toString
in class java.lang.Object
public BaseCalc getOperationTree()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |