C
- coefficient typepublic class GenPolynomialRing<C extends RingElem<C>> extends java.lang.Object implements RingFactory<GenPolynomial<C>>, java.lang.Iterable<GenPolynomial<C>>
Modifier and Type | Field and Description |
---|---|
RingFactory<C> |
coFac
The factory for the coefficients.
|
ExpVector |
evzero
The constant exponent vector 0 for this ring.
|
protected int |
isField
Indicator if this ring is a field.
|
int |
nvar
The number of variables.
|
GenPolynomial<C> |
ONE
The constant polynomial 1 for this ring.
|
protected boolean |
partial
True for partially reversed variables.
|
protected static java.util.Random |
random
A default random sequence generator.
|
TermOrder |
tord
The term order.
|
protected java.lang.String[] |
vars
The names of the variables.
|
GenPolynomial<C> |
ZERO
The constant polynomial 0 for this ring.
|
Constructor and Description |
---|
GenPolynomialRing(GenPolynomialRing<C> o,
TermOrder to)
The constructor creates a polynomial factory object with the the same
coefficient factory, number of variables and variable names as the given
polynomial factory, only the term order differs.
|
GenPolynomialRing(RingFactory<C> cf,
GenPolynomialRing o)
The constructor creates a polynomial factory object with the the same
term order, number of variables and variable names as the given
polynomial factory, only the coefficient factories differ.
|
GenPolynomialRing(RingFactory<C> cf,
int n)
The constructor creates a polynomial factory object with the default term
order.
|
GenPolynomialRing(RingFactory<C> cf,
int n,
java.lang.String[] v)
The constructor creates a polynomial factory object.
|
GenPolynomialRing(RingFactory<C> cf,
int n,
TermOrder t)
The constructor creates a polynomial factory object.
|
GenPolynomialRing(RingFactory<C> cf,
int n,
TermOrder t,
java.lang.String[] v)
The constructor creates a polynomial factory object.
|
GenPolynomialRing(RingFactory<C> cf,
java.lang.String[] v)
The constructor creates a polynomial factory object.
|
GenPolynomialRing(RingFactory<C> cf,
java.lang.String[] v,
TermOrder t)
The constructor creates a polynomial factory object.
|
GenPolynomialRing(RingFactory<C> cf,
TermOrder t,
java.lang.String[] v)
The constructor creates a polynomial factory object.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
characteristic()
Characteristic of this ring.
|
GenPolynomialRing<C> |
contract(int i)
Contract variables.
|
GenPolynomialRing<C> |
copy()
Copy this factory.
|
GenPolynomial<C> |
copy(GenPolynomial<C> c)
Copy polynomial c.
|
java.util.List<GenPolynomial<C>> |
copy(java.util.List<GenPolynomial<C>> L)
Copy polynomial list.
|
GenPolynomialRing<C> |
distribute()
Distributive representation as polynomial with all main variables.
|
boolean |
equals(java.lang.Object other)
Comparison with any other object.
|
GenPolynomialRing<C> |
extend(int i)
Extend variables.
|
GenPolynomialRing<C> |
extend(int i,
boolean top)
Extend variables.
|
GenPolynomialRing<C> |
extend(java.lang.String[] vn)
Extend variables.
|
GenPolynomialRing<C> |
extend(java.lang.String[] vn,
boolean top)
Extend variables.
|
GenPolynomialRing<C> |
extendLower(int i)
Extend lower variables.
|
GenPolynomialRing<C> |
extendLower(java.lang.String[] vn)
Extend lower variables.
|
GenPolynomial<C> |
fromInteger(java.math.BigInteger a)
Get a (constant) GenPolynomial<C> element from a BigInteger value.
|
GenPolynomial<C> |
fromInteger(long a)
Get a (constant) GenPolynomial<C> element from a long value.
|
java.util.List<GenPolynomial<C>> |
generators()
Get a list of the generating elements.
|
java.util.List<GenPolynomial<C>> |
generators(int modv)
Get a list of the generating elements excluding the module variables.
|
PolynomialComparator<C> |
getComparator()
Get PolynomialComparator.
|
PolynomialComparator<C> |
getComparator(boolean rev)
Get PolynomialComparator.
|
int |
getCreations()
Get the number of polynomial creations.
|
java.util.List<GenPolynomial<C>> |
getGenerators()
Get the generating elements excluding the generators for the coefficient
ring.
|
GenPolynomial<C> |
getONE()
Get the one element.
|
C |
getONECoefficient()
Get the one element from the coefficients.
|
java.lang.String[] |
getVars()
Get the variable names.
|
GenPolynomial<C> |
getZERO()
Get the zero element.
|
C |
getZEROCoefficient()
Get the zero element from the coefficients.
|
int |
hashCode()
Hash code for this polynomial ring.
|
boolean |
isAssociative()
Query if this ring is associative.
|
boolean |
isCommutative()
Query if this ring is commutative.
|
boolean |
isField()
Query if this ring is a field.
|
boolean |
isFinite()
Is this structure finite or infinite.
|
java.util.Iterator<GenPolynomial<C>> |
iterator()
Get a GenPolynomial iterator.
|
java.lang.String[] |
newVars()
New variable names.
|
static java.lang.String[] |
newVars(int n)
New variable names.
|
java.lang.String[] |
newVars(java.lang.String prefix)
New variable names.
|
static java.lang.String[] |
newVars(java.lang.String prefix,
int n)
New variable names.
|
GenPolynomial<C> |
parse(java.io.Reader r)
Parse a polynomial with the use of GenPolynomialTokenizer.
|
GenPolynomial<C> |
parse(java.lang.String s)
Parse a polynomial with the use of GenPolynomialTokenizer.
|
GenPolynomialRing<C> |
permutation(java.util.List<java.lang.Integer> P)
Permutation of polynomial ring variables.
|
static java.lang.String[] |
permuteVars(java.util.List<java.lang.Integer> P,
java.lang.String[] vars)
Permute variable names.
|
GenPolynomial<C> |
random(int n)
Random polynomial.
|
GenPolynomial<C> |
random(int k,
int l,
int d,
float q)
Generate a random polynomial.
|
GenPolynomial<C> |
random(int k,
int l,
int d,
float q,
java.util.Random rnd)
Generate a random polynomial.
|
GenPolynomial<C> |
random(int n,
java.util.Random rnd)
Random polynomial.
|
GenPolynomialRing<GenPolynomial<C>> |
recursive(int i)
Recursive representation as polynomial with i main variables.
|
GenPolynomialRing<C> |
reverse()
Reverse variables.
|
GenPolynomialRing<C> |
reverse(boolean partial)
Reverse variables.
|
java.lang.String[] |
setVars(java.lang.String[] v)
Set the variable names.
|
java.lang.String |
toScript()
Get a scripting compatible string representation.
|
java.lang.String |
toScript(ExpVector e)
Get a scripting compatible string representation of an ExpVector of this
ring.
|
java.lang.String |
toString()
Get the String representation.
|
GenPolynomial<C> |
univariate(int i)
Generate univariate polynomial in a given variable.
|
GenPolynomial<C> |
univariate(int modv,
int i,
long e)
Generate univariate polynomial in a given variable with given exponent.
|
GenPolynomial<C> |
univariate(int i,
long e)
Generate univariate polynomial in a given variable with given exponent.
|
GenPolynomial<C> |
univariate(java.lang.String x)
Generate univariate polynomial in a given variable with given exponent.
|
GenPolynomial<C> |
univariate(java.lang.String x,
long e)
Generate univariate polynomial in a given variable with given exponent.
|
java.util.List<? extends GenPolynomial<C>> |
univariateList()
Generate list of univariate polynomials in all variables.
|
java.util.List<? extends GenPolynomial<C>> |
univariateList(int modv)
Generate list of univariate polynomials in all variables.
|
java.util.List<? extends GenPolynomial<C>> |
univariateList(int modv,
long e)
Generate list of univariate polynomials in all variables with given
exponent.
|
GenPolynomial<C> |
valueOf(C a)
Get a (constant) GenPolynomial<C> element from a coefficient value.
|
GenPolynomial<C> |
valueOf(C a,
ExpVector e)
Get a GenPolynomial<C> element from a coeffcient and an exponent
vector.
|
GenPolynomial<C> |
valueOf(ExpVector e)
Get a GenPolynomial<C> element from an exponent vector.
|
java.util.List<GenPolynomial<C>> |
valueOf(java.lang.Iterable<ExpVector> E)
Get a GenPolynomial<C> element from a list of exponent vectors.
|
GenPolynomial<C> |
valueOf(Monomial<C> m)
Get a GenPolynomial<C> element from a monomial.
|
java.lang.String |
varsToString()
Get a String representation of the variable names.
|
public final RingFactory<C extends RingElem<C>> coFac
public final int nvar
protected boolean partial
protected java.lang.String[] vars
public final GenPolynomial<C extends RingElem<C>> ZERO
public final GenPolynomial<C extends RingElem<C>> ONE
protected static final java.util.Random random
protected int isField
public GenPolynomialRing(RingFactory<C> cf, int n)
cf
- factory for coefficients of type C.n
- number of variables.public GenPolynomialRing(RingFactory<C> cf, int n, TermOrder t)
cf
- factory for coefficients of type C.n
- number of variables.t
- a term order.public GenPolynomialRing(RingFactory<C> cf, java.lang.String[] v)
cf
- factory for coefficients of type C.v
- names for the variables.public GenPolynomialRing(RingFactory<C> cf, int n, java.lang.String[] v)
cf
- factory for coefficients of type C.n
- number of variables.v
- names for the variables.public GenPolynomialRing(RingFactory<C> cf, TermOrder t, java.lang.String[] v)
cf
- factory for coefficients of type C.t
- a term order.v
- names for the variables.public GenPolynomialRing(RingFactory<C> cf, java.lang.String[] v, TermOrder t)
cf
- factory for coefficients of type C.v
- names for the variables.t
- a term order.public GenPolynomialRing(RingFactory<C> cf, int n, TermOrder t, java.lang.String[] v)
cf
- factory for coefficients of type C.n
- number of variables.t
- a term order.v
- names for the variables.public GenPolynomialRing(RingFactory<C> cf, GenPolynomialRing o)
cf
- factory for coefficients of type C.o
- other polynomial ring.public GenPolynomialRing(GenPolynomialRing<C> o, TermOrder to)
to
- term order.o
- other polynomial ring.public GenPolynomialRing<C> copy()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toScript()
toScript
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
Element.toScript()
public java.lang.String toScript(ExpVector e)
e
- exponent vectorpublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public int getCreations()
public java.lang.String[] getVars()
public java.lang.String[] setVars(java.lang.String[] v)
public java.lang.String varsToString()
public C getZEROCoefficient()
public C getONECoefficient()
public GenPolynomial<C> getZERO()
getZERO
in interface AbelianGroupFactory<GenPolynomial<C extends RingElem<C>>>
public GenPolynomial<C> getONE()
getONE
in interface MonoidFactory<GenPolynomial<C extends RingElem<C>>>
public boolean isCommutative()
isCommutative
in interface MonoidFactory<GenPolynomial<C extends RingElem<C>>>
public boolean isAssociative()
isAssociative
in interface MonoidFactory<GenPolynomial<C extends RingElem<C>>>
public boolean isField()
isField
in interface RingFactory<GenPolynomial<C extends RingElem<C>>>
public java.math.BigInteger characteristic()
characteristic
in interface RingFactory<GenPolynomial<C extends RingElem<C>>>
public GenPolynomial<C> valueOf(C a)
a
- coefficient.public GenPolynomial<C> valueOf(ExpVector e)
e
- exponent vector.public java.util.List<GenPolynomial<C>> valueOf(java.lang.Iterable<ExpVector> E)
E
- list of exponent vector.public GenPolynomial<C> valueOf(C a, ExpVector e)
a
- coefficient.e
- exponent vector.public GenPolynomial<C> valueOf(Monomial<C> m)
m
- monomial.public GenPolynomial<C> fromInteger(long a)
fromInteger
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
a
- long.public GenPolynomial<C> fromInteger(java.math.BigInteger a)
fromInteger
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
a
- BigInteger.public GenPolynomial<C> random(int n)
random
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
n
- number of terms.public GenPolynomial<C> random(int n, java.util.Random rnd)
random
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
n
- number of terms.rnd
- is a source for random bits.public GenPolynomial<C> random(int k, int l, int d, float q)
k
- bitsize of random coefficients.l
- number of terms.d
- maximal degree in each variable.q
- density of nozero exponents.public GenPolynomial<C> random(int k, int l, int d, float q, java.util.Random rnd)
k
- bitsize of random coefficients.l
- number of terms.d
- maximal degree in each variable.q
- density of nozero exponents.rnd
- is a source for random bits.public GenPolynomial<C> copy(GenPolynomial<C> c)
copy
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
c
- public java.util.List<GenPolynomial<C>> copy(java.util.List<GenPolynomial<C>> L)
L
- polynomial listpublic GenPolynomial<C> parse(java.lang.String s)
parse
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
s
- String.public GenPolynomial<C> parse(java.io.Reader r)
parse
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
r
- Reader.public GenPolynomial<C> univariate(java.lang.String x)
x
- the name of a variable.public GenPolynomial<C> univariate(java.lang.String x, long e)
x
- the name of the variable.e
- the exponent of the variable.public GenPolynomial<C> univariate(int i)
i
- the index of the variable.public GenPolynomial<C> univariate(int i, long e)
i
- the index of the variable.e
- the exponent of the variable.public GenPolynomial<C> univariate(int modv, int i, long e)
modv
- number of module variables.i
- the index of the variable.e
- the exponent of the variable.public java.util.List<GenPolynomial<C>> getGenerators()
public java.util.List<GenPolynomial<C>> generators()
generators
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
ElemFactory.generators()
public java.util.List<GenPolynomial<C>> generators(int modv)
modv
- number of module variablespublic boolean isFinite()
isFinite
in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
ElemFactory.isFinite()
public java.util.List<? extends GenPolynomial<C>> univariateList()
public java.util.List<? extends GenPolynomial<C>> univariateList(int modv)
modv
- number of module variables.public java.util.List<? extends GenPolynomial<C>> univariateList(int modv, long e)
modv
- number of module variables.e
- the exponent of the variables.public GenPolynomialRing<C> extend(int i)
i
- number of variables to extend.public GenPolynomialRing<C> extend(int i, boolean top)
i
- number of variables to extend.top
- true for TOP term order, false for POT term order.public GenPolynomialRing<C> extend(java.lang.String[] vn)
vn
- names for extended variables.public GenPolynomialRing<C> extend(java.lang.String[] vn, boolean top)
vn
- names for extended variables.top
- true for TOP term order, false for POT term order.public GenPolynomialRing<C> extendLower(int i)
i
- number of variables to extend.public GenPolynomialRing<C> extendLower(java.lang.String[] vn)
vn
- names for extended lower variables.public GenPolynomialRing<C> contract(int i)
i
- number of variables to remove.public GenPolynomialRing<GenPolynomial<C>> recursive(int i)
i
- number of main variables.public GenPolynomialRing<C> distribute()
public GenPolynomialRing<C> reverse()
public GenPolynomialRing<C> reverse(boolean partial)
partial
- true for partialy reversed term orders.public PolynomialComparator<C> getComparator()
public PolynomialComparator<C> getComparator(boolean rev)
rev
- for reverse comparator.public static java.lang.String[] newVars(java.lang.String prefix, int n)
prefix
- name prefix.n
- number of variables.public java.lang.String[] newVars(java.lang.String prefix)
prefix
- name prefix.public static java.lang.String[] newVars(int n)
n
- number of variables.public java.lang.String[] newVars()
public static java.lang.String[] permuteVars(java.util.List<java.lang.Integer> P, java.lang.String[] vars)
vars
- variable names.P
- permutation.public GenPolynomialRing<C> permutation(java.util.List<java.lang.Integer> P)
P
- permutation.public java.util.Iterator<GenPolynomial<C>> iterator()
iterator
in interface java.lang.Iterable<GenPolynomial<C extends RingElem<C>>>