public final class ModInt extends java.lang.Object implements GcdRingElem<ModInt>, Modular
ModInteger
,
Serialized FormModifier and Type | Field and Description |
---|---|
ModIntRing |
ring
ModIntRing reference.
|
int |
val
Value part of the element data structure.
|
Constructor and Description |
---|
ModInt(ModIntRing m)
The constructor creates a 0 ModInt object from a given ModIntRing.
|
ModInt(ModIntRing m,
java.math.BigInteger a)
The constructor creates a ModInt object from a ModIntRing and a value
part.
|
ModInt(ModIntRing m,
int a)
The constructor creates a ModInt object from a ModIntRing and a int value
part.
|
ModInt(ModIntRing m,
java.lang.Integer a)
The constructor creates a ModInt object from a ModIntRing and a Int value
part.
|
ModInt(ModIntRing m,
long a)
The constructor creates a ModInt object from a ModIntRing and a long
value part.
|
ModInt(ModIntRing m,
java.lang.Long a)
The constructor creates a ModInt object from a ModIntRing and a Long
value part.
|
ModInt(ModIntRing m,
java.lang.String s)
The constructor creates a ModInt object from a ModIntRing and a String
value part.
|
Modifier and Type | Method and Description |
---|---|
ModInt |
abs()
ModInt absolute value.
|
int |
bitLength()
Returns the number of bits in the representation of this ModInt,
including a sign bit.
|
int |
compareTo(ModInt b)
ModInt comparison.
|
ModInt |
copy()
Clone this.
|
ModInt |
divide(ModInt S)
ModInt divide.
|
ModInt[] |
egcd(ModInt S)
ModInteger extended greatest common divisor.
|
boolean |
equals(java.lang.Object b)
Comparison with any other object.
|
ModIntRing |
factory()
Get the corresponding element factory.
|
int |
gcd(int T,
int S)
Int greatest common divisor.
|
ModInt |
gcd(ModInt S)
ModInteger greatest common divisor.
|
BigInteger |
getInteger()
Return a BigInteger from this Element.
|
int |
getModul()
Get the module part.
|
BigInteger |
getSymmetricInteger()
Return a symmetric BigInteger from this Element.
|
int |
getSymmetricVal()
Get the symmetric value part.
|
int |
getVal()
Get the value part.
|
int |
hashCode()
Hash code for this ModInt.
|
int[] |
hegcd(int T,
int S)
Int half extended greatest common divisor.
|
ModInt |
inverse()
ModInt inverse.
|
boolean |
isONE()
Is ModInt number one.
|
boolean |
isUnit()
Is ModInt number a unit.
|
boolean |
isZERO()
Is ModInt number zero.
|
int |
modInverse(int T,
int m)
Int modular inverse.
|
ModInt |
multiply(ModInt S)
ModInt multiply.
|
ModInt |
negate()
ModInt negative.
|
ModInt |
remainder(ModInt S)
ModInt remainder.
|
int |
signum()
ModInt signum.
|
ModInt |
subtract(ModInt S)
ModInt subtraction.
|
ModInt |
sum(ModInt S)
ModInt 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, quotientRemainder, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
public final ModIntRing ring
public final int val
public ModInt(ModIntRing m, java.math.BigInteger a)
m
- ModIntRing.a
- math.BigInteger.public ModInt(ModIntRing m, int a)
m
- ModIntRing.a
- int.public ModInt(ModIntRing m, long a)
m
- ModIntRing.a
- long.public ModInt(ModIntRing m, java.lang.Integer a)
m
- ModIntRing.a
- Int.public ModInt(ModIntRing m, java.lang.Long a)
m
- ModIntRing.a
- long.public ModInt(ModIntRing m, java.lang.String s)
m
- ModIntRing.s
- String.public ModInt(ModIntRing m)
m
- ModIntRing.public int getVal()
public int getModul()
public ModIntRing factory()
factory
in interface Element<ModInt>
Element.factory()
public int getSymmetricVal()
public BigInteger getInteger()
getInteger
in interface Modular
public BigInteger getSymmetricInteger()
getSymmetricInteger
in interface Modular
public boolean isZERO()
isZERO
in interface AbelianGroupElem<ModInt>
AbelianGroupElem.isZERO()
public boolean isONE()
isONE
in interface MonoidElem<ModInt>
MonoidElem.isONE()
public boolean isUnit()
isUnit
in interface MonoidElem<ModInt>
MonoidElem.isUnit()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toScript()
toScript
in interface Element<ModInt>
Element.toScript()
public java.lang.String toScriptFactory()
toScriptFactory
in interface Element<ModInt>
Element.toScriptFactory()
public boolean equals(java.lang.Object b)
public int hashCode()
public ModInt abs()
abs
in interface AbelianGroupElem<ModInt>
AbelianGroupElem.abs()
public ModInt negate()
negate
in interface AbelianGroupElem<ModInt>
AbelianGroupElem.negate()
public int signum()
signum
in interface AbelianGroupElem<ModInt>
AbelianGroupElem.signum()
public ModInt subtract(ModInt S)
subtract
in interface AbelianGroupElem<ModInt>
S
- ModInt.public ModInt divide(ModInt S)
divide
in interface MonoidElem<ModInt>
S
- ModInt.public ModInt inverse()
inverse
in interface MonoidElem<ModInt>
NotInvertibleException
- if the element is not invertible.MonoidElem.inverse()
public ModInt remainder(ModInt S)
remainder
in interface MonoidElem<ModInt>
S
- ModInt.public ModInt multiply(ModInt S)
multiply
in interface MonoidElem<ModInt>
S
- ModInt.public ModInt sum(ModInt S)
sum
in interface AbelianGroupElem<ModInt>
S
- ModInt.public int gcd(int T, int S)
T
- int.S
- int.public int[] hegcd(int T, int S)
T
- int.S
- int.public int modInverse(int T, int m)
T
- int.m
- int.public int bitLength()