jsci.maths.polynomials
Class ComplexPolynomial
- java.lang.Object
-
- 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
Constructors Constructor and Description ComplexPolynomial(Complex[] coeff)Creates a new instance of ComplexPolynomialComplexPolynomial(Field.Member[] f)Creates a new ComplexPolynomial object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AbelianGroup.Memberadd(AbelianGroup.Member g)The group composition law.intdegree()The degree.booleanequals(java.lang.Object o)Field.MembergetCoefficient(int n)Get the coefficient of degree k, i.e.ComplexgetCoefficientAsComplex(int n)Field.Member[]getCoefficients()Get the coefficients as an arrayComplex[]getCoefficientsAsComplexes()Return the coefficients as an array of complex numbers.java.lang.ObjectgetSet()inthashCode()booleanisOne()booleanisZero()Complexmap(Complex z)Evaluates this polynomial.Complexmap(double x, double y)Evaluates this polynomial.Ring.Membermultiply(Ring.Member r)The multiplication law.AbelianGroup.Membernegate()Returns the inverse member.ComplexPolynomialscalarDivide(Complex a)Returns the division of this polynomial by a scalar.ComplexPolynomialscalarDivide(double a)Returns the division of this polynomial by a scalar.PolynomialscalarDivide(Field.Member f)Returns the division of this polynomial by a scalar.ComplexPolynomialscalarMultiply(Complex a)Returns the multiplication of this polynomial by a scalar.ComplexPolynomialscalarMultiply(double a)Returns the multiplication of this polynomial by a scalar.PolynomialscalarMultiply(Field.Member f)Returns the multiplication of this polynomial by a scalar.AbelianGroup.Membersubtract(AbelianGroup.Member g)The group composition law with inverse.java.lang.StringtoString()
-
-
-
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:PolynomialGet the coefficient of degree k, i.e. a_k if P(x) := sum_{k=0}^n a_k x^k- Specified by:
getCoefficientin interfacePolynomial- Parameters:
n-- Returns:
- coefficient as described above
-
getCoefficientAsComplex
public Complex getCoefficientAsComplex(int n)
- Parameters:
n-
-
getCoefficients
public Field.Member[] getCoefficients()
Description copied from interface:PolynomialGet the coefficients as an array- Specified by:
getCoefficientsin interfacePolynomial- Returns:
- the coefficients as an array
-
getCoefficientsAsComplexes
public Complex[] getCoefficientsAsComplexes()
Return the coefficients as an array of complex numbers.
-
map
public Complex map(double x, double y)
Evaluates this polynomial.
-
degree
public int degree()
Description copied from interface:PolynomialThe degree.- Specified by:
degreein interfacePolynomial- Returns:
- the degree
-
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:
addin interfaceAbelianGroup.Member- Parameters:
g- a group member
-
scalarDivide
public Polynomial scalarDivide(Field.Member f)
Returns the division of this polynomial by a scalar.- Specified by:
scalarDividein interfacePolynomial- 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:
equalsin classjava.lang.Object- Parameters:
o-
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
scalarMultiply
public Polynomial scalarMultiply(Field.Member f)
Returns the multiplication of this polynomial by a scalar.- Specified by:
scalarMultiplyin interfacePolynomial- 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:
multiplyin interfaceRing.Member- Parameters:
r- a ring member
-
negate
public AbelianGroup.Member negate()
Returns the inverse member.- Specified by:
negatein interfaceAbelianGroup.Member
-
subtract
public AbelianGroup.Member subtract(AbelianGroup.Member g)
The group composition law with inverse.- Specified by:
subtractin interfaceAbelianGroup.Member- Parameters:
g- a group member
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG