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.intRealAlgebraicNumber comparison.intRealAlgebraicNumber comparison.copy()Clone this.RealAlgebraicNumber decimal magnitude.RealAlgebraicNumber division.egcd(RealAlgebraicNumber<C> S) RealAlgebraicNumber extended greatest common divisor.booleanComparison 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.inthashCode()Hash code for this RealAlgebraicNumber.inverse()RealAlgebraicNumber inverse.booleanisONE()Is RealAlgebraicNumber one.booleanIs RealAlgebraicNumber a root of unity.booleanisUnit()Is RealAlgebraicNumber unit.booleanisZERO()Is RealAlgebraicNumber zero.RealAlgebraicNumber magnitude.monic()RealAlgebraicNumber monic.RealAlgebraicNumber multiplication.RealAlgebraicNumber multiplication.negate()RealAlgebraicNumber negate.RealAlgebraicNumber remainder.intsignum()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, waitMethods 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:
getRationalin interfaceRational- Returns:
- a BigRational approximation of this.
- See Also:
-
isZERO
public boolean isZERO()Is RealAlgebraicNumber zero.- Specified by:
isZEROin 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:
isONEin 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:
isUnitin 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:
toScriptFactoryin interfaceElement<C extends GcdRingElem<C> & Rational>- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
compareTo
RealAlgebraicNumber comparison.- Specified by:
compareToin interfaceComparable<C extends GcdRingElem<C> & Rational>- Specified by:
compareToin 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:
absin interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>- Returns:
- the absolute value of this.
- See Also:
-
sum
RealAlgebraicNumber summation.- Specified by:
sumin 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:
negatein interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>- Returns:
- -this.
- See Also:
-
subtract
RealAlgebraicNumber subtraction.- Specified by:
subtractin interfaceAbelianGroupElem<C extends GcdRingElem<C> & Rational>- Parameters:
S- RealAlgebraicNumber.- Returns:
- this-S.
-
divide
RealAlgebraicNumber division.- Specified by:
dividein interfaceMonoidElem<C extends GcdRingElem<C> & Rational>- Parameters:
S- RealAlgebraicNumber.- Returns:
- this/S.
-
inverse
RealAlgebraicNumber inverse.- Specified by:
inversein 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:
remainderin interfaceMonoidElem<C extends GcdRingElem<C> & Rational>- Parameters:
S- RealAlgebraicNumber.- Returns:
- this - (this/S)*S.
-
multiply
RealAlgebraicNumber multiplication.- Specified by:
multiplyin 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:
signumin 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.
-