org.jscience.mathematics.analysis.polynomials
Class ExactComplexPolynomial

java.lang.Object
  extended by org.jscience.mathematics.analysis.ExactComplexFunction
      extended by org.jscience.mathematics.analysis.polynomials.ExactComplexPolynomial
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Field.Member, Ring.Member, AbelianGroup.Member, AbstractMapping, C1Function, NumberMapping, Polynomial, Member

public class ExactComplexPolynomial
extends ExactComplexFunction
implements Polynomial, java.io.Serializable, java.lang.Cloneable

A Polynomial over the ExactComplex field. For a description of the methods

See Also:
ExactRealPolynomial, Serialized Form

Constructor Summary
ExactComplexPolynomial(ExactComplex[] coeff)
          Creates a new instance of ExactComplexPolynomial, polynom is always simplified discarding every trailing zeros and array copied (but not contents of elements).
ExactComplexPolynomial(ExactComplexPolynomial polynomial)
          Creates a new instance of ExactComplexPolynomial, polynom is always simplified discarding every trailing zeros.
ExactComplexPolynomial(Field.Member[] f)
          Creates a new ExactComplexPolynomial object.
 
Method Summary
 AbelianGroup.Member add(AbelianGroup.Member g)
          The group composition law.
 java.lang.Object clone()
          DOCUMENT ME!
 int degree()
          DOCUMENT ME!
 ExactComplexFunction differentiate()
          Differentiate the complex polynomial.
 boolean equals(java.lang.Object o)
          DOCUMENT ME!
 Field.Member getCoefficient(int n)
          DOCUMENT ME!
 ExactComplex getCoefficientAsExactComplex(int n)
          DOCUMENT ME!
 Field.Member[] getCoefficients()
          Get the coefficients as an array
 ExactComplex[] getCoefficientsAsExactComplexes()
          Return the coefficients as an array of ExactComplex numbers.
 java.lang.Object getSet()
          DOCUMENT ME!
 int hashCode()
           
 ExactComplexPolynomial integrate()
          "inverse" operation for differentiate, zero degree constant set to zero
 boolean isOne()
          DOCUMENT ME!
 boolean isZero()
          DOCUMENT ME!
 ExactComplex map(double x, double y)
          Evaluates this polynomial.
 ExactComplex map(ExactComplex z)
          Evaluates this polynomial.
 Ring.Member multiply(Ring.Member r)
          The multiplication law.
 AbelianGroup.Member negate()
          Returns the inverse member.
 ExactComplexPolynomial scalarDivide(ExactComplex a)
          Returns the division of this polynomial by a scalar.
 ExactComplexPolynomial scalarDivide(ExactReal a)
          Returns the division of this polynomial by a scalar.
 Polynomial scalarDivide(Field.Member f)
          Returns the division of this polynomial by a scalar.
 ExactComplexPolynomial scalarMultiply(ExactComplex a)
          Returns the multiplication of this polynomial by a scalar.
 ExactComplexPolynomial scalarMultiply(ExactReal a)
          Returns the multiplication of this polynomial by a scalar.
 Polynomial scalarMultiply(Field.Member f)
          Returns the multiplication of this polynomial by a scalar.
 void setCoefficient(int n, Field.Member c)
          DOCUMENT ME!
 void setCoefficientAsExactComplex(int n, ExactComplex c)
          DOCUMENT ME!
 AbelianGroup.Member subtract(AbelianGroup.Member g)
          The group composition law with inverse.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String unknown)
          String representation P(x) = a_k x^k +...
 
Methods inherited from class org.jscience.mathematics.analysis.ExactComplexFunction
add, compose, divide, divide, getIntervalsList, inverse, map, multiply, setIntervalsList, subtract, taylorExpand
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExactComplexPolynomial

public ExactComplexPolynomial(ExactComplex[] coeff)
Creates a new instance of ExactComplexPolynomial, polynom is always simplified discarding every trailing zeros and array copied (but not contents of elements).

Parameters:
coeff - DOCUMENT ME!
Throws:
java.lang.NullPointerException - DOCUMENT ME!

ExactComplexPolynomial

public ExactComplexPolynomial(ExactComplexPolynomial polynomial)
Creates a new instance of ExactComplexPolynomial, polynom is always simplified discarding every trailing zeros.

Parameters:
polynomial - DOCUMENT ME!

ExactComplexPolynomial

public ExactComplexPolynomial(Field.Member[] f)
Creates a new ExactComplexPolynomial object.

Parameters:
f -
Method Detail

getCoefficient

public Field.Member getCoefficient(int n)
DOCUMENT ME!

Specified by:
getCoefficient in interface Polynomial
Parameters:
n -
Returns:
DOCUMENT ME!

getCoefficientAsExactComplex

public ExactComplex getCoefficientAsExactComplex(int n)
DOCUMENT ME!

Parameters:
n -
Returns:
DOCUMENT ME!

getCoefficients

public Field.Member[] getCoefficients()
Description copied from interface: Polynomial
Get the coefficients as an array

Specified by:
getCoefficients in interface Polynomial
Returns:
DOCUMENT ME!

getCoefficientsAsExactComplexes

public ExactComplex[] getCoefficientsAsExactComplexes()
Return the coefficients as an array of ExactComplex numbers.

Returns:
DOCUMENT ME!

setCoefficient

public void setCoefficient(int n,
                           Field.Member c)
DOCUMENT ME!

Parameters:
n -
c - DOCUMENT ME!

setCoefficientAsExactComplex

public void setCoefficientAsExactComplex(int n,
                                         ExactComplex c)
DOCUMENT ME!

Parameters:
n -
c - DOCUMENT ME!

map

public ExactComplex map(ExactComplex z)
Evaluates this polynomial.

Specified by:
map in class ExactComplexFunction
Parameters:
z - DOCUMENT ME!
Returns:
DOCUMENT ME!

map

public ExactComplex map(double x,
                        double y)
Evaluates this polynomial.

Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
Returns:
DOCUMENT ME!

degree

public int degree()
DOCUMENT ME!

Specified by:
degree in interface Polynomial
Returns:
the degree

getSet

public java.lang.Object getSet()
DOCUMENT ME!

Returns:
DOCUMENT ME!

isZero

public boolean isZero()
DOCUMENT ME!

Returns:
true if this is equal to zero.

isOne

public boolean isOne()
DOCUMENT ME!

Returns:
true if this is equal to one.

add

public AbelianGroup.Member add(AbelianGroup.Member g)
The group composition law.

Specified by:
add in interface AbelianGroup.Member
Overrides:
add in class ExactComplexFunction
Parameters:
g - a group member
Returns:
DOCUMENT ME!

differentiate

public ExactComplexFunction differentiate()
Differentiate the complex polynomial. Only useful iff the polynomial is built over a banach space and an appropriate multiplication law is provided.

Specified by:
differentiate in interface C1Function
Specified by:
differentiate in class ExactComplexFunction
Returns:
a new polynomial with degree = max(this.degree-1 , 0)

scalarDivide

public Polynomial scalarDivide(Field.Member f)
Returns the division of this polynomial by a scalar.

Specified by:
scalarDivide in interface Polynomial
Parameters:
f -
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

scalarDivide

public ExactComplexPolynomial scalarDivide(ExactComplex a)
Returns the division of this polynomial by a scalar.

Parameters:
a -
Returns:
DOCUMENT ME!

scalarDivide

public ExactComplexPolynomial scalarDivide(ExactReal a)
Returns the division of this polynomial by a scalar.

Parameters:
a -
Returns:
DOCUMENT ME!

equals

public boolean equals(java.lang.Object o)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:
DOCUMENT ME!

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
DOCUMENT ME!

integrate

public ExactComplexPolynomial integrate()
"inverse" operation for differentiate, zero degree constant set to zero

Returns:
the integrated polynomial

scalarMultiply

public Polynomial scalarMultiply(Field.Member f)
Returns the multiplication of this polynomial by a scalar.

Specified by:
scalarMultiply in interface Polynomial
Parameters:
f -
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

scalarMultiply

public ExactComplexPolynomial scalarMultiply(ExactReal a)
Returns the multiplication of this polynomial by a scalar.

Parameters:
a -
Returns:
DOCUMENT ME!

scalarMultiply

public ExactComplexPolynomial scalarMultiply(ExactComplex a)
Returns the multiplication of this polynomial by a scalar.

Parameters:
a -
Returns:
DOCUMENT ME!

multiply

public Ring.Member multiply(Ring.Member r)
The multiplication law.

Specified by:
multiply in interface Ring.Member
Overrides:
multiply in class ExactComplexFunction
Parameters:
r - a ring member
Returns:
DOCUMENT ME!

negate

public AbelianGroup.Member negate()
Returns the inverse member.

Specified by:
negate in interface AbelianGroup.Member
Overrides:
negate in class ExactComplexFunction
Returns:
DOCUMENT ME!

subtract

public AbelianGroup.Member subtract(AbelianGroup.Member g)
The group composition law with inverse.

Specified by:
subtract in interface AbelianGroup.Member
Overrides:
subtract in class ExactComplexFunction
Parameters:
g - a group member
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

toString

public java.lang.String toString(java.lang.String unknown)
String representation P(x) = a_k x^k +...

Parameters:
unknown - The name of the unkwown
Returns:
String

clone

public java.lang.Object clone()
DOCUMENT ME!

Overrides:
clone in class java.lang.Object
Returns:
DOCUMENT ME!