Poly - type of univariate polynomialspublic final class UnivariateRing<Poly extends IUnivariatePolynomial<Poly>> extends ARing<Poly>
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_DEGREE_OF_RANDOM_POLY
The maximal degree of polynomial generated with
randomElement(RandomGenerator) |
static int |
MIN_DEGREE_OF_RANDOM_POLY
The minimal degree of polynomial generated with
randomElement(RandomGenerator) |
| Constructor and Description |
|---|
UnivariateRing(Poly factory)
Creates ring of univariate polynomials which support operations over univariate polynomials of the type same as
of provided
factory polynomial |
| Modifier and Type | Method and Description |
|---|---|
Poly |
add(Poly a,
Poly b)
Add two elements
|
Poly |
addMutable(Poly a,
Poly b)
Adds two elements and destroys the initial content of
a. |
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(Poly o1,
Poly o2) |
Poly |
copy(Poly element)
Makes a deep copy of the specified element (for immutable instances the same reference returned).
|
Poly[] |
divideAndRemainder(Poly a,
Poly b)
Returns quotient and remainder of
dividend / divider |
boolean |
equals(Object o) |
Poly[] |
extendedGCD(Poly a,
Poly b)
Returns array of
[gcd(a,b), s, t] such that s * a + t * b = gcd(a, b) |
PolynomialFactorDecomposition<Poly> |
factor(Poly element)
Factor specified element
|
PolynomialFactorDecomposition<Poly> |
factorSquareFree(Poly element)
Square-free factorization of specified element
|
Poly |
factory()
Factory polynomial
|
Poly[] |
firstBezoutCoefficient(Poly a,
Poly b)
Returns array of
[gcd(a,b), s] such that s * a + t * b = gcd(a, b) |
Poly |
gcd(Poly a,
Poly b)
Returns the greatest common divisor of two elements
|
Poly |
getOne()
Returns unit element of this ring (one)
|
Poly |
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(Poly element)
Tests whether specified element is one (exactly)
|
boolean |
isUnit(Poly element)
Tests whether specified element is a ring unit
|
boolean |
isZero(Poly element)
Tests whether specified element is zero
|
Iterator<Poly> |
iterator()
Returns iterator over ring elements (for finite rings, otherwise throws exception)
|
Poly |
multiply(Poly a,
Poly b)
Multiplies two elements
|
Poly |
multiplyMutable(Poly a,
Poly b)
Multiplies two elements and destroys the initial content of
a |
Poly |
negate(Poly element)
Negates the given element
|
Poly |
negateMutable(Poly element)
Negates the given element and destroys the initial content of
element |
int |
nVariables()
Number of polynomial variables
|
Poly |
parse(String string)
Parse string into ring element
|
Poly |
pow(Poly base,
BigInteger exponent)
Returns
base in a power of exponent (non negative) |
Poly |
randomElement(int minDegree,
int maxDegree,
org.apache.commons.math3.random.RandomGenerator rnd)
Gives a random univariate polynomial with the degree randomly picked from
minDegree (inclusive) to maxDegree (exclusive) |
Poly |
randomElement(int degree,
org.apache.commons.math3.random.RandomGenerator rnd)
Gives a random univariate polynomial with the specified degree
|
Poly |
randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
Gives a random univariate polynomial with the degree randomly picked from
MIN_DEGREE_OF_RANDOM_POLY
(inclusive) to MAX_DEGREE_OF_RANDOM_POLY (exclusive) |
Poly |
randomElementTree(int minDegree,
int maxDegree,
org.apache.commons.math3.random.RandomGenerator rnd)
Gives a random univariate polynomial with the degree randomly picked from
minDegree (inclusive) to maxDegree (exclusive) and coefficients generated via Ring.randomElementTree(RandomGenerator) method |
Poly |
randomElementTree(org.apache.commons.math3.random.RandomGenerator rnd)
Gives a random univariate polynomial with the degree randomly picked from
MIN_DEGREE_OF_RANDOM_POLY
(inclusive) to MAX_DEGREE_OF_RANDOM_POLY (exclusive) |
Poly |
reciprocal(Poly element)
Gives the inverse element
element ^ (-1) |
Poly |
remainder(Poly a,
Poly b)
Returns the remainder of
dividend / divider |
Poly |
subtract(Poly a,
Poly b)
Subtracts
b from a |
Poly |
subtractMutable(Poly a,
Poly b)
Subtracts
b from a and destroys the initial content of a |
String |
toString() |
String |
toString(IStringifier<Poly> stringifier)
convert this to string with the use of stringifier
|
String |
toString(String... variables) |
Poly |
valueOf(long val)
Returns ring element associated with specified
long |
Poly |
valueOf(Poly val)
Converts a value from other ring to this ring.
|
Poly |
valueOfBigInteger(BigInteger val)
Returns ring element associated with specified integer
|
Poly |
variable(int variable)
Creates poly representing a single specified variable
|
isPerfectPower, perfectPowerBase, perfectPowerExponentclone, finalize, getClass, notify, notifyAll, wait, wait, waitmkCoder, parse, signumabs, add, createArray, createArray, createArray, createArray, createArray2d, createArray2d, createZeroesArray, createZeroesArray2d, decrement, divideExact, divideExactMutable, divideOrNull, factorial, fillZeros, gcd, gcd, getNegativeOne, increment, isFinite, isFiniteField, isMinusOne, isPerfectPower, isUnitOrZero, lcm, lcm, lcm, max, min, multiply, multiply, multiply, perfectPowerBase, perfectPowerExponent, pow, pow, quotient, randomElement, randomElementTree, randomNonZeroElement, setToValueOf, valueOfcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongforEach, spliteratorpublic static final int MIN_DEGREE_OF_RANDOM_POLY
randomElement(RandomGenerator)public static final int MAX_DEGREE_OF_RANDOM_POLY
randomElement(RandomGenerator)public UnivariateRing(Poly factory)
factory polynomialfactory - factory polynomial (the exact value of factory is irrelevant)public int nVariables()
IPolynomialRingpublic Poly remainder(Poly a, Poly b)
Ringdividend / dividera - the dividendb - the dividerdividend / dividerpublic Poly[] divideAndRemainder(Poly a, Poly b)
Ringdividend / dividera - the dividendb - the divider{quotient, remainder}public Poly gcd(Poly a, Poly b)
Ringa - the first elementb - the second elementpublic Poly[] extendedGCD(Poly a, Poly b)
Ring[gcd(a,b), s, t] such that s * a + t * b = gcd(a, b)public Poly[] firstBezoutCoefficient(Poly a, Poly b)
Ring[gcd(a,b), s] such that s * a + t * b = gcd(a, b)a - the first ring element (for which the Bezout coefficient is computed)b - the second ring element[gcd(a,b), s] such that s * a + t * b = gcd(a, b)public PolynomialFactorDecomposition<Poly> factorSquareFree(Poly element)
Ringpublic PolynomialFactorDecomposition<Poly> factor(Poly element)
Ringpublic Poly variable(int variable)
IPolynomialRingpublic Poly randomElement(int minDegree, int maxDegree, org.apache.commons.math3.random.RandomGenerator rnd)
minDegree (inclusive) to maxDegree (exclusive)minDegree - the minimal degree of the resultmaxDegree - the maximal degree of the resultrnd - the source of randomnessminDegree (inclusive) to maxDegree (exclusive)RandomUnivariatePolynomialspublic Poly randomElement(int degree, org.apache.commons.math3.random.RandomGenerator rnd)
degree - the degree of the resultrnd - the source of randomnesspublic Poly randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
MIN_DEGREE_OF_RANDOM_POLY
(inclusive) to MAX_DEGREE_OF_RANDOM_POLY (exclusive)rnd - the source of randomnesspublic Poly randomElementTree(int minDegree, int maxDegree, org.apache.commons.math3.random.RandomGenerator rnd)
minDegree (inclusive) to maxDegree (exclusive) and coefficients generated via Ring.randomElementTree(RandomGenerator) methodminDegree - the minimal degree of the resultmaxDegree - the maximal degree of the resultrnd - the source of randomnessminDegree (inclusive) to maxDegree (exclusive)RandomUnivariatePolynomialspublic Poly randomElementTree(org.apache.commons.math3.random.RandomGenerator rnd)
MIN_DEGREE_OF_RANDOM_POLY
(inclusive) to MAX_DEGREE_OF_RANDOM_POLY (exclusive)rnd - the source of randomnesspublic Poly factory()
IPolynomialRingfactory in interface IPolynomialRing<Poly extends IPolynomial<Poly>>public boolean isEuclideanRing()
RingisEuclideanRing in interface Ring<Poly extends IPolynomial<Poly>>public final boolean isField()
RingisField in interface Ring<Poly extends IPolynomial<Poly>>public final BigInteger cardinality()
Ringcardinality in interface Ring<Poly extends IPolynomial<Poly>>public final BigInteger characteristic()
Ringcharacteristic in interface Ring<Poly extends IPolynomial<Poly>>public final Poly add(Poly a,
Poly b)
Ringadd in interface Ring<Poly extends IPolynomial<Poly>>a - the first elementb - the second elementpublic final Poly subtract(Poly a,
Poly b)
Ringb from asubtract in interface Ring<Poly extends IPolynomial<Poly>>a - the first elementb - the second elementpublic final Poly multiply(Poly a,
Poly b)
Ringmultiply in interface Ring<Poly extends IPolynomial<Poly>>a - the first elementb - the second elementpublic final Poly negate(Poly element)
Ringnegate in interface Ring<Poly extends IPolynomial<Poly>>element - the ring elementpublic Poly pow(Poly base,
BigInteger exponent)
Ringbase in a power of exponent (non negative)pow in interface Ring<Poly extends IPolynomial<Poly>>base - baseexponent - exponent (non negative)base in a power of exponentpublic Poly addMutable(Poly a,
Poly b)
Ringa.addMutable in interface Ring<Poly extends IPolynomial<Poly>>a - the first element (may be destroyed)b - the second elementpublic Poly subtractMutable(Poly a,
Poly b)
Ringb from a and destroys the initial content of asubtractMutable in interface Ring<Poly extends IPolynomial<Poly>>a - the first element (may be destroyed)b - the second elementpublic Poly multiplyMutable(Poly a,
Poly b)
RingamultiplyMutable in interface Ring<Poly extends IPolynomial<Poly>>a - the first element (may be destroyed)b - the second elementpublic Poly negateMutable(Poly element)
RingelementnegateMutable in interface Ring<Poly extends IPolynomial<Poly>>element - the ring element (may be destroyed)public final Poly reciprocal(Poly element)
Ringelement ^ (-1) reciprocal in interface Ring<Poly extends IPolynomial<Poly>>element - the elementelement ^ (-1)public final Poly getZero()
RinggetZero in interface Ring<Poly extends IPolynomial<Poly>>public final Poly getOne()
RinggetOne in interface Ring<Poly extends IPolynomial<Poly>>public final boolean isZero(Poly element)
RingisZero in interface Ring<Poly extends IPolynomial<Poly>>element - the ring elementpublic final boolean isOne(Poly element)
RingisOne in interface Ring<Poly extends IPolynomial<Poly>>element - the ring elementRing.isUnit(Object)public boolean isUnit(Poly element)
RingisUnit in interface Ring<Poly extends IPolynomial<Poly>>element - the ring elementRing.isOne(Object)public final Poly valueOf(long val)
RinglongvalueOf in interface Ring<Poly extends IPolynomial<Poly>>val - machine integerlongpublic Poly valueOfBigInteger(BigInteger val)
RingvalueOfBigInteger in interface Ring<Poly extends IPolynomial<Poly>>val - integerpublic final Poly valueOf(Poly val)
Ringval
== valueOf(val) is possible).valueOf in interface Ring<Poly extends IPolynomial<Poly>>val - some element from any ringvalpublic Poly copy(Poly element)
Ringcopy in interface Ring<Poly extends IPolynomial<Poly>>element - the elementpublic final int compare(Poly o1,
Poly o2)
compare in interface Comparator<Poly extends IPolynomial<Poly>>public final boolean equals(Object o)
equals in interface Comparator<Poly extends IPolynomial<Poly>>equals in class Objectpublic Iterator<Poly> iterator()
Ringiterator in interface Ring<Poly extends IPolynomial<Poly>>iterator in interface Iterable<Poly extends IPolynomial<Poly>>public Poly parse(String string)
Ringparse in interface IParser<Poly extends IPolynomial<Poly>>parse in interface Ring<Poly extends IPolynomial<Poly>>string - stringCoderpublic String toString(IStringifier<Poly> stringifier)
StringifiabletoString in interface Stringifiable<Poly extends IPolynomial<Poly>>Copyright © 2022. All rights reserved.