JSci.maths.polynomials
Class ComplexPolynomial

java.lang.Object
  extended by JSci.maths.polynomials.ComplexPolynomial
All Implemented Interfaces:
java.io.Serializable, Ring.Member, AbelianGroup.Member, Member, Polynomial

public class ComplexPolynomial
extends java.lang.Object
implements Polynomial

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

Author:
b.dietrich
See Also:
RealPolynomial, Serialized Form

Field Summary
 
Fields inherited from interface JSci.maths.polynomials.Polynomial
POLYEPS
 
Constructor Summary
ComplexPolynomial(Complex[] coeff)
          Creates a new instance of ComplexPolynomial
ComplexPolynomial(Field.Member[] f)
          Creates a new ComplexPolynomial object.
 
Method Summary
 AbelianGroup.Member add(AbelianGroup.Member g)
          The group composition law.
 int degree()
          The degree
 ComplexPolynomial divide(Complex a)
          Returns the division of this polynomial by a scalar.
 ComplexPolynomial divide(double a)
          Returns the division of this polynomial by a scalar.
 Polynomial divide(Field.Member f)
          Returns the division of this polynomial by a scalar.
 boolean equals(java.lang.Object o)
           
 Field.Member getCoefficient(int n)
          Get the coefficient of degree k, i.e.
 Complex getCoefficientAsComplex(int n)
           
 Field.Member[] getCoefficients()
          Get the coefficients as an array
 Complex[] getCoefficientsAsComplexes()
          Return the coefficients as an array of complex numbers.
 int hashCode()
           
 boolean isNull()
           
 boolean isOne()
           
 ComplexPolynomial multiply(Complex a)
          Returns the multiplication of this polynomial by a scalar.
 ComplexPolynomial multiply(double a)
          Returns the multiplication of this polynomial by a scalar.
 Polynomial multiply(Field.Member f)
          Returns the multiplication of this polynomial by a scalar.
 Ring.Member multiply(Ring.Member r)
          The multiplication law.
 AbelianGroup.Member negate()
          Returns the inverse member.
 AbelianGroup.Member subtract(AbelianGroup.Member g)
          The group composition law with inverse.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComplexPolynomial

public ComplexPolynomial(Complex[] coeff)
Creates a new instance of ComplexPolynomial


ComplexPolynomial

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

Parameters:
f -
Method Detail

getCoefficient

public Field.Member getCoefficient(int n)
Description copied from interface: Polynomial
Get the coefficient of degree k, i.e. a_k if P(x) := sum_{k=0}^n a_k x^k

Specified by:
getCoefficient in interface Polynomial
Parameters:
n -
Returns:
coefficient as described above

getCoefficientAsComplex

public Complex getCoefficientAsComplex(int n)
Parameters:
n -

getCoefficients

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

Specified by:
getCoefficients in interface Polynomial
Returns:
the coefficients as an array

getCoefficientsAsComplexes

public Complex[] getCoefficientsAsComplexes()
Return the coefficients as an array of complex numbers.


degree

public int degree()
Description copied from interface: Polynomial
The degree

Specified by:
degree in interface Polynomial
Returns:
the degree

isNull

public boolean isNull()
Returns:
true if null

isOne

public boolean isOne()
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
Parameters:
g - a group member

divide

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

Specified by:
divide in interface Polynomial
Parameters:
a -
Returns:
new Polynomial with coefficients /= a

divide

public ComplexPolynomial divide(Complex a)
Returns the division of this polynomial by a scalar.

Parameters:
a -

divide

public ComplexPolynomial divide(double a)
Returns the division of this polynomial by a scalar.

Parameters:
a -

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
Parameters:
o -

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

multiply

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

Specified by:
multiply in interface Polynomial
Parameters:
f -
Returns:
new Polynomial with coefficients *= a

multiply

public ComplexPolynomial multiply(double a)
Returns the multiplication of this polynomial by a scalar.

Parameters:
a -

multiply

public ComplexPolynomial multiply(Complex a)
Returns the multiplication of this polynomial by a scalar.

Parameters:
a -

multiply

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

Specified by:
multiply in interface Ring.Member
Parameters:
r - a ring member

negate

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

Specified by:
negate in interface AbelianGroup.Member

subtract

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

Specified by:
subtract in interface AbelianGroup.Member
Parameters:
g - a group member

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object