Class RealAlgebraicRing<C extends GcdRingElem<C> & Rational>
java.lang.Object
edu.jas.root.RealAlgebraicRing<C>
- All Implemented Interfaces:
AbelianGroupFactory<RealAlgebraicNumber<C>>, ElemFactory<RealAlgebraicNumber<C>>, MonoidFactory<RealAlgebraicNumber<C>>, RingFactory<RealAlgebraicNumber<C>>, Serializable
public class RealAlgebraicRing<C extends GcdRingElem<C> & Rational>
extends Object
implements RingFactory<RealAlgebraicNumber<C>>
Real algebraic number factory class based on AlgebraicNumberRing with
RingFactory interface. Objects of this class are immutable with the exception
of the isolating intervals.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AlgebraicNumberRing<C> Representing AlgebraicNumberRing.final RealRootsSturm<C> Real root computation engine.protected BigRationalPrecision of the isolating interval for a real root.static final intPrecision of the isolating rectangle for a complex root.Isolating interval for a real root. -
Constructor Summary
ConstructorsConstructorDescriptionRealAlgebraicRing(GenPolynomial<C> m, Interval<C> root) The constructor creates a RealAlgebraicNumber factory object from a GenPolynomial objects module.RealAlgebraicRing(GenPolynomial<C> m, Interval<C> root, boolean isField) The constructor creates a RealAlgebraicNumber factory object from a GenPolynomial objects module. -
Method Summary
Modifier and TypeMethodDescriptionCharacteristic of this ring.copy()Copy this RealAlgebraicRing.copy(RealAlgebraicNumber<C> c) Copy RealAlgebraicNumber element c.booleanComparison with any other object.fromInteger(long a) Get a RealAlgebraicNumber element from a long value.Get a RealAlgebraicNumber element from a BigInteger value.Get a RealAlgebraicNumber element from a BigRational value.Get a list of the generating elements.getEps()Get the epsilon.Get the generating element.getONE()Get the one element.getRoot()Get the interval for the real root.getZERO()Get the zero element.voidRealAlgebraicRing half interval.inthashCode()Hash code for this RealAlgebraicNumber.booleanQuery if this ring is associative.booleanQuery if this ring is commutative.booleanisField()Query if this ring is a field.booleanisFinite()Is this structure finite or infinite.Parse RealAlgebraicNumber from Reader.Parse RealAlgebraicNumber from String.random(int n) RealAlgebraicNumber random.RealAlgebraicNumber random.voidRefine root.voidRefine root.voidSet a new epsilon.voidSet a new epsilon.voidsetField(boolean isField) Assert that this ring is a field.voidSet a refined interval for the real root.toScript()Get a scripting compatible string representation.toString()Get the String representation as RingFactory.Methods inherited from interface ElemFactory
valueOf
-
Field Details
-
algebraic
Representing AlgebraicNumberRing. -
root
Interval<C extends GcdRingElem<C> & Rational> rootIsolating interval for a real root. Note: interval may shrink eventually. -
PRECISION
public static final int PRECISIONPrecision of the isolating rectangle for a complex root. -
eps
Precision of the isolating interval for a real root. -
engine
Real root computation engine.
-
-
Constructor Details
-
RealAlgebraicRing
The constructor creates a RealAlgebraicNumber factory object from a GenPolynomial objects module.- Parameters:
m- module GenPolynomial. root- isolating interval for a real root.
-
RealAlgebraicRing
The constructor creates a RealAlgebraicNumber factory object from a GenPolynomial objects module.- Parameters:
m- module GenPolynomial.root- isolating interval for a real root.isField- indicator if m is prime.
-
-
Method Details
-
getRoot
-
setRoot
-
getEps
-
setEps
-
setEps
-
refineRoot
public void refineRoot()Refine root. -
refineRoot
-
halfInterval
public void halfInterval()RealAlgebraicRing half interval. -
isFinite
public boolean isFinite()Is this structure finite or infinite.- Specified by:
isFinitein interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Returns:
- true if this structure is finite, else false.
- See Also:
-
copy
Copy RealAlgebraicNumber element c.- Specified by:
copyin interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Parameters:
c-- Returns:
- a copy of c.
-
copy
-
getZERO
Get the zero element.- Specified by:
getZEROin interfaceAbelianGroupFactory<C extends GcdRingElem<C> & Rational>- Returns:
- 0 as RealAlgebraicNumber.
-
getONE
Get the one element.- Specified by:
getONEin interfaceMonoidFactory<C extends GcdRingElem<C> & Rational>- Returns:
- 1 as RealAlgebraicNumber.
-
getGenerator
Get the generating element.- Returns:
- alpha as RealAlgebraicNumber.
-
generators
Get a list of the generating elements.- Specified by:
generatorsin interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Returns:
- list of generators for the algebraic structure.
- See Also:
-
isCommutative
public boolean isCommutative()Query if this ring is commutative.- Specified by:
isCommutativein interfaceMonoidFactory<C extends GcdRingElem<C> & Rational>- Returns:
- true if this ring is commutative, else false.
-
isAssociative
public boolean isAssociative()Query if this ring is associative.- Specified by:
isAssociativein interfaceMonoidFactory<C extends GcdRingElem<C> & Rational>- Returns:
- true if this ring is associative, else false.
-
isField
public boolean isField()Query if this ring is a field.- Specified by:
isFieldin interfaceRingFactory<C extends GcdRingElem<C> & Rational>- Returns:
- true if algebraic is prime, else false.
-
setField
public void setField(boolean isField) Assert that this ring is a field.- Parameters:
isField- true if this ring is a field, else false.
-
characteristic
Characteristic of this ring.- Specified by:
characteristicin interfaceRingFactory<C extends GcdRingElem<C> & Rational>- Returns:
- characteristic of this ring.
-
fromInteger
Get a RealAlgebraicNumber element from a BigInteger value.- Specified by:
fromIntegerin interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Parameters:
a- BigInteger.- Returns:
- a RealAlgebraicNumber.
-
fromRational
Get a RealAlgebraicNumber element from a BigRational value.- Parameters:
a- BigRational.- Returns:
- a RealAlgebraicNumber.
-
fromInteger
Get a RealAlgebraicNumber element from a long value.- Specified by:
fromIntegerin interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Parameters:
a- long.- Returns:
- a RealAlgebraicNumber.
-
toString
-
toScript
Get a scripting compatible string representation.- Specified by:
toScriptin interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
equals
-
hashCode
-
random
RealAlgebraicNumber random.- Specified by:
randomin interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Parameters:
n- such that 0 ≤ v ≤ (2n-1).- Returns:
- a random integer mod modul.
-
random
RealAlgebraicNumber random.- Specified by:
randomin interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Parameters:
n- such that 0 ≤ v ≤ (2n-1).rnd- is a source for random bits.- Returns:
- a random integer mod modul.
-
parse
Parse RealAlgebraicNumber from String.- Specified by:
parsein interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Parameters:
s- String.- Returns:
- RealAlgebraicNumber from s.
-
parse
Parse RealAlgebraicNumber from Reader.- Specified by:
parsein interfaceElemFactory<C extends GcdRingElem<C> & Rational>- Parameters:
r- Reader.- Returns:
- next RealAlgebraicNumber from r.
-