|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.lsmp.djep.groupJep.groups.Group org.lsmp.djep.groupJep.groups.Zn
public class Zn
The group of integers mod n. For prime values of n this is a field, with some nice division tables. i.e. for Z5
* | 1 2 3 4 ------------ 1 | 1 2 3 4 2 | 2 4 1 3 3 | 3 1 4 2 4 | 4 3 2 1
/ | 1 2 3 4 ------------ 1 | 1 2 3 4 2 | 3 1 4 2 3 | 2 4 1 3 4 | 4 3 2 1
Constructor Summary | |
---|---|
Zn(java.math.BigInteger modulus)
|
Method Summary | |
---|---|
java.lang.Number |
add(java.lang.Number num1,
java.lang.Number num2)
Get sum of the numbers |
int |
compare(java.lang.Number a,
java.lang.Number b)
Returns -1,0,1 depending on whether a is less than, equal to or greater than b. |
java.lang.Number |
div(java.lang.Number num1,
java.lang.Number num2)
get division of two numbers. i.e. a * ( b^-1). |
boolean |
equals(java.lang.Number a,
java.lang.Number b)
whether two numbers are equal |
java.lang.Number |
getInverse(java.lang.Number num)
Get Inverse of a number |
java.lang.Number |
getMulInverse(java.lang.Number num)
get mul inverse |
java.lang.Number |
getONE()
Get multiplicative identity i.e. 1. |
java.lang.Number |
getZERO()
Returns the identity element under + |
java.lang.Number |
mod(java.lang.Number num1,
java.lang.Number num2)
|
java.lang.Number |
mul(java.lang.Number num1,
java.lang.Number num2)
Returns the product of two numbers, a*b |
java.lang.Number |
pow(java.lang.Number num1,
java.lang.Number num2)
|
java.lang.Number |
sub(java.lang.Number num1,
java.lang.Number num2)
Get the difference of the numbers. |
java.lang.String |
toString()
|
java.lang.Number |
valueOf(java.lang.String str)
returns number given by the string |
Methods inherited from class org.lsmp.djep.groupJep.groups.Group |
---|
addStandardConstants, addStandardFunctions, getNumberFactory, isConstantPoly |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.lsmp.djep.groupJep.GroupI |
---|
addStandardConstants, addStandardFunctions, getNumberFactory, isConstantPoly |
Constructor Detail |
---|
public Zn(java.math.BigInteger modulus)
Method Detail |
---|
public java.lang.Number getZERO()
GroupI
getZERO
in interface GroupI
public java.lang.Number getONE()
RingI
getONE
in interface RingI
public java.lang.Number getInverse(java.lang.Number num)
GroupI
getInverse
in interface GroupI
public java.lang.Number getMulInverse(java.lang.Number num)
FieldI
getMulInverse
in interface FieldI
public java.lang.Number add(java.lang.Number num1, java.lang.Number num2)
GroupI
add
in interface GroupI
public java.lang.Number sub(java.lang.Number num1, java.lang.Number num2)
GroupI
sub
in interface GroupI
public java.lang.Number mul(java.lang.Number num1, java.lang.Number num2)
RingI
mul
in interface RingI
public java.lang.Number div(java.lang.Number num1, java.lang.Number num2)
HasDivI
div
in interface HasDivI
public java.lang.Number mod(java.lang.Number num1, java.lang.Number num2)
mod
in interface HasModI
public java.lang.Number pow(java.lang.Number num1, java.lang.Number num2)
pow
in interface HasPowerI
public boolean equals(java.lang.Number a, java.lang.Number b)
GroupI
equals
in interface GroupI
public int compare(java.lang.Number a, java.lang.Number b)
OrderedSetI
compare
in interface OrderedSetI
public java.lang.Number valueOf(java.lang.String str)
GroupI
valueOf
in interface GroupI
public java.lang.String toString()
toString
in class Group
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |