|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perisic.ring.Ring
public abstract class Ring
Title: Ring
Description: An abstract Ring class.
This class is the base class for all rings and fields of the package. The following methods are abstract and have to be overridden by all child rings (a child ring is a child class of this class which implements a ring in the meaning of a ring in algebra): add(), mult(), zero(), neg() and equalZero().
The following methods are semi abstract, that means they throw an error message if they are called. If applicable for the ring, they have to be overridden: one() and inv().
Rings which are not a field might override the methods ediv(), mod() and tdiv() if applicable.
See the documentation below for details.
Field Summary | |
---|---|
static ModularRing |
C
The field C of complex numbers. |
static F2Field |
F2
The field F2 of integers modulo 2. |
static RationalField |
Q
The field Q of fractions. |
static DoubleField |
R
The field R of real numbers. |
static IntegerRing |
Z
The ring Z of integers. |
Constructor Summary | |
---|---|
Ring()
|
Method Summary | |
---|---|
abstract RingElt |
add(RingElt a,
RingElt b)
The addition a + b of two ring elements a and b. |
RingElt |
div(RingElt a,
RingElt b)
Computes a/b. |
RingElt |
ediv(RingElt a,
RingElt b)
Returns a div b (euclidian division). |
java.lang.String |
eltToString(RingElt a)
Returns the Ring element a as a String. |
boolean |
equal(RingElt a,
RingElt b)
True if a == b. |
abstract boolean |
equalZero(RingElt a)
Returns true if a == 0. |
RingElt |
evaluatePolynomial(RingElt p,
RingElt b)
Evaluates the Polynomial p at b. |
RingElt |
gcd(RingElt a,
RingElt b)
Returns gcd(a,b). |
RingElt |
inv(RingElt b)
Returns b^-1. |
boolean |
isEuclidian()
Is the ring Euclidian? By default false. |
boolean |
isField()
Is the ring a field? By default false. |
boolean |
isUFD()
Is the ring a UFD (unique factorization domain)? By default false. |
RingElt |
map(java.math.BigInteger a)
Maps a into the Ring. |
RingElt |
map(int a)
Maps a into the Ring. |
RingElt |
map(java.lang.Object a)
By default, maps a into the Ring using appropriate methods if a is a RingElt, a BigInteger or a String. |
RingElt |
map(RingElt a)
Maps a into the Ring. |
RingElt |
map(java.lang.String str)
Maps a String into the Ring. |
RingElt |
mod(RingElt a,
RingElt m)
Returns a % m (euclidian division, a modulo m). |
abstract RingElt |
mult(RingElt a,
RingElt b)
The mutiplicaton a * b of two ring elements a and b. |
abstract RingElt |
neg(RingElt a)
Returns the additive inverse -a of an ring element a. |
RingElt |
one()
Returns the 1 of the ring. |
RingElt |
pow(RingElt b,
java.math.BigInteger a)
Returns b^a. |
RingElt |
pow(RingElt b,
int a)
Returns b^a. |
RingElt |
sub(RingElt a,
RingElt b)
Returns a - b. |
RingElt |
tdiv(RingElt a,
RingElt b)
Computes a/b (true division). |
abstract RingElt |
zero()
Returns the 0 of the ring. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ModularRing C
public static final IntegerRing Z
public static final RationalField Q
public static final DoubleField R
public static final F2Field F2
Constructor Detail |
---|
public Ring()
Method Detail |
---|
public abstract RingElt add(RingElt a, RingElt b)
public abstract RingElt mult(RingElt a, RingElt b)
public abstract RingElt zero()
public abstract RingElt neg(RingElt a)
public abstract boolean equalZero(RingElt a)
public RingElt one() throws RingException
RingException
public RingElt inv(RingElt b) throws RingException
Note for implementing a child class of Ring: Must be overridden for fields. Might be overridden in other child rings if applicable.
RingException
public RingElt sub(RingElt a, RingElt b)
public boolean equal(RingElt a, RingElt b)
public RingElt div(RingElt a, RingElt b)
public RingElt tdiv(RingElt a, RingElt b)
public RingElt ediv(RingElt a, RingElt b) throws RingException
Note for implementing a child class of Ring: Euclidian child rings must override this method.
RingException
public RingElt mod(RingElt a, RingElt m) throws RingException
Note for implementing a child class of Ring: Euclidian child rings must override this method.
RingException
public RingElt gcd(RingElt a, RingElt b) throws RingException
RingException
public boolean isField()
Note for implementing a child class of Ring: Must be overridden in a field.
public boolean isEuclidian()
Note for implementing a child class of Ring: Must be overridden in an Euclidian ring which is not a field.
public boolean isUFD()
Note for implementing a child class of Ring: Must be overridden in an UFD which is not euclidian.
public RingElt map(int a)
public RingElt map(java.math.BigInteger a)
public RingElt map(RingElt a)
In addition identical mapping, if the Ring of a is this ring, is supported.
Note: For each ring R with one there is a canonical map Z -> R, which maps a into 1 + 1 + ... + 1 (a times) and a canonical map Q-> R which maps a = r/s into R if the division is well defined in R for these values of r and s.
public RingElt map(java.lang.String str)
public RingElt map(java.lang.Object a)
public RingElt pow(RingElt b, int a)
public RingElt pow(RingElt b, java.math.BigInteger a)
public java.lang.String eltToString(RingElt a)
public RingElt evaluatePolynomial(RingElt p, RingElt b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |