Package edu.jas.poly
Class GenSolvablePolynomialRing<C extends RingElem<C>>
- java.lang.Object
-
- edu.jas.poly.GenPolynomialRing<C>
-
- edu.jas.poly.GenSolvablePolynomialRing<C>
-
- Type Parameters:
C
- coefficient type.
- All Implemented Interfaces:
AbelianGroupFactory<GenPolynomial<C>>
,ElemFactory<GenPolynomial<C>>
,MonoidFactory<GenPolynomial<C>>
,RingFactory<GenPolynomial<C>>
,java.io.Serializable
,java.lang.Iterable<GenPolynomial<C>>
- Direct Known Subclasses:
LocalSolvablePolynomialRing
,QLRSolvablePolynomialRing
,QuotSolvablePolynomialRing
,RecSolvablePolynomialRing
,RecSolvableWordPolynomialRing
,ResidueSolvablePolynomialRing
,ResidueSolvableWordPolynomialRing
public class GenSolvablePolynomialRing<C extends RingElem<C>> extends GenPolynomialRing<C>
GenSolvablePolynomialRing generic solvable polynomial factory implementing RingFactory and extending GenPolynomialRing factory. Factory for n-variate ordered solvable polynomials over C. The non-commutative multiplication relations are maintained in a relation table. Almost immutable object, except variable names and relation table contents.- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description GenSolvablePolynomial<C>
ONE
The constant polynomial 1 for this ring.RelationTable<C>
table
The solvable multiplication relations.GenSolvablePolynomial<C>
ZERO
The constant polynomial 0 for this ring.
-
Constructor Summary
Constructors Constructor Description GenSolvablePolynomialRing(RingFactory<C> cf, int n)
The constructor creates a solvable polynomial factory object with the default term order and commutative relations.GenSolvablePolynomialRing(RingFactory<C> cf, int n, RelationTable<C> rt)
The constructor creates a solvable polynomial factory object with the default term order.GenSolvablePolynomialRing(RingFactory<C> cf, int n, TermOrder t)
The constructor creates a solvable polynomial factory object with the given term order and commutative relations.GenSolvablePolynomialRing(RingFactory<C> cf, int n, TermOrder t, RelationTable<C> rt)
The constructor creates a solvable polynomial factory object with the given term order.GenSolvablePolynomialRing(RingFactory<C> cf, int n, TermOrder t, java.lang.String[] v)
The constructor creates a solvable polynomial factory object with the given term order and commutative relations.GenSolvablePolynomialRing(RingFactory<C> cf, int n, TermOrder t, java.lang.String[] v, RelationTable<C> rt)
The constructor creates a solvable polynomial factory object with the given term order.GenSolvablePolynomialRing(RingFactory<C> cf, GenPolynomialRing o)
The constructor creates a solvable 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 and the solvable multiplication relations are empty.GenSolvablePolynomialRing(RingFactory<C> cf, TermOrder t, java.lang.String[] v)
The constructor creates a solvable polynomial factory object with the given term order and commutative relations.GenSolvablePolynomialRing(RingFactory<C> cf, java.lang.String[] v)
The constructor creates a solvable polynomial factory object with the default term order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRelations(RelationGenerator<C> rg)
Generate the relation table of the solvable polynomial ring from a relation generator.void
addRelations(java.util.List<GenPolynomial<C>> rel)
Generate the relation table of the solvable polynomial ring from a polynomial list of relations.void
addSolvRelations(java.util.List<GenSolvablePolynomial<C>> rel)
Generate the relation table of the solvable polynomial ring from a solvable polynomial list of relations.GenSolvablePolynomialRing<C>
contract(int i)
Contract variables.GenSolvablePolynomial<C>
copy(GenSolvablePolynomial<C> c)
Copy polynomial c.GenSolvablePolynomialRing<C>
distribute()
Distributive representation as polynomial with all main variables.boolean
equals(java.lang.Object other)
Comparison with any other object.GenSolvablePolynomialRing<C>
extend(int i)
Extend variables.GenSolvablePolynomialRing<C>
extend(int i, boolean top)
Extend variables.GenSolvablePolynomialRing<C>
extend(java.lang.String[] vn)
Extend variables.GenSolvablePolynomialRing<C>
extend(java.lang.String[] vn, boolean top)
Extend variables.GenSolvablePolynomial<C>
fromInteger(long a)
Get a (constant) GenSolvablePolynomial<C> element from a long value.GenSolvablePolynomial<C>
fromInteger(java.math.BigInteger a)
Get a (constant) GenSolvablePolynomial<C> element from a BigInteger value.GenSolvablePolynomial<C>
getONE()
Get the one element.GenSolvablePolynomial<C>
getZERO()
Get the zero element.int
hashCode()
Hash code for this polynomial ring.boolean
isAssociative()
Query if this ring is associative.boolean
isCommutative()
Query if this ring is commutative.GenSolvablePolynomial<C>
parse(java.io.Reader r)
Parse a solvable polynomial with the use of GenPolynomialTokenizerGenSolvablePolynomial<C>
parse(java.lang.String s)
Parse a solvable polynomial with the use of GenPolynomialTokenizerGenPolynomialRing<C>
permutation(java.util.List<java.lang.Integer> P)
Permutation of polynomial ring variables.GenSolvablePolynomial<C>
random(int n)
Random solvable polynomial.GenSolvablePolynomial<C>
random(int k, int l, int d, float q)
Generate a random solvable polynomial.GenSolvablePolynomial<C>
random(int k, int l, int d, float q, java.util.Random rnd)
Random solvable polynomial.GenSolvablePolynomial<C>
random(int n, java.util.Random rnd)
Random solvable polynomial.GenSolvablePolynomialRing<GenPolynomial<C>>
recursive(int i)
Recursive representation as polynomial ring with i main variables.GenSolvablePolynomialRing<C>
reverse()
Reverse variables.GenSolvablePolynomialRing<C>
reverse(boolean partial)
Reverse variables.java.lang.String
toScript()
Get a scripting compatible string representation.java.lang.String
toString()
Get the String representation.GenSolvablePolynomial<C>
univariate(int i)
Generate univariate solvable polynomial in a given variable.GenSolvablePolynomial<C>
univariate(int modv, int i, long e)
Generate univariate solvable polynomial in a given variable with given exponent.GenSolvablePolynomial<C>
univariate(int i, long e)
Generate univariate solvable polynomial in a given variable with given exponent.java.util.List<? extends GenSolvablePolynomial<C>>
univariateList()
Generate list of univariate polynomials in all variables.java.util.List<? extends GenSolvablePolynomial<C>>
univariateList(int modv)
Generate list of univariate polynomials in all variables.java.util.List<? extends GenSolvablePolynomial<C>>
univariateList(int modv, long e)
Generate list of univariate polynomials in all variables with given exponent.GenSolvablePolynomial<C>
valueOf(C a)
Get a (constant) GenPolynomial<C> element from a coefficient value.GenSolvablePolynomial<C>
valueOf(C a, ExpVector e)
Get a GenPolynomial<C> element from a coefficient and an exponent vector.GenSolvablePolynomial<C>
valueOf(ExpVector e)
Get a GenPolynomial<C> element from an exponent vector.-
Methods inherited from class edu.jas.poly.GenPolynomialRing
characteristic, charPolynomial, copy, copy, copy, determinant, determinantFromCharPol, extendLower, extendLower, extendLower, fromVector, generators, generators, getComparator, getComparator, getCreations, getGenerators, getONECoefficient, getVars, getZEROCoefficient, isField, isFinite, iterator, newVars, newVars, newVars, newVars, permuteVars, setVars, toScript, traceFromCharPol, univariate, univariate, valueOf, valueOf, varsToString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.jas.structure.ElemFactory
valueOf
-
-
-
-
Field Detail
-
table
public final RelationTable<C extends RingElem<C>> table
The solvable multiplication relations.
-
ZERO
public GenSolvablePolynomial<C extends RingElem<C>> ZERO
The constant polynomial 0 for this ring. Hides super ZERO.
-
ONE
public GenSolvablePolynomial<C extends RingElem<C>> ONE
The constant polynomial 1 for this ring. Hides super ONE.
-
-
Constructor Detail
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, int n)
The constructor creates a solvable polynomial factory object with the default term order and commutative relations.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, int n, RelationTable<C> rt)
The constructor creates a solvable polynomial factory object with the default term order.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.rt
- solvable multiplication relations.
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, int n, TermOrder t)
The constructor creates a solvable polynomial factory object with the given term order and commutative relations.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.t
- a term order.
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, int n, TermOrder t, RelationTable<C> rt)
The constructor creates a solvable polynomial factory object with the given term order.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.t
- a term order.rt
- solvable multiplication relations.
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, int n, TermOrder t, java.lang.String[] v)
The constructor creates a solvable polynomial factory object with the given term order and commutative relations.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.t
- a term order.v
- names for the variables.
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, TermOrder t, java.lang.String[] v)
The constructor creates a solvable polynomial factory object with the given term order and commutative relations.- Parameters:
cf
- factory for coefficients of type C.t
- a term order.v
- names for the variables.
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, java.lang.String[] v)
The constructor creates a solvable polynomial factory object with the default term order.- Parameters:
cf
- factory for coefficients of type C.v
- names for the variables.
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, int n, TermOrder t, java.lang.String[] v, RelationTable<C> rt)
The constructor creates a solvable polynomial factory object with the given term order.- Parameters:
cf
- factory for coefficients of type C.n
- number of variables.t
- a term order.v
- names for the variables.rt
- solvable multiplication relations.
-
GenSolvablePolynomialRing
public GenSolvablePolynomialRing(RingFactory<C> cf, GenPolynomialRing o)
The constructor creates a solvable 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 and the solvable multiplication relations are empty.- Parameters:
cf
- factory for coefficients of type C.o
- other (solvable) polynomial ring.
-
-
Method Detail
-
addRelations
public void addRelations(RelationGenerator<C> rg)
Generate the relation table of the solvable polynomial ring from a relation generator.- Parameters:
rg
- relation generator.
-
addRelations
public void addRelations(java.util.List<GenPolynomial<C>> rel)
Generate the relation table of the solvable polynomial ring from a polynomial list of relations.- Parameters:
rel
- polynomial list of relations [..., ei, fj, pij, ... ] with ei * fj = pij.
-
addSolvRelations
public void addSolvRelations(java.util.List<GenSolvablePolynomial<C>> rel)
Generate the relation table of the solvable polynomial ring from a solvable polynomial list of relations.- Parameters:
rel
- solvable polynomial list of relations [..., ei, fj, pij, ... ] with ei * fj = pij.
-
toString
public java.lang.String toString()
Get the String representation.- Overrides:
toString
in classGenPolynomialRing<C extends RingElem<C>>
- See Also:
Object.toString()
-
toScript
public java.lang.String toScript()
Get a scripting compatible string representation.- Specified by:
toScript
in interfaceElemFactory<C extends RingElem<C>>
- Overrides:
toScript
in classGenPolynomialRing<C extends RingElem<C>>
- Returns:
- script compatible representation for this Element.
- See Also:
Element.toScript()
-
equals
public boolean equals(java.lang.Object other)
Comparison with any other object.- Overrides:
equals
in classGenPolynomialRing<C extends RingElem<C>>
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Hash code for this polynomial ring.- Overrides:
hashCode
in classGenPolynomialRing<C extends RingElem<C>>
- See Also:
Object.hashCode()
-
getZERO
public GenSolvablePolynomial<C> getZERO()
Get the zero element.- Specified by:
getZERO
in interfaceAbelianGroupFactory<C extends RingElem<C>>
- Overrides:
getZERO
in classGenPolynomialRing<C extends RingElem<C>>
- Returns:
- 0 as GenSolvablePolynomial
.
-
getONE
public GenSolvablePolynomial<C> getONE()
Get the one element.- Specified by:
getONE
in interfaceMonoidFactory<C extends RingElem<C>>
- Overrides:
getONE
in classGenPolynomialRing<C extends RingElem<C>>
- Returns:
- 1 as GenSolvablePolynomial
.
-
isCommutative
public boolean isCommutative()
Query if this ring is commutative.- Specified by:
isCommutative
in interfaceMonoidFactory<C extends RingElem<C>>
- Overrides:
isCommutative
in classGenPolynomialRing<C extends RingElem<C>>
- Returns:
- true if this ring is commutative, else false.
-
isAssociative
public boolean isAssociative()
Query if this ring is associative. Test if the relations define an associative solvable ring.- Specified by:
isAssociative
in interfaceMonoidFactory<C extends RingElem<C>>
- Overrides:
isAssociative
in classGenPolynomialRing<C extends RingElem<C>>
- Returns:
- true, if this ring is associative, else false.
-
valueOf
public GenSolvablePolynomial<C> valueOf(C a)
Get a (constant) GenPolynomial<C> element from a coefficient value.- Overrides:
valueOf
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
a
- coefficient.- Returns:
- a GenPolynomial<C>.
-
valueOf
public GenSolvablePolynomial<C> valueOf(ExpVector e)
Get a GenPolynomial<C> element from an exponent vector.- Overrides:
valueOf
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
e
- exponent vector.- Returns:
- a GenPolynomial<C>.
-
valueOf
public GenSolvablePolynomial<C> valueOf(C a, ExpVector e)
Get a GenPolynomial<C> element from a coefficient and an exponent vector.- Overrides:
valueOf
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
a
- coefficient.e
- exponent vector.- Returns:
- a GenPolynomial<C>.
-
fromInteger
public GenSolvablePolynomial<C> fromInteger(long a)
Get a (constant) GenSolvablePolynomial<C> element from a long value.- Specified by:
fromInteger
in interfaceElemFactory<C extends RingElem<C>>
- Overrides:
fromInteger
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
a
- long.- Returns:
- a GenSolvablePolynomial<C>.
-
fromInteger
public GenSolvablePolynomial<C> fromInteger(java.math.BigInteger a)
Get a (constant) GenSolvablePolynomial<C> element from a BigInteger value.- Specified by:
fromInteger
in interfaceElemFactory<C extends RingElem<C>>
- Overrides:
fromInteger
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
a
- BigInteger.- Returns:
- a GenSolvablePolynomial<C>.
-
random
public GenSolvablePolynomial<C> random(int n)
Random solvable polynomial. Generates a random solvable polynomial with k = 5, l = n, d = (nvar == 1) ? n : 3, q = (nvar == 1) ? 0.7 : 0.3.- Specified by:
random
in interfaceElemFactory<C extends RingElem<C>>
- Overrides:
random
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
n
- number of terms.- Returns:
- a random solvable polynomial.
-
random
public GenSolvablePolynomial<C> random(int n, java.util.Random rnd)
Random solvable polynomial. Generates a random solvable polynomial with k = 5, l = n, d = (nvar == 1) ? n : 3, q = (nvar == 1) ? 0.7 : 0.3.- Specified by:
random
in interfaceElemFactory<C extends RingElem<C>>
- Overrides:
random
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
n
- number of terms.rnd
- is a source for random bits.- Returns:
- a random solvable polynomial.
-
random
public GenSolvablePolynomial<C> random(int k, int l, int d, float q)
Generate a random solvable polynomial.- Overrides:
random
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
k
- bitsize of random coefficients.l
- number of terms.d
- maximal degree in each variable.q
- density of nozero exponents.- Returns:
- a random solvable polynomial.
-
random
public GenSolvablePolynomial<C> random(int k, int l, int d, float q, java.util.Random rnd)
Random solvable polynomial.- Overrides:
random
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
k
- size 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.- Returns:
- a random solvable polynomial.
-
copy
public GenSolvablePolynomial<C> copy(GenSolvablePolynomial<C> c)
Copy polynomial c.- Parameters:
c
-- Returns:
- a copy of c.
-
parse
public GenSolvablePolynomial<C> parse(java.lang.String s)
Parse a solvable polynomial with the use of GenPolynomialTokenizer- Specified by:
parse
in interfaceElemFactory<C extends RingElem<C>>
- Overrides:
parse
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
s
- String.- Returns:
- GenSolvablePolynomial from s.
-
parse
public GenSolvablePolynomial<C> parse(java.io.Reader r)
Parse a solvable polynomial with the use of GenPolynomialTokenizer- Specified by:
parse
in interfaceElemFactory<C extends RingElem<C>>
- Overrides:
parse
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
r
- Reader.- Returns:
- next GenSolvablePolynomial from r.
-
univariate
public GenSolvablePolynomial<C> univariate(int i)
Generate univariate solvable polynomial in a given variable.- Overrides:
univariate
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
i
- the index of the variable.- Returns:
- X_i as solvable univariate polynomial.
-
univariate
public GenSolvablePolynomial<C> univariate(int i, long e)
Generate univariate solvable polynomial in a given variable with given exponent.- Overrides:
univariate
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
i
- the index of the variable.e
- the exponent of the variable.- Returns:
- X_i^e as solvable univariate polynomial.
-
univariate
public GenSolvablePolynomial<C> univariate(int modv, int i, long e)
Generate univariate solvable polynomial in a given variable with given exponent.- Overrides:
univariate
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
modv
- number of module variables.i
- the index of the variable.e
- the exponent of the variable.- Returns:
- X_i^e as solvable univariate polynomial.
-
univariateList
public java.util.List<? extends GenSolvablePolynomial<C>> univariateList()
Generate list of univariate polynomials in all variables.- Overrides:
univariateList
in classGenPolynomialRing<C extends RingElem<C>>
- Returns:
- List(X_1,...,X_n) a list of univariate polynomials.
-
univariateList
public java.util.List<? extends GenSolvablePolynomial<C>> univariateList(int modv)
Generate list of univariate polynomials in all variables.- Overrides:
univariateList
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
modv
- number of module variables.- Returns:
- List(X_1,...,X_n) a list of univariate polynomials.
-
univariateList
public java.util.List<? extends GenSolvablePolynomial<C>> univariateList(int modv, long e)
Generate list of univariate polynomials in all variables with given exponent.- Overrides:
univariateList
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
modv
- number of module variables.e
- the exponent of the variables.- Returns:
- List(X_1^e,...,X_n^e) a list of univariate polynomials.
-
extend
public GenSolvablePolynomialRing<C> extend(int i)
Extend variables. Used e.g. in module embedding. Extend number of variables by i. New variables commute with the exiting variables.- Overrides:
extend
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
i
- number of variables to extend.- Returns:
- extended solvable polynomial ring factory.
-
extend
public GenSolvablePolynomialRing<C> extend(int i, boolean top)
Extend variables. Used e.g. in module embedding. Extend number of variables by i. New variables commute with the exiting variables.- Overrides:
extend
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
i
- number of variables to extend.top
- true for TOP term order, false for POT term order.- Returns:
- extended solvable polynomial ring factory.
-
extend
public GenSolvablePolynomialRing<C> extend(java.lang.String[] vn)
Extend variables. Used e.g. in module embedding. Extend number of variables by length(vn). New variables commute with the exiting variables.- Overrides:
extend
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
vn
- names for extended variables.- Returns:
- extended polynomial ring factory.
-
extend
public GenSolvablePolynomialRing<C> extend(java.lang.String[] vn, boolean top)
Extend variables. Used e.g. in module embedding. Extend number of variables by length(vn). New variables commute with the exiting variables.- Overrides:
extend
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
vn
- names for extended variables.top
- true for TOP term order, false for POT term order.- Returns:
- extended polynomial ring factory.
-
contract
public GenSolvablePolynomialRing<C> contract(int i)
Contract variables. Used e.g. in module embedding. Contract number of variables by i.- Overrides:
contract
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
i
- number of variables to remove.- Returns:
- contracted solvable polynomial ring factory.
-
reverse
public GenSolvablePolynomialRing<C> reverse()
Reverse variables. Used e.g. in opposite rings.- Overrides:
reverse
in classGenPolynomialRing<C extends RingElem<C>>
- Returns:
- solvable polynomial ring factory with reversed variables.
-
reverse
public GenSolvablePolynomialRing<C> reverse(boolean partial)
Reverse variables. Used e.g. in opposite rings.- Overrides:
reverse
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
partial
- true for partially reversed term orders.- Returns:
- solvable polynomial ring factory with reversed variables.
-
recursive
public GenSolvablePolynomialRing<GenPolynomial<C>> recursive(int i)
Recursive representation as polynomial ring with i main variables.- Overrides:
recursive
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
i
- number of main variables.- Returns:
- recursive polynomial ring factory.
-
distribute
public GenSolvablePolynomialRing<C> distribute()
Distributive representation as polynomial with all main variables.- Overrides:
distribute
in classGenPolynomialRing<C extends RingElem<C>>
- Returns:
- distributive polynomial ring factory.
-
permutation
public GenPolynomialRing<C> permutation(java.util.List<java.lang.Integer> P)
Permutation of polynomial ring variables.- Overrides:
permutation
in classGenPolynomialRing<C extends RingElem<C>>
- Parameters:
P
- permutation, must be compatible with the commutator relations.- Returns:
- P(this).
-
-