Poly
- type of multivariate polynomialspublic final class MultivariateRing<Poly extends AMultivariatePolynomial<?,Poly>> extends ARing<Poly>
Modifier and Type | Field and Description |
---|---|
static int |
DEGREE_OF_RANDOM_POLY
Default degree of polynomial generated with
randomElementTree(RandomGenerator) |
static int |
SIZE_OF_RANDOM_POLY
Default size of polynomial generated with
randomElementTree(RandomGenerator) |
Constructor and Description |
---|
MultivariateRing(Poly factory)
Creates ring of multivariate polynomials which support operations over multivariate polynomials of the type and
number of variables 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 |
create(DegreeVector term)
Creates multivariate polynomial over the same ring as this with the single monomial
|
Poly[] |
divideAndRemainder(Poly dividend,
Poly divider)
Returns quotient and remainder of
dividend / divider |
MultivariateRing<Poly> |
dropVariable() |
boolean |
equals(Object o) |
PolynomialFactorDecomposition<Poly> |
factor(Poly element)
Factor specified element
|
PolynomialFactorDecomposition<Poly> |
factorSquareFree(Poly element)
Square-free factorization of specified element
|
Poly |
factory()
Factory polynomial
|
Poly |
gcd(Iterable<Poly> elements)
Returns greatest common divisor of specified elements
|
Poly |
gcd(Poly[] elements)
Returns greatest common divisor of specified elements
|
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)
|
<Term extends AMonomial<Term>> |
monomialAlgebra() |
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
|
Comparator<DegreeVector> |
ordering() |
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 degree,
int size)
Generates random multivariate polynomial
|
Poly |
randomElement(int degree,
int size,
org.apache.commons.math3.random.RandomGenerator rnd)
Generates random multivariate polynomial
|
Poly |
randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
Gives a random constant polynomial.
|
Poly |
randomElementTree(int degree,
int size,
org.apache.commons.math3.random.RandomGenerator rnd)
Generates random multivariate polynomial
|
Poly |
randomElementTree(org.apache.commons.math3.random.RandomGenerator rnd)
If this ring has a complicated nested structure, this method guaranties that the resulting random element will
reflect ring complicated structure, i.e.
|
Poly |
reciprocal(Poly element)
Gives the inverse element
element ^ (-1) |
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, perfectPowerExponent
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
mkCoder, parse, signum
abs, add, createArray, createArray, createArray, createArray, createArray2d, createArray2d, createZeroesArray, createZeroesArray2d, decrement, divideExact, divideExactMutable, divideOrNull, extendedGCD, factorial, fillZeros, firstBezoutCoefficient, getNegativeOne, increment, isFinite, isFiniteField, isMinusOne, isPerfectPower, isUnitOrZero, lcm, lcm, lcm, max, min, multiply, multiply, multiply, perfectPowerBase, perfectPowerExponent, pow, pow, quotient, randomElement, randomElementTree, randomNonZeroElement, remainder, setToValueOf, valueOf
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
forEach, spliterator
public static final int DEGREE_OF_RANDOM_POLY
randomElementTree(RandomGenerator)
public static final int SIZE_OF_RANDOM_POLY
randomElementTree(RandomGenerator)
public MultivariateRing(Poly factory)
factory
polynomialfactory
- the factory polynomial (the exact value of factory
is irrelevant) which fixes the element
type of this ring, coefficient ring and the number of variablespublic <Term extends AMonomial<Term>> IMonomialAlgebra<Term> monomialAlgebra()
public int nVariables()
IPolynomialRing
public Comparator<DegreeVector> ordering()
public MultivariateRing<Poly> dropVariable()
public Poly[] divideAndRemainder(Poly dividend, Poly divider)
Ring
dividend / divider
dividend
- the dividenddivider
- the divider{quotient, remainder}
public Poly gcd(Poly a, Poly b)
Ring
a
- the first elementb
- the second elementpublic Poly gcd(Poly[] elements)
Ring
elements
- the elementspublic Poly gcd(Iterable<Poly> elements)
Ring
elements
- the elementspublic PolynomialFactorDecomposition<Poly> factorSquareFree(Poly element)
Ring
public PolynomialFactorDecomposition<Poly> factor(Poly element)
Ring
public Poly variable(int variable)
IPolynomialRing
public Poly create(DegreeVector term)
term
- the monomialpublic Poly randomElement(int degree, int size, org.apache.commons.math3.random.RandomGenerator rnd)
degree
- maximal degree of the resultsize
- number of elements in the resultrnd
- random sourcepublic Poly randomElementTree(int degree, int size, org.apache.commons.math3.random.RandomGenerator rnd)
degree
- maximal degree of the resultsize
- number of elements in the resultrnd
- random sourcepublic Poly randomElement(int degree, int size)
degree
- maximal degree of the resultsize
- number of elements in the resultpublic Poly randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
RandomMultivariatePolynomials
rnd
- the source of randomnessRandomMultivariatePolynomials
public Poly randomElementTree(org.apache.commons.math3.random.RandomGenerator rnd)
Ring
public Poly factory()
IPolynomialRing
factory
in interface IPolynomialRing<Poly extends IPolynomial<Poly>>
public boolean isEuclideanRing()
Ring
isEuclideanRing
in interface Ring<Poly extends IPolynomial<Poly>>
public final boolean isField()
Ring
isField
in interface Ring<Poly extends IPolynomial<Poly>>
public final BigInteger cardinality()
Ring
cardinality
in interface Ring<Poly extends IPolynomial<Poly>>
public final BigInteger characteristic()
Ring
characteristic
in interface Ring<Poly extends IPolynomial<Poly>>
public final Poly add(Poly a, Poly b)
Ring
add
in interface Ring<Poly extends IPolynomial<Poly>>
a
- the first elementb
- the second elementpublic final Poly subtract(Poly a, Poly b)
Ring
b
from a
subtract
in interface Ring<Poly extends IPolynomial<Poly>>
a
- the first elementb
- the second elementpublic final Poly multiply(Poly a, Poly b)
Ring
multiply
in interface Ring<Poly extends IPolynomial<Poly>>
a
- the first elementb
- the second elementpublic final Poly negate(Poly element)
Ring
negate
in interface Ring<Poly extends IPolynomial<Poly>>
element
- the ring elementpublic Poly pow(Poly base, BigInteger exponent)
Ring
base
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 exponent
public Poly addMutable(Poly a, Poly b)
Ring
a
.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)
Ring
b
from a
and destroys the initial content of a
subtractMutable
in interface Ring<Poly extends IPolynomial<Poly>>
a
- the first element (may be destroyed)b
- the second elementpublic Poly multiplyMutable(Poly a, Poly b)
Ring
a
multiplyMutable
in interface Ring<Poly extends IPolynomial<Poly>>
a
- the first element (may be destroyed)b
- the second elementpublic Poly negateMutable(Poly element)
Ring
element
negateMutable
in interface Ring<Poly extends IPolynomial<Poly>>
element
- the ring element (may be destroyed)public final Poly reciprocal(Poly element)
Ring
element ^ (-1)
reciprocal
in interface Ring<Poly extends IPolynomial<Poly>>
element
- the elementelement ^ (-1)
public final Poly getZero()
Ring
getZero
in interface Ring<Poly extends IPolynomial<Poly>>
public final Poly getOne()
Ring
getOne
in interface Ring<Poly extends IPolynomial<Poly>>
public final boolean isZero(Poly element)
Ring
isZero
in interface Ring<Poly extends IPolynomial<Poly>>
element
- the ring elementpublic final boolean isOne(Poly element)
Ring
isOne
in interface Ring<Poly extends IPolynomial<Poly>>
element
- the ring elementRing.isUnit(Object)
public boolean isUnit(Poly element)
Ring
isUnit
in interface Ring<Poly extends IPolynomial<Poly>>
element
- the ring elementRing.isOne(Object)
public final Poly valueOf(long val)
Ring
long
valueOf
in interface Ring<Poly extends IPolynomial<Poly>>
val
- machine integerlong
public Poly valueOfBigInteger(BigInteger val)
Ring
valueOfBigInteger
in interface Ring<Poly extends IPolynomial<Poly>>
val
- integerpublic final Poly valueOf(Poly val)
Ring
val
== valueOf(val)
is possible).valueOf
in interface Ring<Poly extends IPolynomial<Poly>>
val
- some element from any ringval
public Poly copy(Poly element)
Ring
copy
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 Object
public Iterator<Poly> iterator()
Ring
iterator
in interface Ring<Poly extends IPolynomial<Poly>>
iterator
in interface Iterable<Poly extends IPolynomial<Poly>>
public Poly parse(String string)
Ring
parse
in interface IParser<Poly extends IPolynomial<Poly>>
parse
in interface Ring<Poly extends IPolynomial<Poly>>
string
- stringCoder
public String toString(IStringifier<Poly> stringifier)
Stringifiable
toString
in interface Stringifiable<Poly extends IPolynomial<Poly>>
Copyright © 2018. All rights reserved.