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