public final class ModuloInteger extends Number<ModuloInteger> implements Field<ModuloInteger>
This class represents a modulo integer. It can be used in conjonction
with the Matrix
class to resolve modulo equations (ref. number theory).
| Modifier and Type | Field and Description |
|---|---|
static ModuloInteger |
ONE
The modulo integer representing the multiplicative identity.
|
static ModuloInteger |
ZERO
The modulo integer representing the additive identity.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ModuloInteger that)
Compares this number with the specified number for order.
|
ModuloInteger |
copy()
Returns a copy of this number
allocated
by the calling thread (possibly on the stack). |
double |
doubleValue()
Returns the value of this number as a
double. |
boolean |
equals(Object that)
Compares this modulo integer against the specified object
independently of the current modulus.
|
static LargeInteger |
getModulus()
Returns the
local modulus
for modular arithmetic or null if the arithmetic operations
are non-modular (default). |
int |
hashCode()
Returns the hash code for this large integer number.
|
ModuloInteger |
inverse()
Returns the multiplicative inverse of this object.
|
boolean |
isLargerThan(ModuloInteger that)
Compares the magnitude of this number with that number.
|
long |
longValue()
Returns the value of this number as a
long. |
LargeInteger |
moduloValue()
Returns the current modulo value of this number.
|
ModuloInteger |
opposite()
Returns the additive inverse of this object.
|
ModuloInteger |
plus(ModuloInteger that)
Returns the sum of this object with the one specified.
|
static void |
setModulus(LargeInteger modulus)
Sets the
local modulus
for modular arithmetic. |
ModuloInteger |
times(ModuloInteger that)
Returns the product of this object with the one specified.
|
javolution.text.Text |
toText()
Returns the text representation of the current modulo value of
this number.
|
static ModuloInteger |
valueOf(CharSequence chars)
Returns the modulo integer for the specified character sequence in
decimal number.
|
static ModuloInteger |
valueOf(LargeInteger value)
Returns the modulo integer having the specified value (independently of
the current modulo).
|
byteValue, floatValue, intValue, isGreaterThan, isLessThan, minus, pow, shortValue, toStringpublic static final ModuloInteger ZERO
public static final ModuloInteger ONE
public static ModuloInteger valueOf(LargeInteger value)
value - the modulo integer intrinsic value.public static ModuloInteger valueOf(CharSequence chars)
chars - the character sequence.public static LargeInteger getModulus()
local modulus
for modular arithmetic or null if the arithmetic operations
are non-modular (default).null if none.setModulus(org.jscience.mathematics.number.LargeInteger)public static void setModulus(LargeInteger modulus)
local modulus
for modular arithmetic.modulus - the new modulus or null to unset the modulus.IllegalArgumentException - if modulus <= 0public LargeInteger moduloValue()
set to null the intrinsic value
(the creation value) is returned.public javolution.text.Text toText()
toText in interface javolution.lang.RealtimetoText in class Number<ModuloInteger>public boolean equals(Object that)
equals in class Number<ModuloInteger>that - the object to compare with.true if that is a modulo number with the same
intrinsic value; false otherwise.public int hashCode()
hashCode in class Number<ModuloInteger>public boolean isLargerThan(ModuloInteger that)
NumberisLargerThan in class Number<ModuloInteger>|this| > |that|public long longValue()
Numberlong.longValue in class Number<ModuloInteger>long.public double doubleValue()
Numberdouble.doubleValue in class Number<ModuloInteger>double.public int compareTo(ModuloInteger that)
Number(x.compareTo(y)==0) == (x.equals(y)),compareTo in interface Comparable<ModuloInteger>compareTo in class Number<ModuloInteger>that - the number to be compared.public ModuloInteger times(ModuloInteger that)
Ringtimes in interface GroupMultiplicative<ModuloInteger>times in interface Ring<ModuloInteger>that - the object multiplier.this ยท that.public ModuloInteger plus(ModuloInteger that)
GroupAdditiveplus in interface GroupAdditive<ModuloInteger>that - the object to be added.this + that.public ModuloInteger opposite()
GroupAdditivethis.plus(this.opposite()) == ZERO,
with ZERO being the additive identity.opposite in interface GroupAdditive<ModuloInteger>-this.public ModuloInteger inverse()
GroupMultiplicativethis.times(this.inverse()) == ONE ,
with ONE being the multiplicative identity.inverse in interface GroupMultiplicative<ModuloInteger>ONE / this.public ModuloInteger copy()
Numberallocated
by the calling thread (possibly on the stack).copy in interface javolution.lang.ValueTypecopy in class Number<ModuloInteger>