|
|||||||||
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. |
ModInteger |
create(java.math.BigInteger c)
Create ModInteger element c. |
ModInteger |
create(long c)
Create ModInteger element c. |
ModInteger |
create(java.lang.String c)
Create 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.util.List<ModInteger> |
generators()
Get a list of the generating elements. |
BigInteger |
getIntegerModul()
Get the module part as BigInteger. |
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. |
boolean |
isFinite()
Is this structure finite or infinite. |
java.util.Iterator<ModInteger> |
iterator()
Get a ModInteger iterator. |
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 |
toScript()
Get a scripting compatible string representation. |
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 BigInteger getIntegerModul()
getIntegerModul
in interface ModularRingFactory<ModInteger>
public ModInteger create(java.math.BigInteger c)
c
-
public ModInteger create(long c)
c
-
public ModInteger create(java.lang.String c)
c
-
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 java.util.List<ModInteger> generators()
generators
in interface ElemFactory<ModInteger>
ElemFactory.generators()
public boolean isFinite()
isFinite
in interface ElemFactory<ModInteger>
ElemFactory.isFinite()
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 java.lang.String toScript()
toScript
in interface ElemFactory<ModInteger>
ElemFactory.toScript()
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)
chineseRemainder
in interface ModularRingFactory<ModInteger>
c
- ModInteger.ci
- inverse of c.modul in ring of a.a
- other ModInteger.
public java.util.Iterator<ModInteger> iterator()
iterator
in interface java.lang.Iterable<ModInteger>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |