public final class ModLongRing extends java.lang.Object implements ModularRingFactory<ModLong>, java.lang.Iterable<ModLong>
Modifier and Type | Field and Description |
---|---|
static java.math.BigInteger |
MAX_LONG
maximal representable integer.
|
long |
modul
Module part of the factory data structure.
|
Constructor and Description |
---|
ModLongRing(java.math.BigInteger m)
The constructor creates a ModLongRing object from a BigInteger converted
to long as module part.
|
ModLongRing(java.math.BigInteger m,
boolean isField)
The constructor creates a ModLongRing object from a BigInteger converted
to long as module part.
|
ModLongRing(long m)
The constructor creates a ModLongRing object from a long integer as
module part.
|
ModLongRing(java.lang.Long m)
The constructor creates a ModLongRing object from a Long integer as
module part.
|
ModLongRing(long m,
boolean isField)
The constructor creates a ModLongRing object from a long integer as
module part.
|
ModLongRing(java.lang.Long m,
boolean isField)
The constructor creates a ModLongRing object from a Long integer as
module part.
|
ModLongRing(java.lang.String m)
The constructor creates a ModLongRing object from a String object as
module part.
|
ModLongRing(java.lang.String m,
boolean isField)
The constructor creates a ModLongRing object from a String object as
module part.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
characteristic()
Characteristic of this ring.
|
static java.util.List<ModLong> |
chineseRemainder(ModLong m1,
ModLong m2,
java.util.List<ModLong> L1,
java.util.List<ModLong> L2)
Modular digit list chinese remainder algorithm. m1 and m2 are positive
beta-integers, with GCD(m1,m2)=1 and m=m1*m2 less than beta.
|
ModLong |
chineseRemainder(ModLong c,
ModLong ci,
ModLong a)
ModLong chinese remainder algorithm.
|
ModLong |
copy(ModLong c)
Copy ModLong element c.
|
ModLong |
create(java.math.BigInteger c)
Create ModLong element c.
|
ModLong |
create(long c)
Create ModLong element c.
|
ModLong |
create(java.lang.String c)
Create ModLong element c.
|
boolean |
equals(java.lang.Object b)
Comparison with any other object.
|
ModLong |
fromInteger(java.math.BigInteger a)
Get a ModLong element from a BigInteger value.
|
ModLong |
fromInteger(long a)
Get a ModLong element from a long value.
|
java.util.List<ModLong> |
generators()
Get a list of the generating elements.
|
BigInteger |
getIntegerModul()
Get the module part as BigInteger.
|
long |
getLongModul()
Get the module part as long.
|
java.math.BigInteger |
getModul()
Get the module part as BigInteger.
|
ModLong |
getONE()
Get the one element.
|
ModLong |
getZERO()
Get the zero element.
|
int |
hashCode()
Hash code for this ModLongRing.
|
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<ModLong> |
iterator()
Get a ModLong iterator.
|
ModLong |
parse(java.io.Reader r)
Parse ModLong from Reader.
|
ModLong |
parse(java.lang.String s)
Parse ModLong from String.
|
ModLong |
random(int n)
ModLong random.
|
ModLong |
random(int n,
java.util.Random rnd)
ModLong random.
|
java.lang.String |
toScript()
Get a scripting compatible string representation.
|
java.lang.String |
toString()
Get the String representation.
|
public final long modul
public static final java.math.BigInteger MAX_LONG
public ModLongRing(long m)
m
- long integer.public ModLongRing(long m, boolean isField)
m
- long integer.isField
- indicator if m is prime.public ModLongRing(java.lang.Long m)
m
- Long integer.public ModLongRing(java.lang.Long m, boolean isField)
m
- Long integer.isField
- indicator if m is prime.public ModLongRing(java.math.BigInteger m)
m
- java.math.BigInteger.public ModLongRing(java.math.BigInteger m, boolean isField)
m
- java.math.BigInteger.isField
- indicator if m is prime.public ModLongRing(java.lang.String m)
m
- String.public ModLongRing(java.lang.String m, boolean isField)
m
- String.isField
- indicator if m is prime.public java.math.BigInteger getModul()
public long getLongModul()
public BigInteger getIntegerModul()
getIntegerModul
in interface ModularRingFactory<ModLong>
public ModLong create(java.math.BigInteger c)
c
- public ModLong create(long c)
c
- public ModLong create(java.lang.String c)
c
- public ModLong copy(ModLong c)
copy
in interface ElemFactory<ModLong>
c
- public ModLong getZERO()
getZERO
in interface AbelianGroupFactory<ModLong>
public ModLong getONE()
getONE
in interface MonoidFactory<ModLong>
public java.util.List<ModLong> generators()
generators
in interface ElemFactory<ModLong>
ElemFactory.generators()
public boolean isFinite()
isFinite
in interface ElemFactory<ModLong>
ElemFactory.isFinite()
public boolean isCommutative()
isCommutative
in interface MonoidFactory<ModLong>
public boolean isAssociative()
isAssociative
in interface MonoidFactory<ModLong>
public boolean isField()
isField
in interface RingFactory<ModLong>
public java.math.BigInteger characteristic()
characteristic
in interface RingFactory<ModLong>
public ModLong fromInteger(java.math.BigInteger a)
fromInteger
in interface ElemFactory<ModLong>
a
- BigInteger.public ModLong fromInteger(long a)
fromInteger
in interface ElemFactory<ModLong>
a
- long.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toScript()
toScript
in interface ElemFactory<ModLong>
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 ModLong random(int n)
random
in interface ElemFactory<ModLong>
n
- such that 0 ≤ v ≤ (2n-1).public ModLong random(int n, java.util.Random rnd)
random
in interface ElemFactory<ModLong>
n
- such that 0 ≤ v ≤ (2n-1).rnd
- is a source for random bits.public ModLong parse(java.lang.String s)
parse
in interface ElemFactory<ModLong>
s
- String.public ModLong parse(java.io.Reader r)
parse
in interface ElemFactory<ModLong>
r
- Reader.public ModLong chineseRemainder(ModLong c, ModLong ci, ModLong a)
chineseRemainder
in interface ModularRingFactory<ModLong>
c
- ModLong.ci
- inverse of c.modul in ring of a.a
- other ModLong.public static java.util.List<ModLong> chineseRemainder(ModLong m1, ModLong m2, java.util.List<ModLong> L1, java.util.List<ModLong> L2)
m1
- ModLong.m2
- other ModLong.