Package edu.jas.application
Class RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>
java.lang.Object
edu.jas.application.RealAlgebraicNumber<C>
- All Implemented Interfaces:
Rational
,AbelianGroupElem<RealAlgebraicNumber<C>>
,Element<RealAlgebraicNumber<C>>
,GcdRingElem<RealAlgebraicNumber<C>>
,MonoidElem<RealAlgebraicNumber<C>>
,RingElem<RealAlgebraicNumber<C>>
,Serializable
,Comparable<RealAlgebraicNumber<C>>
public class RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>
extends Object
implements GcdRingElem<RealAlgebraicNumber<C>>, Rational
Complex algebraic number class based on bi-variate real algebraic numbers.
Objects of this class are immutable. Bi-variate ideal implementation is in
version 3614 2011-04-28 09:20:34Z.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal RealAlgebraicNumber
<RealAlgebraicNumber<C>> Representing recursive RealAlgebraicNumber.final RealAlgebraicRing
<C> Ring part of the data structure. -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor creates a zero RealAlgebraicNumber.RealAlgebraicNumber
(RealAlgebraicRing<C> r, C a) The constructor creates a RealAlgebraicNumber object from a GenPolynomial value.The constructor creates a RealAlgebraicNumber object from a GenPolynomial value.The constructor creates a RealAlgebraicNumber object from a recursive real algebraic value. -
Method Summary
Modifier and TypeMethodDescriptionabs()
RealAlgebraicNumber absolute value.int
RealAlgebraicNumber comparison.int
RealAlgebraicNumber comparison.copy()
Clone this.RealAlgebraicNumber decimal magnitude.RealAlgebraicNumber division.egcd
(RealAlgebraicNumber<C> S) RealAlgebraicNumber extended greatest common divisor.boolean
Comparison with any other object.factory()
Get the corresponding element factory.gcd
(RealAlgebraicNumber<C> S) RealAlgebraicNumber greatest common divisor.Return a BigRational approximation of this Element.int
hashCode()
Hash code for this RealAlgebraicNumber.inverse()
RealAlgebraicNumber inverse.boolean
isONE()
Is RealAlgebraicNumber one.boolean
Is RealAlgebraicNumber a root of unity.boolean
isUnit()
Is RealAlgebraicNumber unit.boolean
isZERO()
Is RealAlgebraicNumber zero.RealAlgebraicNumber magnitude.monic()
RealAlgebraicNumber monic.RealAlgebraicNumber multiplication.RealAlgebraicNumber multiplication.negate()
RealAlgebraicNumber negate.RealAlgebraicNumber remainder.int
signum()
RealAlgebraicNumber signum.RealAlgebraicNumber subtraction.sum
(RealAlgebraicNumber<C> S) RealAlgebraicNumber summation.RealAlgebraicNumber 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, quotientRemainder, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
-
Field Details
-
number
Representing recursive RealAlgebraicNumber. -
ring
Ring part of the data structure.
-
-
Constructor Details
-
RealAlgebraicNumber
The constructor creates a zero RealAlgebraicNumber.- Parameters:
r
- ring RealAlgebraicRing.
-
RealAlgebraicNumber
The constructor creates a RealAlgebraicNumber object from a GenPolynomial value.- Parameters:
r
- ring RealAlgebraicRing. a
- value element.
-
RealAlgebraicNumber
The constructor creates a RealAlgebraicNumber object from a GenPolynomial value.- Parameters:
r
- ring RealAlgebraicRing. a
- value GenPolynomial.
-
RealAlgebraicNumber
The constructor creates a RealAlgebraicNumber object from a recursive real algebraic value.- Parameters:
r
- ring RealAlgebraicRing. a
- recursive real algebraic number.
-
-
Method Details
-
factory
Get the corresponding element factory. -
copy
Clone this. -
getRational
Return a BigRational approximation of this Element.- Specified by:
getRational
in interfaceRational
- Returns:
- a BigRational approximation of this.
- See Also:
-
isZERO
public boolean isZERO()Is RealAlgebraicNumber 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 RealAlgebraicNumber 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 RealAlgebraicNumber 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 RealAlgebraicNumber 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
RealAlgebraicNumber comparison.- Specified by:
compareTo
in interfaceComparable<C extends GcdRingElem<C> & Rational>
- Specified by:
compareTo
in interfaceElement<C extends GcdRingElem<C> & Rational>
- Parameters:
b
- RealAlgebraicNumber.- Returns:
- sign(this-b).
-
compareTo
RealAlgebraicNumber comparison.- Parameters:
b
- AlgebraicNumber.- Returns:
- polynomial sign(this-b).
-
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this RealAlgebraicNumber. -
abs
RealAlgebraicNumber absolute value.- Specified by:
abs
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Returns:
- the absolute value of this.
- See Also:
-
sum
RealAlgebraicNumber summation.- Specified by:
sum
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- RealAlgebraicNumber.- Returns:
- this+S.
-
sum
RealAlgebraicNumber summation.- Parameters:
c
- recursive real algebraic number.- Returns:
- this+c.
-
negate
RealAlgebraicNumber negate.- Specified by:
negate
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Returns:
- -this.
- See Also:
-
subtract
RealAlgebraicNumber subtraction.- Specified by:
subtract
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- RealAlgebraicNumber.- Returns:
- this-S.
-
divide
RealAlgebraicNumber division.- Specified by:
divide
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- RealAlgebraicNumber.- Returns:
- this/S.
-
inverse
RealAlgebraicNumber 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
RealAlgebraicNumber remainder.- Specified by:
remainder
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- RealAlgebraicNumber.- Returns:
- this - (this/S)*S.
-
multiply
RealAlgebraicNumber multiplication.- Specified by:
multiply
in interfaceMonoidElem<C extends GcdRingElem<C> & Rational>
- Parameters:
S
- RealAlgebraicNumber.- Returns:
- this*S.
-
multiply
RealAlgebraicNumber multiplication.- Parameters:
c
- recursive real algebraic number.- Returns:
- this*c.
-
monic
RealAlgebraicNumber monic.- Returns:
- this with monic value part.
-
gcd
RealAlgebraicNumber greatest common divisor. -
egcd
RealAlgebraicNumber extended greatest common divisor. -
signum
public int signum()RealAlgebraicNumber signum.- Specified by:
signum
in interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>
- Returns:
- signum(this).
- See Also:
-
magnitude
RealAlgebraicNumber magnitude.- Returns:
- |this| as rational number.
-
decimalMagnitude
RealAlgebraicNumber decimal magnitude.- Returns:
- |this| as big decimal.
-