public final class IntegersZp extends ARing<BigInteger>
modulus.| Modifier and Type | Field and Description |
|---|---|
BigInteger |
modulus
The modulus.
|
| Constructor and Description |
|---|
IntegersZp(BigInteger modulus)
Creates Zp ring for specified modulus.
|
IntegersZp(long modulus)
Creates Zp ring for specified modulus.
|
| Modifier and Type | Method and Description |
|---|---|
BigInteger |
add(BigInteger a,
BigInteger b)
Add two elements
|
IntegersZp64 |
asMachineRing()
Converts to a
IntegersZp64 |
IntegersZp64 |
asZp64()
Returns machine integer ring or null if modulus is larger than
long |
BigInteger |
cardinality()
Returns the number of elements in this ring (cardinality) or null if ring is infinite
|
BigInteger |
characteristic()
Returns characteristic of this ring
|
int |
compare(BigInteger o1,
BigInteger o2) |
BigInteger |
copy(BigInteger element)
Makes a deep copy of the specified element (for immutable instances the same reference returned).
|
BigInteger[] |
createArray(int length)
Creates generic array of ring elements of specified length
|
BigInteger[][] |
createArray2d(int length)
Creates 2d array of ring elements of specified length
|
BigInteger[][] |
createArray2d(int m,
int n)
Creates 2d array of ring elements of specified shape
|
BigInteger |
divide(BigInteger a,
BigInteger b) |
BigInteger[] |
divideAndRemainder(BigInteger a,
BigInteger b)
Returns quotient and remainder of
dividend / divider |
boolean |
equals(Object o) |
FactorDecomposition<BigInteger> |
factor(BigInteger element)
Factor specified element
|
FactorDecomposition<BigInteger> |
factorSquareFree(BigInteger element)
Square-free factorization of specified element
|
BigInteger |
getOne()
Returns unit element of this ring (one)
|
BigInteger |
getZero()
Returns zero element of this ring
|
int |
hashCode() |
boolean |
isEuclideanRing()
Returns whether this ring is a Euclidean ring
|
boolean |
isField()
Returns whether this ring is a field
|
boolean |
isOne(BigInteger element)
Tests whether specified element is one (exactly)
|
boolean |
isUnit(BigInteger element)
Tests whether specified element is a ring unit
|
boolean |
isZero(BigInteger element)
Tests whether specified element is zero
|
Iterator<BigInteger> |
iterator()
Returns iterator over ring elements (for finite rings, otherwise throws exception)
|
BigInteger |
modulus(BigInteger val)
Returns
val mod this.modulus |
BigInteger |
multiply(BigInteger a,
BigInteger b)
Multiplies two elements
|
BigInteger |
negate(BigInteger element)
Negates the given element
|
BigInteger |
parse(String string)
Parse string into ring element
|
IntegersZp |
perfectPowerBaseDomain()
Returns ring for
ARing.perfectPowerBase() or this if modulus is not a perfect power |
BigInteger |
randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
Returns a random element from this ring
|
BigInteger |
reciprocal(BigInteger element)
Gives the inverse element
element ^ (-1) |
BigInteger |
remainder(BigInteger a,
BigInteger b)
Returns the remainder of
dividend / divider |
BigInteger |
subtract(BigInteger a,
BigInteger b)
Subtracts
b from a |
BigInteger |
symmetricForm(BigInteger value)
Converts
value to a symmetric representation of Zp |
String |
toString() |
BigInteger |
valueOf(BigInteger val)
Converts a value from other ring to this ring.
|
BigInteger |
valueOf(long val)
Returns ring element associated with specified
long |
BigInteger |
valueOfBigInteger(BigInteger val)
Returns ring element associated with specified integer
|
isPerfectPower, perfectPowerBase, perfectPowerExponentclone, finalize, getClass, notify, notifyAll, wait, wait, waitabs, add, addMutable, createArray, createArray, createArray, createZeroesArray, createZeroesArray2d, decrement, divideExact, divideExactMutable, divideOrNull, extendedGCD, factorial, fillZeros, firstBezoutCoefficient, gcd, gcd, gcd, getNegativeOne, increment, isFinite, isFiniteField, isMinusOne, isUnitOrZero, lcm, lcm, lcm, max, min, multiply, multiply, multiply, multiplyMutable, negateMutable, pow, pow, pow, quotient, randomElement, randomElementTree, randomElementTree, randomNonZeroElement, setToValueOf, signum, subtractMutable, valueOfcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongforEach, spliteratortoStringpublic final BigInteger modulus
public IntegersZp(BigInteger modulus)
modulus - the moduluspublic IntegersZp(long modulus)
modulus - the moduluspublic boolean isField()
Ringpublic boolean isEuclideanRing()
Ringpublic BigInteger cardinality()
Ringpublic BigInteger characteristic()
Ringpublic boolean isUnit(BigInteger element)
Ringelement - the ring elementRing.isOne(Object)public BigInteger modulus(BigInteger val)
val mod this.modulusval - the integerval mod this.moduluspublic BigInteger symmetricForm(BigInteger value)
value to a symmetric representation of Zpvalue - field elementvalue in a symmetric representation of Zppublic IntegersZp64 asMachineRing()
IntegersZp64public BigInteger add(BigInteger a, BigInteger b)
Ringa - the first elementb - the second elementpublic BigInteger subtract(BigInteger a, BigInteger b)
Ringb from aa - the first elementb - the second elementpublic BigInteger negate(BigInteger element)
Ringelement - the ring elementpublic BigInteger multiply(BigInteger a, BigInteger b)
Ringa - the first elementb - the second elementpublic BigInteger[] divideAndRemainder(BigInteger a, BigInteger b)
Ringdividend / dividera - the dividendb - the divider{quotient, remainder}public BigInteger divide(BigInteger a, BigInteger b)
public BigInteger remainder(BigInteger a, BigInteger b)
Ringdividend / dividera - the dividendb - the dividerdividend / dividerpublic BigInteger reciprocal(BigInteger element)
Ringelement ^ (-1) element - the elementelement ^ (-1)public FactorDecomposition<BigInteger> factorSquareFree(BigInteger element)
Ringpublic FactorDecomposition<BigInteger> factor(BigInteger element)
Ringpublic BigInteger valueOf(BigInteger val)
Ringval
== valueOf(val) is possible).val - some element from any ringvalpublic BigInteger valueOf(long val)
Ringlongval - machine integerlongpublic BigInteger randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
Ringrnd - the source of randomnesspublic Iterator<BigInteger> iterator()
Ringpublic IntegersZp perfectPowerBaseDomain()
ARing.perfectPowerBase() or this if modulus is not a perfect powerARing.perfectPowerBase() or this if modulus is not a perfect powerpublic IntegersZp64 asZp64()
longlongpublic boolean equals(Object o)
equals in interface Comparator<BigInteger>equals in class Objectpublic final BigInteger getZero()
Ringpublic final BigInteger getOne()
Ringpublic final boolean isZero(BigInteger element)
Ringelement - the ring elementpublic final boolean isOne(BigInteger element)
Ringelement - the ring elementRing.isUnit(Object)public final BigInteger parse(String string)
Ringstring - stringCoderpublic final int compare(BigInteger o1, BigInteger o2)
public final BigInteger[] createArray(int length)
Ringlength - array lengthlengthpublic final BigInteger[][] createArray2d(int length)
Ringlength - array lengthlengthpublic final BigInteger[][] createArray2d(int m, int n)
Ringm - result lengthn - length of each array in the resultpublic final BigInteger valueOfBigInteger(BigInteger val)
Ringval - integerpublic BigInteger copy(BigInteger element)
Ringelement - the elementCopyright © 2022. All rights reserved.