public class RealAlgebraicRing<C extends GcdRingElem<C> & Rational> extends java.lang.Object implements RingFactory<RealAlgebraicNumber<C>>
Modifier and Type | Field and Description |
---|---|
AlgebraicNumberRing<C> |
algebraic
Representing AlgebraicNumberRing.
|
RealRootsSturm<C> |
engine
Real root computation engine.
|
protected BigRational |
eps
Precision of the isolating interval for a real root.
|
static int |
PRECISION
Precision of the isolating rectangle for a complex root.
|
Constructor and Description |
---|
RealAlgebraicRing(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.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
characteristic()
Characteristic of this ring.
|
RealAlgebraicRing<C> |
copy()
Copy this RealAlgebraicRing.
|
RealAlgebraicNumber<C> |
copy(RealAlgebraicNumber<C> c)
Copy RealAlgebraicNumber element c.
|
boolean |
equals(java.lang.Object b)
Comparison with any other object.
|
RealAlgebraicNumber<C> |
fromInteger(java.math.BigInteger a)
Get a RealAlgebraicNumber element from a BigInteger value.
|
RealAlgebraicNumber<C> |
fromInteger(long a)
Get a RealAlgebraicNumber element from a long value.
|
java.util.List<RealAlgebraicNumber<C>> |
generators()
Get a list of the generating elements.
|
BigRational |
getEps()
Get the epsilon.
|
RealAlgebraicNumber<C> |
getGenerator()
Get the generating element.
|
RealAlgebraicNumber<C> |
getONE()
Get the one element.
|
Interval<C> |
getRoot()
Get the interval for the real root.
|
RealAlgebraicNumber<C> |
getZERO()
Get the zero element.
|
void |
halfInterval()
RealAlgebraicRing half interval.
|
int |
hashCode()
Hash code for this RealAlgebraicNumber.
|
boolean |
isAssociative()
Query if this ring is associative.
|
boolean |
isCommutative()
Query if this ring is commutative.
|
boolean |
isField()
Query if this ring is a field.
|
boolean |
isFinite()
Is this structure finite or infinite.
|
RealAlgebraicNumber<C> |
parse(java.io.Reader r)
Parse RealAlgebraicNumber from Reader.
|
RealAlgebraicNumber<C> |
parse(java.lang.String s)
Parse RealAlgebraicNumber from String.
|
RealAlgebraicNumber<C> |
random(int n)
RealAlgebraicNumber random.
|
RealAlgebraicNumber<C> |
random(int n,
java.util.Random rnd)
RealAlgebraicNumber random.
|
void |
refineRoot()
Refine root.
|
void |
refineRoot(BigRational e)
Refine root.
|
void |
setEps(BigRational e)
Set a new epsilon.
|
void |
setEps(C e)
Set a new epsilon.
|
void |
setField(boolean isField)
Assert that this ring is a field.
|
void |
setRoot(Interval<C> v)
Set a refined interval for the real root.
|
java.lang.String |
toScript()
Get a scripting compatible string representation.
|
java.lang.String |
toString()
Get the String representation as RingFactory.
|
public final AlgebraicNumberRing<C extends GcdRingElem<C> & Rational> algebraic
public static final int PRECISION
protected BigRational eps
public final RealRootsSturm<C extends GcdRingElem<C> & Rational> engine
public RealAlgebraicRing(GenPolynomial<C> m, Interval<C> root)
m
- module GenPolynomialroot
- isolating interval for a real root.public RealAlgebraicRing(GenPolynomial<C> m, Interval<C> root, boolean isField)
m
- module GenPolynomial.root
- isolating interval for a real root.isField
- indicator if m is prime.public Interval<C> getRoot()
public void setRoot(Interval<C> v)
v
- interval.public BigRational getEps()
public void setEps(BigRational e)
e
- epsilon.public void refineRoot()
public void refineRoot(BigRational e)
e
- epsilon.public void halfInterval()
public boolean isFinite()
isFinite
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
ElemFactory.isFinite()
public RealAlgebraicNumber<C> copy(RealAlgebraicNumber<C> c)
copy
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
c
- public RealAlgebraicRing<C> copy()
public RealAlgebraicNumber<C> getZERO()
getZERO
in interface AbelianGroupFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
public RealAlgebraicNumber<C> getONE()
getONE
in interface MonoidFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
public RealAlgebraicNumber<C> getGenerator()
public java.util.List<RealAlgebraicNumber<C>> generators()
generators
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
ElemFactory.generators()
public boolean isCommutative()
isCommutative
in interface MonoidFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
public boolean isAssociative()
isAssociative
in interface MonoidFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
public boolean isField()
isField
in interface RingFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
public void setField(boolean isField)
isField
- true if this ring is a field, else false.public java.math.BigInteger characteristic()
characteristic
in interface RingFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
public RealAlgebraicNumber<C> fromInteger(java.math.BigInteger a)
fromInteger
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
a
- BigInteger.public RealAlgebraicNumber<C> fromInteger(long a)
fromInteger
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
a
- long.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toScript()
toScript
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
ElemFactory.toScript()
public boolean equals(java.lang.Object b)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public RealAlgebraicNumber<C> random(int n)
random
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
n
- such that 0 ≤ v ≤ (2n-1).public RealAlgebraicNumber<C> random(int n, java.util.Random rnd)
random
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
n
- such that 0 ≤ v ≤ (2n-1).rnd
- is a source for random bits.public RealAlgebraicNumber<C> parse(java.lang.String s)
parse
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
s
- String.public RealAlgebraicNumber<C> parse(java.io.Reader r)
parse
in interface ElemFactory<RealAlgebraicNumber<C extends GcdRingElem<C> & Rational>>
r
- Reader.