Package edu.jas.root
Class ComplexAlgebraicNumber<C extends GcdRingElem<C> & Rational>
java.lang.Object
edu.jas.root.ComplexAlgebraicNumber<C>
- All Implemented Interfaces:
AbelianGroupElem<ComplexAlgebraicNumber<C>>
,Element<ComplexAlgebraicNumber<C>>
,GcdRingElem<ComplexAlgebraicNumber<C>>
,MonoidElem<ComplexAlgebraicNumber<C>>
,RingElem<ComplexAlgebraicNumber<C>>
,Serializable
,Comparable<ComplexAlgebraicNumber<C>>
public class ComplexAlgebraicNumber<C extends GcdRingElem<C> & Rational>
extends Object
implements GcdRingElem<ComplexAlgebraicNumber<C>>
Complex algebraic number class based on AlgebraicNumber. Objects of this
class are immutable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AlgebraicNumber
<Complex<C>> Representing AlgebraicNumber.final ComplexAlgebraicRing
<C> Ring part of the data structure. -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor creates a ComplexAlgebraicNumber object from a GenPolynomial object module.The constructor creates a ComplexAlgebraicNumber object from ComplexAlgebraicRing modul and a AlgebraicNumber value.The constructor creates a ComplexAlgebraicNumber object from ComplexAlgebraicRing modul and a GenPolynomial value. -
Method Summary
Modifier and TypeMethodDescriptionabs()
ComplexAlgebraicNumber absolute value.int
compareTo
(AlgebraicNumber<Complex<C>> b) ComplexAlgebraicNumber comparison.int
ComplexAlgebraicNumber comparison.copy()
Copy this.ComplexAlgebraicNumber magnitude.ComplexAlgebraicNumber division.ComplexAlgebraicNumber extended greatest common divisor.boolean
Comparison with any other object.factory()
Get the corresponding element factory.ComplexAlgebraicNumber greatest common divisor.int
hashCode()
Hash code for this ComplexAlgebraicNumber.inverse()
ComplexAlgebraicNumber inverse.boolean
isONE()
Is ComplexAlgebraicNumber one.boolean
Is ComplexAlgebraicNumber a root of unity.boolean
isUnit()
Is ComplexAlgebraicNumber unit.boolean
isZERO()
Is ComplexAlgebraicNumber zero.ComplexAlgebraicNumber magnitude.monic()
ComplexAlgebraicNumber monic.ComplexAlgebraicNumber multiplication.multiply
(GenPolynomial<Complex<C>> c) ComplexAlgebraicNumber multiplication.ComplexAlgebraicNumber multiplication.negate()
ComplexAlgebraicNumber negate.Quotient and remainder by division of this by S.ComplexAlgebraicNumber remainder.int
signum()
ComplexAlgebraicNumber signum.ComplexAlgebraicNumber subtraction.sum
(AlgebraicNumber<Complex<C>> c) ComplexAlgebraicNumber summation.ComplexAlgebraicNumber summation.sum
(GenPolynomial<Complex<C>> c) ComplexAlgebraicNumber summation.ComplexAlgebraicNumber summation.toScript()
Get a scripting compatible string representation.Get a scripting compatible string representation of the factory.toString()
Get the String representation as RingElem.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.jas.structure.MonoidElem
leftDivide, leftRemainder, power, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
-
Field Details
-
number
Representing AlgebraicNumber. -
ring
Ring part of the data structure.
-
-
Constructor Details
-
ComplexAlgebraicNumber
The constructor creates a ComplexAlgebraicNumber object from ComplexAlgebraicRing modul and a GenPolynomial value.- Parameters:
r
- ring ComplexAlgebraicRing. a
- value GenPolynomial.
-
ComplexAlgebraicNumber
The constructor creates a ComplexAlgebraicNumber object from ComplexAlgebraicRing modul and a AlgebraicNumber value.- Parameters:
r
- ring ComplexAlgebraicRing. a
- value AlgebraicNumber.
-
ComplexAlgebraicNumber
The constructor creates a ComplexAlgebraicNumber object from a GenPolynomial object module.- Parameters:
r
- ring ComplexAlgebraicRing.
-
-
Method Details
-
factory
Get the corresponding element factory. -
copy
Copy this. -
isZERO
public boolean isZERO()Is ComplexAlgebraicNumber zero.- Specified by:
isZERO
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Returns:
- If this is 0 then true is returned, else false.
- See Also:
-
isONE
public boolean isONE()Is ComplexAlgebraicNumber one.- Specified by:
isONE
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Returns:
- If this is 1 then true is returned, else false.
- See Also:
-
isUnit
public boolean isUnit()Is ComplexAlgebraicNumber unit.- Specified by:
isUnit
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Returns:
- If this is a unit then true is returned, else false.
- See Also:
-
isRootOfUnity
public boolean isRootOfUnity()Is ComplexAlgebraicNumber a root of unity.- Returns:
- true if |this**i| == 1, for some 0 < i ≤ deg(modul), else false.
-
toString
Get the String representation as RingElem. -
toScript
Get a scripting compatible string representation. -
toScriptFactory
Get a scripting compatible string representation of the factory.- Specified by:
toScriptFactory
in interfaceElement<C extends GcdRingElem<C> & Rational>
- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
compareTo
ComplexAlgebraicNumber comparison.- Specified by:
compareTo
in interfaceComparable<C extends GcdRingElem<C> & Rational>
- Specified by:
compareTo
in interfaceElement<C extends GcdRingElem<C> & Rational>
- Parameters:
b
- ComplexAlgebraicNumber.- Returns:
- sign(this-b).
-
compareTo
ComplexAlgebraicNumber comparison.- Parameters:
b
- AlgebraicNumber.- Returns:
- polynomial sign(this-b).
-
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this ComplexAlgebraicNumber. -
abs
ComplexAlgebraicNumber absolute value.- Specified by:
abs
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Returns:
- the absolute value of this.
- See Also:
-
sum
ComplexAlgebraicNumber summation.- Specified by:
sum
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- ComplexAlgebraicNumber.- Returns:
- this+S.
-
sum
ComplexAlgebraicNumber summation.- Parameters:
c
- complex polynomial.- Returns:
- this+c.
-
sum
ComplexAlgebraicNumber summation.- Parameters:
c
- algebraic number.- Returns:
- this+c.
-
sum
ComplexAlgebraicNumber summation.- Parameters:
c
- coefficient.- Returns:
- this+c.
-
negate
ComplexAlgebraicNumber negate.- Specified by:
negate
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Returns:
- -this.
- See Also:
-
subtract
ComplexAlgebraicNumber subtraction.- Specified by:
subtract
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- ComplexAlgebraicNumber.- Returns:
- this-S.
-
divide
ComplexAlgebraicNumber division.- Specified by:
divide
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- ComplexAlgebraicNumber.- Returns:
- this/S.
-
inverse
ComplexAlgebraicNumber inverse.- Specified by:
inverse
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Returns:
- S with S = 1/this if defined.
- Throws:
NotInvertibleException
- if the element is not invertible.- See Also:
-
remainder
ComplexAlgebraicNumber remainder.- Specified by:
remainder
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- ComplexAlgebraicNumber.- Returns:
- this - (this/S)*S.
-
quotientRemainder
Quotient and remainder by division of this by S.- Specified by:
quotientRemainder
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- a ComplexAlgebraicNumber- Returns:
- [this/S, this - (this/S)*S].
-
multiply
ComplexAlgebraicNumber multiplication.- Specified by:
multiply
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- ComplexAlgebraicNumber.- Returns:
- this*S.
-
multiply
ComplexAlgebraicNumber multiplication.- Parameters:
c
- coefficient.- Returns:
- this*c.
-
multiply
ComplexAlgebraicNumber multiplication.- Parameters:
c
- polynomial.- Returns:
- this*c.
-
monic
ComplexAlgebraicNumber monic.- Returns:
- this with monic value part.
-
gcd
ComplexAlgebraicNumber greatest common divisor. -
egcd
ComplexAlgebraicNumber extended greatest common divisor. -
signum
public int signum()ComplexAlgebraicNumber signum.- Specified by:
signum
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Returns:
- signum(this).
- See Also:
-
magnitude
ComplexAlgebraicNumber magnitude.- Returns:
- |this| as complex rational number.
-
decimalMagnitude
ComplexAlgebraicNumber magnitude.- Returns:
- |this| as complex big decimal.
-