public final class ModInteger extends java.lang.Object implements GcdRingElem<ModInteger>, Modular
BigInteger
,
Serialized FormModifier and Type | Field and Description |
---|---|
ModIntegerRing |
ring
ModIntegerRing reference.
|
java.math.BigInteger |
val
Value part of the element data structure.
|
Constructor and Description |
---|
ModInteger(ModIntegerRing m)
The constructor creates a 0 ModInteger object from a given
ModIntegerRing.
|
ModInteger(ModIntegerRing m,
java.math.BigInteger a)
The constructor creates a ModInteger object from a ModIntegerRing and a
value part.
|
ModInteger(ModIntegerRing m,
long a)
The constructor creates a ModInteger object from a ModIntegerRing and a
long value part.
|
ModInteger(ModIntegerRing m,
java.lang.String s)
The constructor creates a ModInteger object from a ModIntegerRing and a
String value part.
|
Modifier and Type | Method and Description |
---|---|
ModInteger |
abs()
ModInteger absolute value.
|
long |
bitLength()
Returns the number of bits in the representation of this ModInteger,
including a sign bit.
|
int |
compareTo(ModInteger b)
ModInteger comparison.
|
ModInteger |
copy()
Clone this.
|
ModInteger |
divide(ModInteger S)
ModInteger divide.
|
ModInteger[] |
egcd(ModInteger S)
ModInteger extended greatest common divisor.
|
boolean |
equals(java.lang.Object b)
Comparison with any other object.
|
ModIntegerRing |
factory()
Get the corresponding element factory.
|
ModInteger |
gcd(ModInteger S)
ModInteger greatest common divisor.
|
BigInteger |
getInteger()
Return a BigInteger from this Element.
|
java.math.BigInteger |
getModul()
Get the module part.
|
BigInteger |
getSymmetricInteger()
Return a symmetric BigInteger from this Element.
|
java.math.BigInteger |
getSymmetricVal()
Get the symmetric value part.
|
java.math.BigInteger |
getVal()
Get the value part.
|
int |
hashCode()
Hash code for this ModInteger.
|
ModInteger[] |
hegcd(ModInteger S)
ModInteger half extended greatest common divisor.
|
ModInteger |
inverse()
ModInteger inverse.
|
boolean |
isONE()
Is ModInteger number one.
|
boolean |
isUnit()
Is ModInteger number a unit.
|
boolean |
isZERO()
Is ModInteger number zero.
|
static ModInteger |
MIABS(ModInteger A)
ModInteger absolute value.
|
static int |
MICOMP(ModInteger A,
ModInteger B)
ModInteger comparison.
|
static ModInteger |
MIDIF(ModInteger A,
ModInteger B)
ModInteger subtraction.
|
static ModInteger |
MIINV(ModInteger A)
ModInteger inverse.
|
static ModInteger |
MINEG(ModInteger A)
ModInteger negative.
|
static ModInteger |
MIPROD(ModInteger A,
ModInteger B)
ModInteger product.
|
static ModInteger |
MIQ(ModInteger A,
ModInteger B)
ModInteger quotient.
|
static ModInteger |
MIREM(ModInteger A,
ModInteger B)
ModInteger remainder.
|
static int |
MISIGN(ModInteger A)
ModInteger signum.
|
static ModInteger |
MISUM(ModInteger A,
ModInteger B)
ModInteger summation.
|
ModInteger |
multiply(ModInteger S)
ModInteger multiply.
|
ModInteger |
negate()
ModInteger negative.
|
ModInteger[] |
quotientRemainder(ModInteger S)
Quotient and remainder by division of this by S.
|
ModInteger |
remainder(ModInteger S)
ModInteger remainder.
|
int |
signum()
ModInteger signum.
|
ModInteger |
subtract(ModInteger S)
ModInteger subtraction.
|
ModInteger |
sum(ModInteger S)
ModInteger summation.
|
java.lang.String |
toScript()
Get a scripting compatible string representation.
|
java.lang.String |
toScriptFactory()
Get a scripting compatible string representation of the factory.
|
java.lang.String |
toString()
Get the String representation.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
leftDivide, leftRemainder, power, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
public final ModIntegerRing ring
public final java.math.BigInteger val
public ModInteger(ModIntegerRing m, java.math.BigInteger a)
m
- ModIntegerRing.a
- math.BigInteger.public ModInteger(ModIntegerRing m, long a)
m
- ModIntegerRing.a
- long.public ModInteger(ModIntegerRing m, java.lang.String s)
m
- ModIntegerRing.s
- String.public ModInteger(ModIntegerRing m)
m
- ModIntegerRing.public java.math.BigInteger getVal()
public java.math.BigInteger getModul()
public ModIntegerRing factory()
factory
in interface Element<ModInteger>
Element.factory()
public java.math.BigInteger getSymmetricVal()
public BigInteger getInteger()
getInteger
in interface Modular
public BigInteger getSymmetricInteger()
getSymmetricInteger
in interface Modular
public ModInteger copy()
copy
in interface Element<ModInteger>
Object.clone()
public boolean isZERO()
isZERO
in interface AbelianGroupElem<ModInteger>
AbelianGroupElem.isZERO()
public boolean isONE()
isONE
in interface MonoidElem<ModInteger>
MonoidElem.isONE()
public boolean isUnit()
isUnit
in interface MonoidElem<ModInteger>
MonoidElem.isUnit()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toScript()
toScript
in interface Element<ModInteger>
Element.toScript()
public java.lang.String toScriptFactory()
toScriptFactory
in interface Element<ModInteger>
Element.toScriptFactory()
public int compareTo(ModInteger b)
compareTo
in interface Element<ModInteger>
compareTo
in interface java.lang.Comparable<ModInteger>
b
- ModInteger.public static int MICOMP(ModInteger A, ModInteger B)
A
- ModInteger.B
- ModInteger.public boolean equals(java.lang.Object b)
equals
in interface Element<ModInteger>
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in interface Element<ModInteger>
hashCode
in class java.lang.Object
Object.hashCode()
public ModInteger abs()
abs
in interface AbelianGroupElem<ModInteger>
AbelianGroupElem.abs()
public static ModInteger MIABS(ModInteger A)
A
- ModInteger.public ModInteger negate()
negate
in interface AbelianGroupElem<ModInteger>
AbelianGroupElem.negate()
public static ModInteger MINEG(ModInteger A)
A
- ModInteger.public int signum()
signum
in interface AbelianGroupElem<ModInteger>
AbelianGroupElem.signum()
public static int MISIGN(ModInteger A)
A
- ModIntegerpublic ModInteger subtract(ModInteger S)
subtract
in interface AbelianGroupElem<ModInteger>
S
- ModInteger.public static ModInteger MIDIF(ModInteger A, ModInteger B)
A
- ModInteger.B
- ModInteger.public ModInteger divide(ModInteger S)
divide
in interface MonoidElem<ModInteger>
S
- ModInteger.public static ModInteger MIQ(ModInteger A, ModInteger B)
A
- ModInteger.B
- ModInteger.public ModInteger inverse()
inverse
in interface MonoidElem<ModInteger>
NotInvertibleException
- if the element is not invertible.MonoidElem.inverse()
public static ModInteger MIINV(ModInteger A)
A
- is a non-zero integer.MonoidElem.inverse()
public ModInteger remainder(ModInteger S)
remainder
in interface MonoidElem<ModInteger>
S
- ModInteger.public static ModInteger MIREM(ModInteger A, ModInteger B)
A
- ModInteger.B
- ModInteger.public ModInteger[] quotientRemainder(ModInteger S)
quotientRemainder
in interface MonoidElem<ModInteger>
S
- a modular integerpublic ModInteger multiply(ModInteger S)
multiply
in interface MonoidElem<ModInteger>
S
- ModInteger.public static ModInteger MIPROD(ModInteger A, ModInteger B)
A
- ModInteger.B
- ModInteger.public ModInteger sum(ModInteger S)
sum
in interface AbelianGroupElem<ModInteger>
S
- ModInteger.public static ModInteger MISUM(ModInteger A, ModInteger B)
A
- ModInteger.B
- ModInteger.public ModInteger gcd(ModInteger S)
gcd
in interface RingElem<ModInteger>
S
- ModInteger.public ModInteger[] hegcd(ModInteger S)
S
- ModInteger.public ModInteger[] egcd(ModInteger S)
egcd
in interface RingElem<ModInteger>
S
- ModInteger.public long bitLength()
val.bitLength()
.)