|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.perisic.ring.Ring com.perisic.ring.ModularIntegerRing
public class ModularIntegerRing
The modular integer ring Z/nZ. This ring uses the BigInteger arithmetic of the java.math.* package and is therefore more efficient then a construction via the ModularRing class of this package
Field Summary |
---|
Fields inherited from class com.perisic.ring.Ring |
---|
C, F2, Q, R, Z |
Constructor Summary | |
---|---|
ModularIntegerRing(int m)
|
|
ModularIntegerRing(java.lang.Object modulus)
Construction of Z/mZ with m = modulus. |
Method Summary | |
---|---|
RingElt |
add(RingElt a,
RingElt b)
Returns a + b mod m. |
boolean |
equals(java.lang.Object ob)
Two ModularIntegerRing objects are equal, if the modulus is the same. |
boolean |
equalZero(RingElt b)
True if b == 0, false otherwise. |
java.math.BigInteger |
getModulus()
Returns m where this ModularIntegerRing is Z/mZ. |
RingElt |
inv(RingElt b)
Returns b^-1 mod m. |
RingElt |
map(RingElt a)
Performs the ususal map as in Ring.map(RingElt). |
RingElt |
mult(RingElt a,
RingElt b)
Returns a * b mod m. |
RingElt |
neg(RingElt b)
Returns -b mod m. |
RingElt |
one()
Returns 1. |
RingElt |
tdiv(RingElt a,
RingElt b)
The same as div(a,b). |
static java.math.BigInteger |
toBigInteger(RingElt b)
Returns the BigInteger value of b. |
RingElt |
zero()
Returns 0. |
Methods inherited from class com.perisic.ring.Ring |
---|
div, ediv, eltToString, equal, evaluatePolynomial, gcd, isEuclidian, isField, isUFD, map, map, map, map, mod, pow, pow, sub |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModularIntegerRing(java.lang.Object modulus)
modulus
- An instance of a BigInteger or a RingElt which can be mapped
to Ring.Z.public ModularIntegerRing(int m)
Method Detail |
---|
public java.math.BigInteger getModulus()
public static java.math.BigInteger toBigInteger(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
java.lang.ArithmeticException
- if b is not an unit mod m.public RingElt tdiv(RingElt a, RingElt b)
tdiv
in class Ring
java.lang.ArithmeticException
- if b is not a unit mod m.public RingElt neg(RingElt b)
neg
in class Ring
public boolean equalZero(RingElt b)
equalZero
in class Ring
public boolean equals(java.lang.Object ob)
equals
in class java.lang.Object
public RingElt map(RingElt a)
map
in class Ring
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |