|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perisic.ring.Ring
com.perisic.ring.ModularRing
public class ModularRing
Implements a ring R/fR where R is an element of the ring R.
Currently only implemented for polynomial rings R. Might therefore be used for constructing algebraic extensions over fields.
Use the class ModularIntegerRing for constructing Z/mZ.
Field Summary |
---|
Fields inherited from class com.perisic.ring.Ring |
---|
C, F2, Q, R, Z |
Constructor Summary | |
---|---|
ModularRing(RingElt m)
Constructs m.getRing()/m * m.getRing(). |
Method Summary | |
---|---|
RingElt |
add(RingElt a,
RingElt b)
Addition. |
void |
displayMod()
Determins the behaviour of the eltToString() method. |
java.lang.String |
eltToString(RingElt a)
Returns a in the form "a" or "a mod f" depending on the value of hideMod. |
boolean |
equalZero(RingElt b)
true if b == 0, false otherwise. |
boolean |
getHideMod()
true if hideMod() has been called. |
RingElt |
getModulus()
Returns f if this is R/fR. |
RingElt |
getValue(RingElt b)
Returns the value of b as an element of R. |
void |
hideMod()
Determins the behaviour of the eltToString() method. |
RingElt |
inv(RingElt b)
Returns the inverse b. |
RingElt |
map(RingElt a)
If the ring of a is a quotient field we map
the quotient of numerator and denominator. |
RingElt |
map(java.lang.String str)
Maps str first into R, then into this. |
RingElt |
mult(RingElt a,
RingElt b)
Multiplication. |
RingElt |
neg(RingElt b)
Returns -b. |
RingElt |
one()
Returns 1. |
void |
setHideMod(boolean hideMod)
Determins the behaviour of the eltToString() method. |
RingElt |
zero()
Returns 0. |
Methods inherited from class com.perisic.ring.Ring |
---|
div, ediv, equal, evaluatePolynomial, gcd, isEuclidian, isField, isUFD, map, map, map, mod, pow, pow, sub, tdiv |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModularRing(RingElt m)
Method Detail |
---|
public void setHideMod(boolean hideMod)
public void hideMod()
public void displayMod()
public boolean getHideMod()
public RingElt getModulus()
public RingElt getValue(RingElt b)
public RingElt add(RingElt a, RingElt b)
add
in class Ring
public RingElt mult(RingElt a, RingElt b)
mult
in class Ring
public RingElt one()
one
in class Ring
public RingElt zero()
zero
in class Ring
public RingElt inv(RingElt b)
inv
in class Ring
RingException
- if gcd(b,f) != 1.public RingElt neg(RingElt b)
neg
in class Ring
public boolean equalZero(RingElt b)
equalZero
in class Ring
public RingElt map(java.lang.String str)
map
in class Ring
public RingElt map(RingElt a)
a
is a quotient field we map
the quotient of numerator and denominator.
Otherwise we
map a
first into R, then into this Ring.
If a.getRing().equals(this), a is also mapped.
map
in class Ring
public java.lang.String eltToString(RingElt a)
eltToString
in class Ring
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |