|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.jas.arith.ModIntegerRing
public final class ModIntegerRing
ModIntegerRing factory with RingFactory interface. Effectively immutable.
Field Summary | |
---|---|
protected int |
certainty
Certainty if module is probable prime. |
protected int |
isField
Indicator if this ring is a field. |
java.math.BigInteger |
modul
Module part of the factory data structure. |
Constructor Summary | |
---|---|
ModIntegerRing(java.math.BigInteger m)
The constructor creates a ModIntegerRing object from a BigInteger object as module part. |
|
ModIntegerRing(java.math.BigInteger m,
boolean isField)
The constructor creates a ModIntegerRing object from a BigInteger object as module part. |
|
ModIntegerRing(long m)
The constructor creates a ModIntegerRing object from a long as module part. |
|
ModIntegerRing(long m,
boolean isField)
The constructor creates a ModIntegerRing object from a long as module part. |
|
ModIntegerRing(java.lang.String m)
The constructor creates a ModIntegerRing object from a String object as module part. |
|
ModIntegerRing(java.lang.String m,
boolean isField)
The constructor creates a ModIntegerRing object from a String object as module part. |
Method Summary | |
---|---|
java.math.BigInteger |
characteristic()
Characteristic of this ring. |
ModInteger |
chineseRemainder(ModInteger c,
ModInteger ci,
ModInteger a)
ModInteger chinese remainder algorithm. |
ModInteger |
copy(ModInteger c)
Copy ModInteger element c. |
boolean |
equals(java.lang.Object b)
Comparison with any other object. |
ModInteger |
fromInteger(java.math.BigInteger a)
Get a ModInteger element from a BigInteger value. |
ModInteger |
fromInteger(long a)
Get a ModInteger element from a long value. |
java.math.BigInteger |
getModul()
Get the module part. |
ModInteger |
getONE()
Get the one element. |
ModInteger |
getZERO()
Get the zero element. |
int |
hashCode()
Hash code for this ModIntegerRing. |
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. |
ModInteger |
parse(java.io.Reader r)
Parse ModInteger from Reader. |
ModInteger |
parse(java.lang.String s)
Parse ModInteger from String. |
ModInteger |
random(int n)
ModInteger random. |
ModInteger |
random(int n,
java.util.Random rnd)
ModInteger random. |
java.lang.String |
toString()
Get the String representation. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.math.BigInteger modul
protected int isField
protected int certainty
Constructor Detail |
---|
public ModIntegerRing(java.math.BigInteger m)
m
- math.BigInteger.public ModIntegerRing(java.math.BigInteger m, boolean isField)
m
- math.BigInteger.isField
- indicator if m is prime.public ModIntegerRing(long m)
m
- long.public ModIntegerRing(long m, boolean isField)
m
- long.isField
- indicator if m is prime.public ModIntegerRing(java.lang.String m)
m
- String.public ModIntegerRing(java.lang.String m, boolean isField)
m
- String.isField
- indicator if m is prime.Method Detail |
---|
public java.math.BigInteger getModul()
public ModInteger copy(ModInteger c)
copy
in interface ElemFactory<ModInteger>
c
-
public ModInteger getZERO()
getZERO
in interface AbelianGroupFactory<ModInteger>
public ModInteger getONE()
getONE
in interface MonoidFactory<ModInteger>
public boolean isCommutative()
isCommutative
in interface MonoidFactory<ModInteger>
public boolean isAssociative()
isAssociative
in interface MonoidFactory<ModInteger>
public boolean isField()
isField
in interface RingFactory<ModInteger>
public java.math.BigInteger characteristic()
characteristic
in interface RingFactory<ModInteger>
public ModInteger fromInteger(java.math.BigInteger a)
fromInteger
in interface ElemFactory<ModInteger>
a
- BigInteger.
public ModInteger fromInteger(long a)
fromInteger
in interface ElemFactory<ModInteger>
a
- long.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
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 ModInteger random(int n)
random
in interface ElemFactory<ModInteger>
n
- such that 0 ≤ v ≤ (2n-1).
public ModInteger random(int n, java.util.Random rnd)
random
in interface ElemFactory<ModInteger>
n
- such that 0 ≤ v ≤ (2n-1).rnd
- is a source for random bits.
public ModInteger parse(java.lang.String s)
parse
in interface ElemFactory<ModInteger>
s
- String.
public ModInteger parse(java.io.Reader r)
parse
in interface ElemFactory<ModInteger>
r
- Reader.
public ModInteger chineseRemainder(ModInteger c, ModInteger ci, ModInteger a)
c
- ModInteger.ci
- inverse of c.modul in ring of a.a
- other ModInteger.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |