public class ModuloApintField extends AbstractField<ModuloApintField,Apint>
setModulus(Apint)
; otherwise
the modulo reduction is not done.Constructor and Description |
---|
ModuloApintField(Apint value)
Constructs a new integer field object with the specified value.
|
Modifier and Type | Method and Description |
---|---|
ModuloApintField |
copy()
Returns a copy of this object.
|
static Apint |
getModulus()
Returns the modulus or
null if modulo reduction is not done. |
ModuloApintField |
inverse()
Returns the multiplicative inverse of this object.
|
ModuloApintField |
opposite()
Returns the additive inverse of this object.
|
ModuloApintField |
plus(ModuloApintField that)
Returns the sum of this object with the one specified.
|
static Apint |
reduce(Apint value)
Reduce the value with the current modulus.
|
static void |
setModulus(Apint modulus)
Sets the modulus.
|
ModuloApintField |
times(ModuloApintField that)
Returns the product of this object with the one specified.
|
compareTo, doubleValue, equals, hashCode, isLargerThan, longValue, toText, value
byteValue, floatValue, intValue, isGreaterThan, isLessThan, minus, pow, shortValue, toString
public ModuloApintField(Apint value)
value
- The value.public static Apint getModulus()
null
if modulo reduction is not done.
The modulus can be set in a thread-specific way using
LocalContext
.null
if modulo reduction is not done.setModulus(org.apfloat.Apint)
public static void setModulus(Apint modulus)
LocalContext
.modulus
- The modulus or null
if modulo reduction is not done.IllegalArgumentException
- If modulus
is not positive.public static Apint reduce(Apint value)
value
- The value.public ModuloApintField plus(ModuloApintField that)
AbstractField
plus
in interface GroupAdditive<ModuloApintField>
plus
in class AbstractField<ModuloApintField,Apint>
that
- The addend.this + that
public ModuloApintField opposite()
AbstractField
opposite
in interface GroupAdditive<ModuloApintField>
opposite
in class AbstractField<ModuloApintField,Apint>
-this
public ModuloApintField times(ModuloApintField that)
AbstractField
times
in interface GroupMultiplicative<ModuloApintField>
times
in interface Ring<ModuloApintField>
times
in class AbstractField<ModuloApintField,Apint>
that
- The multiplicand.this * that
public ModuloApintField inverse() throws ArithmeticException
AbstractField
inverse
in interface GroupMultiplicative<ModuloApintField>
inverse
in class AbstractField<ModuloApintField,Apint>
1 / this
ArithmeticException
- If the divisor is zero.public ModuloApintField copy()
AbstractField
copy
in interface ValueType
copy
in class AbstractField<ModuloApintField,Apint>