public final class Integers extends ARing<BigInteger>
| Modifier and Type | Field and Description |
|---|---|
static Integers |
Integers
The ring of integers (Z)
|
| Modifier and Type | Method and Description |
|---|---|
BigInteger |
abs(BigInteger el)
Returns the abs value of element (no copy)
|
BigInteger |
add(BigInteger a,
BigInteger b)
Add two elements
|
BigInteger |
binomial(long n,
long k)
Gives a binomial coefficient C(n, k)
|
BigInteger |
cardinality()
Returns the number of elements in this ring (cardinality) or null if ring is infinite
|
BigInteger |
characteristic()
Returns characteristic of this ring
|
protected Object |
clone() |
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[] |
divideAndRemainder(BigInteger a,
BigInteger b)
Returns quotient and remainder of
dividend / divider |
boolean |
equals(Object obj) |
FactorDecomposition<BigInteger> |
factor(BigInteger element)
Factor specified element
|
FactorDecomposition<BigInteger> |
factorSquareFree(BigInteger element)
Square-free factorization of specified element
|
BigInteger |
gcd(BigInteger a,
BigInteger b)
Returns the greatest common divisor of two elements
|
BigInteger |
getNegativeOne()
Returns negative unit element of this ring (minus one)
|
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 |
isMinusOne(BigInteger bigInteger)
Tests whether specified element is minus one
|
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 |
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
|
BigInteger |
pow(BigInteger base,
BigInteger exponent)
Returns
base in a power of exponent (non negative) |
BigInteger |
pow(BigInteger base,
int exponent)
Returns
base in a power of exponent (non negative) |
BigInteger |
pow(BigInteger base,
long exponent)
Returns
base in a power of exponent (non negative) |
protected Object |
readResolve() |
BigInteger |
reciprocal(BigInteger element)
Gives the inverse element
element ^ (-1) |
BigInteger |
remainder(BigInteger a,
BigInteger b)
Returns the remainder of
dividend / divider |
int |
signum(BigInteger element)
Returns -1 if
element < 0, 0 if element == 0 and 1 if element > 0, where comparison is
specified by Comparator.compare(Object, Object) |
BigInteger |
subtract(BigInteger a,
BigInteger b)
Subtracts
b from a |
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, perfectPowerExponentfinalize, getClass, notify, notifyAll, wait, wait, waitadd, addMutable, createArray, createArray, createArray, createZeroesArray, createZeroesArray2d, decrement, divideExact, divideExactMutable, divideOrNull, extendedGCD, factorial, fillZeros, firstBezoutCoefficient, gcd, gcd, increment, isFinite, isFiniteField, isUnitOrZero, lcm, lcm, lcm, max, min, multiply, multiply, multiply, multiplyMutable, negateMutable, quotient, randomElement, randomElement, randomElementTree, randomElementTree, randomNonZeroElement, setToValueOf, subtractMutable, valueOfcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongforEach, spliteratortoStringpublic static final Integers Integers
public boolean isField()
Ringpublic boolean isEuclideanRing()
Ringpublic BigInteger cardinality()
Ringpublic BigInteger characteristic()
Ringpublic boolean isUnit(BigInteger element)
Ringelement - the ring elementRing.isOne(Object)public 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 remainder(BigInteger a, BigInteger b)
Ringdividend / dividera - the dividendb - the dividerdividend / dividerpublic BigInteger reciprocal(BigInteger element)
Ringelement ^ (-1) element - the elementelement ^ (-1)public BigInteger pow(BigInteger base, int exponent)
Ringbase in a power of exponent (non negative)base - baseexponent - exponent (non negative)base in a power of exponentpublic BigInteger pow(BigInteger base, long exponent)
Ringbase in a power of exponent (non negative)base - baseexponent - exponent (non negative)base in a power of exponentpublic BigInteger pow(BigInteger base, BigInteger exponent)
Ringbase in a power of exponent (non negative)base - baseexponent - exponent (non negative)base in a power of exponentpublic final BigInteger gcd(BigInteger a, BigInteger b)
Ringa - the first elementb - the second elementpublic 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 getNegativeOne()
Ringpublic boolean isMinusOne(BigInteger bigInteger)
RingbigInteger - the ring elementpublic final int signum(BigInteger element)
Ringelement < 0, 0 if element == 0 and 1 if element > 0, where comparison is
specified by Comparator.compare(Object, Object)element - the elementelement < 0, 0 if element == 0 and 1 otherwisepublic BigInteger abs(BigInteger el)
Ringpublic Iterator<BigInteger> iterator()
Ringpublic BigInteger binomial(long n, long k)
protected Object readResolve()
protected Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic boolean equals(Object obj)
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.