|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.spaceroots.mantissa.algebra.Polynomial
This class implements polynomials with one unknown.
This is an abstract class that only declares general methods but does not hold the coefficients by themselves. Specific subclasses are used to handle exact rational coefficients or approximate real coefficients. This design is taken from the various java.awt.geom classes (Point2D, Rectangle2D ...)
The methods implemented deal mainly with the polynomials algebra (addition, multiplication ...) but the analysis aspects are also considered (value of the polynom for a given unknown, derivative).
Instances of this class are immutable.
| Nested Class Summary | |
static class |
Polynomial.DivisionResult
This class stores the result of the euclidian division of two polynomials. |
static class |
Polynomial.Double
This class implements polynomials with one unknown and real coefficients. |
static class |
Polynomial.Rational
This class implements polynomials with one unknown and rational coefficients. |
| Constructor Summary | |
Polynomial()
|
|
| Method Summary | |
Polynomial |
divide(BigInteger i)
Divide the instance by a constant. |
Polynomial |
divide(long l)
Divide the instance by a constant. |
Polynomial |
divide(RationalNumber r)
Divide the instance by a constant. |
abstract int |
getDegree()
Get the polynomial degree. |
abstract Polynomial |
getDerivative()
Get the derivative of the instance with respect to the unknown. |
abstract boolean |
isIdentity()
Check if the instance is the identity polynomial. |
abstract boolean |
isOne()
Check if the instance is the constant unit polynomial. |
abstract boolean |
isZero()
Check if the instance is the null polynomial. |
Polynomial |
multiply(BigInteger i)
Multiply the instance by a constant. |
abstract Polynomial |
multiply(long l)
Multiply the instance by a constant. |
abstract Polynomial |
multiply(RationalNumber r)
Multiply the instance by a constant. |
abstract Polynomial |
negate()
Negate the instance. |
abstract double |
valueAt(double x)
Get the value of the polynomial for a specified unknown. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Polynomial()
| Method Detail |
public abstract boolean isZero()
public abstract boolean isOne()
public abstract boolean isIdentity()
public abstract int getDegree()
public abstract Polynomial negate()
public abstract Polynomial multiply(RationalNumber r)
r - constant to multiply by
public abstract Polynomial multiply(long l)
l - constant to multiply by
public Polynomial multiply(BigInteger i)
i - constant to multiply by
public Polynomial divide(long l)
l - constant to multiply by
ArithmeticException - if the constant is zeropublic Polynomial divide(RationalNumber r)
r - constant to multiply by
ArithmeticException - if the constant is zeropublic Polynomial divide(BigInteger i)
i - constant to multiply by
ArithmeticException - if the constant is zeropublic abstract double valueAt(double x)
x - value of the unknown
public abstract Polynomial getDerivative()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||