Package edu.jas.application
Class RealAlgebraicRing<C extends GcdRingElem<C> & Rational>
java.lang.Object
edu.jas.application.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 bi-variate real algebraic
numbers. Objects of this class are immutable with the exception of the
isolating intervals. Bi-variate ideal implementation is in version 3614
2011-04-28 09:20:34Z.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ResidueRing
<C> Representing ResidueRing.protected BigRational
Epsilon of the isolating rectangle for a complex root.private static final org.apache.logging.log4j.Logger
final int
Precision of the isolating rectangle for a complex root.final RealAlgebraicRing
<RealAlgebraicNumber<C>> Recursive real root ring.(package private) RealRootTuple
<C> Isolating intervals for the real algebraic roots of the real and imaginary part.(package private) final IdealWithUniv
<C> Representing ideal with univariate polynomials IdealWithUniv. -
Constructor Summary
ConstructorsConstructorDescriptionRealAlgebraicRing
(IdealWithUniv<C> m, ResidueRing<C> a, RealRootTuple<C> r) The constructor creates a RealAlgebraicNumber factory object from a IdealWithUniv, ResidueRing and a root tuple.RealAlgebraicRing
(IdealWithUniv<C> m, RealRootTuple<C> root) The constructor creates a RealAlgebraicNumber factory object from a IdealWithUniv and a root tuple.RealAlgebraicRing
(IdealWithUniv<C> m, RealRootTuple<C> root, boolean isField) The constructor creates a RealAlgebraicNumber factory object from a IdealWithUniv and a root tuple. -
Method Summary
Modifier and TypeMethodDescriptionCharacteristic of this ring.copy
(RealAlgebraicNumber<C> c) Copy RealAlgebraicNumber element c.boolean
Comparison 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 list of the generating elements.getEps()
Get epsilon.getONE()
Get the one element.getRoot()
Get rectangle for the complex root.getZERO()
Get the zero element.int
hashCode()
Hash code for this RealAlgebraicNumber.boolean
Query if this ring is associative.boolean
Query if this ring is commutative.boolean
isField()
Query if this ring is a field.boolean
isFinite()
Is this structure finite or infinite.Parse RealAlgebraicNumber from Reader.Parse RealAlgebraicNumber from String.random
(int n) RealAlgebraicNumber random.RealAlgebraicNumber random.void
Refine root.void
Set a new epsilon.void
Set a new epsilon.void
setField
(boolean isField) Assert that this ring is a field.void
setRoot
(RealRootTuple<C> v) Set a refined rectangle for the complex root.toScript()
Get a scripting compatible string representation.toString()
Get the String representation as RingFactory.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.jas.structure.ElemFactory
valueOf
-
Field Details
-
univs
Representing ideal with univariate polynomials IdealWithUniv. -
algebraic
Representing ResidueRing. -
root
RealRootTuple<C extends GcdRingElem<C> & Rational> rootIsolating intervals for the real algebraic roots of the real and imaginary part. Note: intervals may shrink eventually. -
realRing
Recursive real root ring. -
eps
Epsilon of the isolating rectangle for a complex root. -
PRECISION
public final int PRECISIONPrecision of the isolating rectangle for a complex root.- See Also:
-
logger
private static final org.apache.logging.log4j.Logger logger
-
-
Constructor Details
-
RealAlgebraicRing
The constructor creates a RealAlgebraicNumber factory object from a IdealWithUniv, ResidueRing and a root tuple.- Parameters:
m
- module IdealWithUniv<C>.a
- module ResidueRing<C>.r
- isolating rectangle for a complex root.
-
RealAlgebraicRing
The constructor creates a RealAlgebraicNumber factory object from a IdealWithUniv and a root tuple.- Parameters:
m
- module IdealWithUniv<C>.root
- isolating rectangle for a complex root.
-
RealAlgebraicRing
The constructor creates a RealAlgebraicNumber factory object from a IdealWithUniv and a root tuple.- Parameters:
m
- module IdealWithUniv<C>.root
- isolating rectangle for a complex root.isField
- indicator if m is maximal.
-
-
Method Details
-
setRoot
Set a refined rectangle for the complex root. Note: rectangle may shrink eventually.- Parameters:
v
- rectangle.
-
getRoot
Get rectangle for the complex root.- Returns:
- v rectangle.
-
getEps
Get epsilon.- Returns:
- epsilon.
-
setEps
Set a new epsilon.- Parameters:
e
- epsilon.
-
setEps
Set a new epsilon.- Parameters:
e
- epsilon.
-
refineRoot
Refine root.- Parameters:
e
- epsilon.
-
isFinite
public boolean isFinite()Is this structure finite or infinite.- Specified by:
isFinite
in interfaceElemFactory<C extends GcdRingElem<C> & Rational>
- Returns:
- true if this structure is finite, else false.
- See Also:
-
copy
Copy RealAlgebraicNumber element c.- Specified by:
copy
in interfaceElemFactory<C extends GcdRingElem<C> & Rational>
- Parameters:
c
-- Returns:
- a copy of c.
-
getZERO
Get the zero element.- Specified by:
getZERO
in interfaceAbelianGroupFactory<C extends GcdRingElem<C> & Rational>
- Returns:
- 0 as RealAlgebraicNumber.
-
getONE
Get the one element.- Specified by:
getONE
in interfaceMonoidFactory<C extends GcdRingElem<C> & Rational>
- Returns:
- 1 as RealAlgebraicNumber.
-
generators
Get a list of the generating elements.- Specified by:
generators
in 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:
isCommutative
in 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:
isAssociative
in 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:
isField
in 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:
characteristic
in interfaceRingFactory<C extends GcdRingElem<C> & Rational>
- Returns:
- characteristic of this ring.
-
fromInteger
Get a RealAlgebraicNumber element from a BigInteger value.- Specified by:
fromInteger
in interfaceElemFactory<C extends GcdRingElem<C> & Rational>
- Parameters:
a
- BigInteger.- Returns:
- a RealAlgebraicNumber.
-
fromInteger
Get a RealAlgebraicNumber element from a long value.- Specified by:
fromInteger
in interfaceElemFactory<C extends GcdRingElem<C> & Rational>
- Parameters:
a
- long.- Returns:
- a RealAlgebraicNumber.
-
toString
Get the String representation as RingFactory. -
toScript
Get a scripting compatible string representation.- Specified by:
toScript
in interfaceElemFactory<C extends GcdRingElem<C> & Rational>
- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this RealAlgebraicNumber. -
random
RealAlgebraicNumber random.- Specified by:
random
in 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:
random
in 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:
parse
in interfaceElemFactory<C extends GcdRingElem<C> & Rational>
- Parameters:
s
- String.- Returns:
- RealAlgebraicNumber from s.
-
parse
Parse RealAlgebraicNumber from Reader.- Specified by:
parse
in interfaceElemFactory<C extends GcdRingElem<C> & Rational>
- Parameters:
r
- Reader.- Returns:
- next RealAlgebraicNumber from r.
-