edu.jas.poly
Class GenSolvablePolynomialRing<C extends RingElem<C>>

java.lang.Object
  extended by edu.jas.poly.GenPolynomialRing<C>
      extended by 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.Cloneable, java.lang.Iterable<GenPolynomial<C>>

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
 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.
 
Fields inherited from class edu.jas.poly.GenPolynomialRing
coFac, evzero, isField, nvar, partial, random, tord, vars
 
Constructor Summary
GenSolvablePolynomialRing(RingFactory<C> cf, GenSolvablePolynomialRing 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, 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.
 
Method Summary
 GenSolvablePolynomialRing<C> contract(int i)
          Contract variables.
 GenSolvablePolynomial<C> copy(GenSolvablePolynomial<C> c)
          Copy polynomial c.
 boolean equals(java.lang.Object other)
          Comparison with any other object.
 GenSolvablePolynomialRing<C> extend(int i)
          Extend variables.
 GenSolvablePolynomial<C> fromInteger(java.math.BigInteger a)
          Get a (constant) GenSolvablePolynomial<C> element from a BigInteger value.
 GenSolvablePolynomial<C> fromInteger(long a)
          Get a (constant) GenSolvablePolynomial<C> element from a long 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 GenPolynomialTokenizer
 GenSolvablePolynomial<C> parse(java.lang.String s)
          Parse a solvable polynomial with the use of GenPolynomialTokenizer
 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<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<GenSolvablePolynomial<C>> univariateList()
          Generate list of univariate polynomials in all variables.
 java.util.List<GenSolvablePolynomial<C>> univariateList(int modv)
          Generate list of univariate polynomials in all variables.
 java.util.List<GenSolvablePolynomial<C>> univariateList(int modv, long e)
          Generate list of univariate polynomials in all variables with given exponent.
 
Methods inherited from class edu.jas.poly.GenPolynomialRing
addVars, characteristic, clone, copy, extend, extendLower, extendLower, generators, getComparator, getComparator, getGenerators, getONECoefficient, getVars, getZEROCoefficient, isField, isFinite, iterator, newVars, newVars, newVars, newVars, recursive, setVars, varsToString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

table

public final RelationTable<C extends RingElem<C>> table
The solvable multiplication relations.


ZERO

public final GenSolvablePolynomial<C extends RingElem<C>> ZERO
The constant polynomial 0 for this ring. Hides super ZERO.


ONE

public final 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,
                                 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,
                                 GenSolvablePolynomialRing 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

toString

public java.lang.String toString()
Get the String representation.

Overrides:
toString in class GenPolynomialRing<C extends RingElem<C>>
See Also:
Object.toString()

toScript

public java.lang.String toScript()
Get a scripting compatible string representation.

Specified by:
toScript in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
toScript in class GenPolynomialRing<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 class GenPolynomialRing<C extends RingElem<C>>
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Hash code for this polynomial ring.

Overrides:
hashCode in class GenPolynomialRing<C extends RingElem<C>>
See Also:
Object.hashCode()

getZERO

public GenSolvablePolynomial<C> getZERO()
Get the zero element.

Specified by:
getZERO in interface AbelianGroupFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
getZERO in class GenPolynomialRing<C extends RingElem<C>>
Returns:
0 as GenSolvablePolynomial.

getONE

public GenSolvablePolynomial<C> getONE()
Get the one element.

Specified by:
getONE in interface MonoidFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
getONE in class GenPolynomialRing<C extends RingElem<C>>
Returns:
1 as GenSolvablePolynomial.

isCommutative

public boolean isCommutative()
Query if this ring is commutative.

Specified by:
isCommutative in interface MonoidFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
isCommutative in class GenPolynomialRing<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 interface MonoidFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
isAssociative in class GenPolynomialRing<C extends RingElem<C>>
Returns:
true, if this ring is associative, else false.

fromInteger

public GenSolvablePolynomial<C> fromInteger(long a)
Get a (constant) GenSolvablePolynomial<C> element from a long value.

Specified by:
fromInteger in interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
fromInteger in class GenPolynomialRing<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 interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
fromInteger in class GenPolynomialRing<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 interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
random in class GenPolynomialRing<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 interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
random in class GenPolynomialRing<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 class GenPolynomialRing<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 class GenPolynomialRing<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 interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
parse in class GenPolynomialRing<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 interface ElemFactory<GenPolynomial<C extends RingElem<C>>>
Overrides:
parse in class GenPolynomialRing<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 class GenPolynomialRing<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 class GenPolynomialRing<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 class GenPolynomialRing<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<GenSolvablePolynomial<C>> univariateList()
Generate list of univariate polynomials in all variables.

Overrides:
univariateList in class GenPolynomialRing<C extends RingElem<C>>
Returns:
List(X_1,...,X_n) a list of univariate polynomials.

univariateList

public java.util.List<GenSolvablePolynomial<C>> univariateList(int modv)
Generate list of univariate polynomials in all variables.

Overrides:
univariateList in class GenPolynomialRing<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<GenSolvablePolynomial<C>> univariateList(int modv,
                                                               long e)
Generate list of univariate polynomials in all variables with given exponent.

Overrides:
univariateList in class GenPolynomialRing<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.

Overrides:
extend in class GenPolynomialRing<C extends RingElem<C>>
Parameters:
i - number of variables to extend.
Returns:
extended solvable 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 class GenPolynomialRing<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 class GenPolynomialRing<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 class GenPolynomialRing<C extends RingElem<C>>
Parameters:
partial - true for partialy reversed term orders.
Returns:
solvable polynomial ring factory with reversed variables.