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

See Also:
RealPolynomial, Serialized Form

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.
 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.
 java.lang.Object getSet()
           
 int hashCode()
           
 boolean isOne()
           
 boolean isZero()
           
 Complex map(Complex z)
          Evaluates this polynomial.
 Complex map(double x, double y)
          Evaluates this polynomial.
 Ring.Member multiply(Ring.Member r)
          The multiplication law.
 AbelianGroup.Member negate()
          Returns the inverse member.
 ComplexPolynomial scalarDivide(Complex a)
          Returns the division of this polynomial by a scalar.
 ComplexPolynomial scalarDivide(double a)
          Returns the division of this polynomial by a scalar.
 Polynomial scalarDivide(Field.Member f)
          Returns the division of this polynomial by a scalar.
 ComplexPolynomial scalarMultiply(Complex a)
          Returns the multiplication of this polynomial by a scalar.
 ComplexPolynomial scalarMultiply(double a)
          Returns the multiplication of this polynomial by a scalar.
 Polynomial scalarMultiply(Field.Member f)
          Returns the multiplication of this polynomial by a scalar.
 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.


map

public Complex map(Complex z)
Evaluates this polynomial.


map

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


degree

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

Specified by:
degree in interface Polynomial
Returns:
the degree

getSet

public java.lang.Object getSet()
Specified by:
getSet in interface Member

isZero

public boolean isZero()
Returns:
true if this is equal to zero.

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

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:
new Polynomial with coefficients /= a

scalarDivide

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

Parameters:
a -

scalarDivide

public ComplexPolynomial scalarDivide(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

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:
new Polynomial with coefficients *= a

scalarMultiply

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

Parameters:
a -

scalarMultiply

public ComplexPolynomial scalarMultiply(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