Class GenWordPolynomialRing<C extends RingElem<C>>
java.lang.Object
edu.jas.poly.GenWordPolynomialRing<C>
- Type Parameters:
C- coefficient type
- All Implemented Interfaces:
AbelianGroupFactory<GenWordPolynomial<C>>, ElemFactory<GenWordPolynomial<C>>, MonoidFactory<GenWordPolynomial<C>>, RingFactory<GenWordPolynomial<C>>, Serializable
public final class GenWordPolynomialRing<C extends RingElem<C>>
extends Object
implements RingFactory<GenWordPolynomial<C>>
GenWordPolynomialRing generic polynomial factory implementing RingFactory;
Factory for non-commutative string polynomials over C.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal WordFactoryThe factory for the alphabet.(package private) final booleanFlag to enable if preemptive interrupt is checked.final RingFactory<C> The factory for the coefficients.private intIndicator if this ring is a field.private static final org.apache.logging.log4j.LoggerLog4j logger object.final GenWordPolynomial<C> The constant polynomial 1 for this ring.(package private) static final RandomA default random sequence generator.final WordThe constant empty word exponent for this ring.final GenWordPolynomial<C> The constant polynomial 0 for this ring. -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor creates a polynomial factory object.The constructor creates a polynomial factory object.GenWordPolynomialRing(RingFactory<C> cf, WordFactory wf) The constructor creates a polynomial factory object with the default term order.GenWordPolynomialRing(RingFactory<C> cf, String s) The constructor creates a polynomial factory object.GenWordPolynomialRing(RingFactory<C> cf, String[] s) The constructor creates a polynomial factory object. -
Method Summary
Modifier and TypeMethodDescriptionCharacteristic of this ring.commute()Generate commute polynomials for all variables.commute(int i) Generate commute polynomials for given variable.commute(int i, int j) Generate commute polynomial in two variables.copy()Copy this factory.copy(GenWordPolynomial<C> c) Copy polynomial c.booleanComparison with any other object.extend(int i) Extend variables.Extend variables.fromInteger(long a) Get a (constant) GenWordPolynomial<C> element from a long value.Get a (constant) GenWordPolynomial<C> element from a BigInteger value.Get a list of all generating elements.Get the generating elements excluding the generators for the coefficient ring.getONE()Get the one element.Get the one element from the coefficients.String[]getVars()Get the variable names.getZERO()Get the zero element.Get the zero element from the coefficients.inthashCode()Hash code for this polynomial ring.booleanQuery if this ring is associative.booleanQuery if this ring is commutative.booleanisField()Query if this ring is a field.booleanisFinite()Is this structure finite or infinite.Parse a polynomial with the use of GenWordPolynomialTokenizer.Parse a polynomial with the use of GenWordPolynomialTokenizer.random(int n) Random polynomial.random(int k, int l, int d) Generate a random polynomial.Generate a random polynomial.Random polynomial.toScript()Get a scripting compatible string representation.toString()Get the String representation.univariate(int i) Generate univariate polynomial in a given variable.Generate list of univariate polynomials in all variables.Get a (constant) GenWordPolynomial<C> element from a coefficient value.Get a GenWordPolynomial<C> element from a coefficient and an ExpVector.Get a GenWordPolynomial<C> element from a coefficient and a word.Get a GenWordPolynomial<C> element from an ExpVector.valueOf(GenPolynomial<C> a) Get a GenWordPolynomial<C> element from a GenPolynomial<C>.Get a GenWordPolynomial<C> element from a GenWordPolynomial<C>.Get a GenWordPolynomial<C> element from a word.valueOf(List<GenPolynomial<C>> A) Get a list of GenWordPolynomial<C> element from a list of GenPolynomial<C>.Methods inherited from interface ElemFactory
valueOf
-
Field Details
-
coFac
The factory for the coefficients. -
alphabet
The factory for the alphabet. -
ZERO
The constant polynomial 0 for this ring. -
ONE
The constant polynomial 1 for this ring. -
wone
The constant empty word exponent for this ring. -
random
A default random sequence generator. -
isField
private int isFieldIndicator if this ring is a field. -
logger
private static final org.apache.logging.log4j.Logger loggerLog4j logger object. -
checkPreempt
final boolean checkPreemptFlag to enable if preemptive interrupt is checked.
-
-
Constructor Details
-
GenWordPolynomialRing
The constructor creates a polynomial factory object with the default term order.- Parameters:
cf- factory for coefficients of type C.wf- factory for strings.
-
GenWordPolynomialRing
The constructor creates a polynomial factory object.- Parameters:
cf- factory for coefficients of type C.s- array of variable names.
-
GenWordPolynomialRing
The constructor creates a polynomial factory object.- Parameters:
cf- factory for coefficients of type C.s- string of single letter variable names.
-
GenWordPolynomialRing
The constructor creates a polynomial factory object.- Parameters:
cf- factory for coefficients of type C.o- other polynomial ring.
-
GenWordPolynomialRing
The constructor creates a polynomial factory object.- Parameters:
fac- polynomial ring.
-
-
Method Details
-
copy
-
toString
-
toScript
-
extend
Extend variables. Used e.g. in module embedding. Extend number of variables by i.- Parameters:
i- number of variables to extend.- Returns:
- extended word polynomial ring factory.
-
extend
Extend variables. Extend number of variables by length(vn).- Parameters:
vn- names for extended variables.- Returns:
- extended polynomial ring factory.
-
equals
-
hashCode
-
getVars
-
getZEROCoefficient
-
getONECoefficient
-
getZERO
Get the zero element.- Specified by:
getZEROin interfaceAbelianGroupFactory<C extends RingElem<C>>- Returns:
- 0 as GenWordPolynomial
.
-
getONE
Get the one element.- Specified by:
getONEin interfaceMonoidFactory<C extends RingElem<C>>- Returns:
- 1 as GenWordPolynomial
.
-
isCommutative
public boolean isCommutative()Query if this ring is commutative.- Specified by:
isCommutativein interfaceMonoidFactory<C extends RingElem<C>>- Returns:
- true if this ring is commutative, else false.
-
isAssociative
public boolean isAssociative()Query if this ring is associative.- Specified by:
isAssociativein interfaceMonoidFactory<C extends RingElem<C>>- Returns:
- true if this ring is associative, else false.
-
isFinite
public boolean isFinite()Is this structure finite or infinite.- Specified by:
isFinitein interfaceElemFactory<C extends RingElem<C>>- Returns:
- true if this structure is finite, else false.
- See Also:
-
isField
public boolean isField()Query if this ring is a field.- Specified by:
isFieldin interfaceRingFactory<C extends RingElem<C>>- Returns:
- false.
-
characteristic
Characteristic of this ring.- Specified by:
characteristicin interfaceRingFactory<C extends RingElem<C>>- Returns:
- characteristic of this ring.
-
valueOf
Get a (constant) GenWordPolynomial<C> element from a coefficient value.- Parameters:
a- coefficient.- Returns:
- a GenWordPolynomial<C>.
-
valueOf
Get a GenWordPolynomial<C> element from a word.- Parameters:
e- word.- Returns:
- a GenWordPolynomial<C>.
-
valueOf
Get a GenWordPolynomial<C> element from an ExpVector.- Parameters:
e- exponent vector.- Returns:
- a GenWordPolynomial<C>.
-
valueOf
Get a GenWordPolynomial<C> element from a coefficient and a word.- Parameters:
a- coefficient.e- word.- Returns:
- a GenWordPolynomial<C>.
-
valueOf
Get a GenWordPolynomial<C> element from a coefficient and an ExpVector.- Parameters:
a- coefficient.e- exponent vector.- Returns:
- a GenWordPolynomial<C>.
-
valueOf
Get a GenWordPolynomial<C> element from a GenPolynomial<C>.- Parameters:
a- GenPolynomial.- Returns:
- a GenWordPolynomial<C>.
-
valueOf
Get a GenWordPolynomial<C> element from a GenWordPolynomial<C>.- Parameters:
a- GenWordPolynomial.- Returns:
- a GenWordPolynomial<C>.
-
valueOf
Get a list of GenWordPolynomial<C> element from a list of GenPolynomial<C>.- Parameters:
A- GenPolynomial list.- Returns:
- a GenWordPolynomial<C> list.
-
fromInteger
Get a (constant) GenWordPolynomial<C> element from a long value.- Specified by:
fromIntegerin interfaceElemFactory<C extends RingElem<C>>- Parameters:
a- long.- Returns:
- a GenWordPolynomial<C>.
-
fromInteger
Get a (constant) GenWordPolynomial<C> element from a BigInteger value.- Specified by:
fromIntegerin interfaceElemFactory<C extends RingElem<C>>- Parameters:
a- BigInteger.- Returns:
- a GenWordPolynomial<C>.
-
random
Random polynomial. Generates a random polynomial.- Specified by:
randomin interfaceElemFactory<C extends RingElem<C>>- Parameters:
n- number of terms.- Returns:
- a random polynomial.
-
random
Random polynomial. Generates a random polynomial with k = 5, l = n, d = 3.- Specified by:
randomin interfaceElemFactory<C extends RingElem<C>>- Parameters:
n- number of terms.rnd- is a source for random bits.- Returns:
- a random polynomial.
-
random
Generate a random polynomial.- Parameters:
k- bitsize of random coefficients.l- number of terms.d- maximal length of a random word.- Returns:
- a random polynomial.
-
random
Generate a random polynomial.- Parameters:
k- bitsize of random coefficients.l- number of terms.d- maximal length of a random word.rnd- is a source for random bits.- Returns:
- a random polynomial.
-
copy
Copy polynomial c.- Specified by:
copyin interfaceElemFactory<C extends RingElem<C>>- Parameters:
c- polynomial to copy.- Returns:
- a copy of c.
-
parse
Parse a polynomial with the use of GenWordPolynomialTokenizer.- Specified by:
parsein interfaceElemFactory<C extends RingElem<C>>- Parameters:
s- String.- Returns:
- GenWordPolynomial from s.
-
parse
Parse a polynomial with the use of GenWordPolynomialTokenizer.- Specified by:
parsein interfaceElemFactory<C extends RingElem<C>>- Parameters:
r- Reader.- Returns:
- next GenWordPolynomial from r.
-
univariate
Generate univariate polynomial in a given variable.- Parameters:
i- the index of the variable.- Returns:
- X_i as univariate polynomial.
-
commute
Generate commute polynomial in two variables.- Parameters:
i- the index of the first variable.j- the index of the second variable.- Returns:
- X_i * x_j - X_j * X_i as polynomial.
-
commute
Generate commute polynomials for given variable.- Parameters:
i- the index of the variable.- Returns:
- [X_i * x_j - X_j * X_i, i != j] as list of polynomials.
-
commute
Generate commute polynomials for all variables.- Returns:
- [X_i * x_j - X_j * X_i, i != j] as list of polynomials.
-
univariateList
Generate list of univariate polynomials in all variables.- Returns:
- List(X_1,...,X_n) a list of univariate polynomials.
-
getGenerators
Get the generating elements excluding the generators for the coefficient ring.- Returns:
- a list of generating elements for this ring.
-
generators
Get a list of all generating elements.- Specified by:
generatorsin interfaceElemFactory<C extends RingElem<C>>- Returns:
- list of generators for the algebraic structure.
- See Also:
-