public class ImageRing<F,I> extends Object implements Ring<I>
image(Object) and inverse(Object) functions.| Modifier and Type | Field and Description |
|---|---|
Function<F,I> |
imageFunc |
Function<I,F> |
inverseFunc |
Ring<F> |
ring
the ring
|
| Constructor and Description |
|---|
ImageRing(Ring<F> ring,
Function<I,F> inverseFunc,
Function<F,I> imageFunc) |
| Modifier and Type | Method and Description |
|---|---|
I |
abs(I el)
Returns the abs value of element (no copy)
|
I |
add(I... elements)
Total of the array of elements
|
I |
add(I a,
I b)
Add two elements
|
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(I o1,
I o2) |
I |
copy(I element)
Makes a deep copy of the specified element (for immutable instances the same reference returned).
|
I |
decrement(I element)
Returns
element - 1 |
I[] |
divideAndRemainder(I dividend,
I divider)
Returns quotient and remainder of
dividend / divider |
boolean |
equals(Object o) |
I[] |
extendedGCD(I a,
I b)
Returns array of
[gcd(a,b), s, t] such that s * a + t * b = gcd(a, b) |
FactorDecomposition<I> |
factor(I element)
Factor specified element
|
I |
factorial(long num)
Gives a product of {@code valueOf(1) * valueOf(2) * ....
|
FactorDecomposition<I> |
factorSquareFree(I element)
Square-free factorization of specified element
|
I |
gcd(I... elements)
Returns greatest common divisor of specified elements
|
I |
gcd(I a,
I b)
Returns the greatest common divisor of two elements
|
I |
gcd(Iterable<I> elements)
Returns greatest common divisor of specified elements
|
I |
getOne()
Returns unit element of this ring (one)
|
I |
getZero()
Returns zero element of this ring
|
int |
hashCode() |
I |
image(F el) |
I[] |
image(F[] el) |
I |
increment(I element)
Returns
element + 1 |
F |
inverse(I el) |
F[] |
inverse(I[] el) |
boolean |
isEuclideanRing()
Returns whether this ring is a Euclidean ring
|
boolean |
isField()
Returns whether this ring is a field
|
boolean |
isOne(I element)
Tests whether specified element is one (exactly)
|
boolean |
isPerfectPower()
Returns whether the cardinality is a perfect power (p^k with k > 1)
|
boolean |
isUnit(I element)
Tests whether specified element is a ring unit
|
boolean |
isZero(I element)
Tests whether specified element is zero
|
Iterator<I> |
iterator()
Returns iterator over ring elements (for finite rings, otherwise throws exception)
|
I |
lcm(I a,
I b)
Returns the least common multiple of two elements
|
I |
multiply(I... elements)
Multiplies the array of elements
|
I |
multiply(I a,
I b)
Multiplies two elements
|
I |
negate(I element)
Negates the given element
|
I |
parse(String string)
Parse string into ring element
|
BigInteger |
perfectPowerBase()
Returns
base so that cardinality == base^exponent or null if cardinality is not finite |
BigInteger |
perfectPowerExponent()
Returns
exponent so that cardinality == base^exponent or null if cardinality is not finite |
I |
pow(I base,
BigInteger exponent)
Returns
base in a power of exponent (non negative) |
I |
pow(I base,
int exponent)
Returns
base in a power of exponent (non negative) |
I |
pow(I base,
long exponent)
Returns
base in a power of exponent (non negative) |
I |
quotient(I dividend,
I divider)
Returns the quotient of
dividend / divider |
I |
randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
Returns a random element from this ring
|
I |
reciprocal(I element)
Gives the inverse element
element ^ (-1) |
I |
remainder(I dividend,
I divider)
Returns the remainder of
dividend / divider |
int |
signum(I element)
Returns -1 if
element < 0, 0 if element == 0 and 1 if element > 0, where comparison is
specified by Comparator.compare(Object, Object) |
I |
subtract(I a,
I b)
Subtracts
b from a |
I |
valueOf(I val)
Converts a value from other ring to this ring.
|
I |
valueOf(long val)
Returns ring element associated with specified
long |
I |
valueOfBigInteger(BigInteger val)
Returns ring element associated with specified integer
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddMutable, createArray, createArray, createArray, createArray, createArray2d, createArray2d, createZeroesArray, createZeroesArray2d, divideExact, divideExactMutable, divideOrNull, fillZeros, firstBezoutCoefficient, getNegativeOne, isFinite, isFiniteField, isMinusOne, isUnitOrZero, lcm, lcm, max, min, multiply, multiply, multiplyMutable, negateMutable, randomElement, randomElementTree, randomElementTree, randomNonZeroElement, setToValueOf, subtractMutable, valueOfcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongforEach, spliteratortoStringpublic boolean isField()
Ringpublic boolean isEuclideanRing()
RingisEuclideanRing in interface Ring<I>public BigInteger cardinality()
Ringcardinality in interface Ring<I>public BigInteger characteristic()
Ringcharacteristic in interface Ring<I>public boolean isPerfectPower()
RingisPerfectPower in interface Ring<I>public BigInteger perfectPowerBase()
Ringbase so that cardinality == base^exponent or null if cardinality is not finiteperfectPowerBase in interface Ring<I>base so that cardinality == base^exponent or null if cardinality is not finitepublic BigInteger perfectPowerExponent()
Ringexponent so that cardinality == base^exponent or null if cardinality is not finiteperfectPowerExponent in interface Ring<I>exponent so that cardinality == base^exponent or null if cardinality is not finitepublic I multiply(I a, I b)
Ringpublic I add(I... elements)
Ringpublic I multiply(I... elements)
Ringpublic I abs(I el)
Ringpublic I copy(I element)
Ringpublic I[] divideAndRemainder(I dividend, I divider)
Ringdividend / dividerdivideAndRemainder in interface Ring<I>dividend - the dividenddivider - the divider{quotient, remainder}public I quotient(I dividend, I divider)
Ringdividend / dividerpublic I remainder(I dividend, I divider)
Ringdividend / dividerpublic I reciprocal(I element)
Ringelement ^ (-1) reciprocal in interface Ring<I>element - the elementelement ^ (-1)public I getZero()
Ringpublic I getOne()
Ringpublic boolean isZero(I element)
Ringpublic boolean isOne(I element)
RingisOne in interface Ring<I>element - the ring elementRing.isUnit(Object)public boolean isUnit(I element)
RingisUnit in interface Ring<I>element - the ring elementRing.isOne(Object)public I valueOf(long val)
Ringlongpublic I valueOfBigInteger(BigInteger val)
RingvalueOfBigInteger in interface Ring<I>val - integerpublic I valueOf(I val)
Ringval
== valueOf(val) is possible).public Iterator<I> iterator()
Ringpublic I gcd(I a, I b)
Ringpublic I[] extendedGCD(I a, I b)
Ring[gcd(a,b), s, t] such that s * a + t * b = gcd(a, b)extendedGCD in interface Ring<I>public I lcm(I a, I b)
Ringpublic I gcd(I... elements)
Ringpublic I gcd(Iterable<I> elements)
Ringpublic int signum(I element)
Ringelement < 0, 0 if element == 0 and 1 if element > 0, where comparison is
specified by Comparator.compare(Object, Object)public FactorDecomposition<I> factorSquareFree(I element)
RingfactorSquareFree in interface Ring<I>public FactorDecomposition<I> factor(I element)
Ringpublic I parse(String string)
Ringpublic I pow(I base, int exponent)
Ringbase in a power of exponent (non negative)public I pow(I base, long exponent)
Ringbase in a power of exponent (non negative)public I pow(I base, BigInteger exponent)
Ringbase in a power of exponent (non negative)public I factorial(long num)
RingvalueOf(1) * valueOf(2) * .... * valueOf(num) public I randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
RingrandomElement in interface Ring<I>rnd - the source of randomnesspublic int compare(I o1, I o2)
compare in interface Comparator<I>public boolean equals(Object o)
equals in interface Comparator<I>equals in class ObjectCopyright © 2022. All rights reserved.