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

java.lang.Object
  extended by edu.jas.poly.RelationTable<C>
All Implemented Interfaces:
java.io.Serializable

public class RelationTable<C extends RingElem<C>>
extends java.lang.Object
implements java.io.Serializable

RelationTable for solvable polynomials. This class maintains the non-commutative multiplication relations of solvable polynomial rings. The table entries are initialized with relations of the form xj * xi = pij. During multiplication the ralations are updated by relations of the form xjk * xil = pijkl. If no relation for xj * xi is found in the table, this multiplication is assumed to be commutative xi xj.

Author:
Heinz Kredel
See Also:
Serialized Form

Field Summary
 GenSolvablePolynomialRing<C> ring
          The factory for the solvable polynomial ring.
 java.util.Map<java.util.List<java.lang.Integer>,java.util.List> table
          The data structure for the relations.
 
Constructor Summary
protected RelationTable(GenSolvablePolynomialRing<C> r)
          Constructor for RelationTable requires ring factory.
 
Method Summary
 void contract(RelationTable<C> tab)
          Contract variables.
 boolean equals(java.lang.Object p)
          RelationTable equals.
 void extend(RelationTable<C> tab)
          Extend variables.
 int hashCode()
          Hash code for this relation table.
 edu.jas.poly.TableRelation<C> lookup(ExpVector e, ExpVector f)
          Lookup RelationTable for existing relation.
protected  java.util.List<java.lang.Integer> makeKey(ExpVector e, ExpVector f)
          Construct a key for (e,f).
 void reverse(RelationTable<C> tab)
          Reverse variables and relations.
 int size()
          Size of the table.
 java.lang.String toScript()
          Get a scripting compatible string representation.
 java.lang.String toString()
          Get the String representation.
 java.lang.String toString(java.lang.String[] vars)
          Get the String representation.
 void update(ExpVector e, ExpVector f, GenSolvablePolynomial<C> p)
          Update or initialize RelationTable with new relation.
 void update(GenPolynomial<C> E, GenPolynomial<C> F, GenPolynomial<C> p)
          Update or initialize RelationTable with new relation.
 void update(GenPolynomial<C> E, GenPolynomial<C> F, GenSolvablePolynomial<C> p)
          Update or initialize RelationTable with new relation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

table

public final java.util.Map<java.util.List<java.lang.Integer>,java.util.List> table
The data structure for the relations.


ring

public final GenSolvablePolynomialRing<C extends RingElem<C>> ring
The factory for the solvable polynomial ring.

Constructor Detail

RelationTable

protected RelationTable(GenSolvablePolynomialRing<C> r)
Constructor for RelationTable requires ring factory. Note: This constructor is called within the constructor of the ring factory, so methods of this class can only be used after the other constructor has terminated.

Parameters:
r - solvable polynomial ring factory.
Method Detail

equals

public boolean equals(java.lang.Object p)
RelationTable equals. Tests same keySets only, not relations itself. Will be improved in the future.

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Hash code for this relation table.

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

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

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

toString

public java.lang.String toString(java.lang.String[] vars)
Get the String representation.

Parameters:
vars - names for the variables.
See Also:
Object.toString()

toScript

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

Returns:
script compatible representation for this relation table.

update

public void update(ExpVector e,
                   ExpVector f,
                   GenSolvablePolynomial<C> p)
Update or initialize RelationTable with new relation. relation is e * f = p.

Parameters:
e - first term.
f - second term.
p - solvable product polynomial.

update

public void update(GenPolynomial<C> E,
                   GenPolynomial<C> F,
                   GenSolvablePolynomial<C> p)
Update or initialize RelationTable with new relation. relation is e * f = p.

Parameters:
E - first term polynomial.
F - second term polynomial.
p - solvable product polynomial.

update

public void update(GenPolynomial<C> E,
                   GenPolynomial<C> F,
                   GenPolynomial<C> p)
Update or initialize RelationTable with new relation. relation is e * f = p.

Parameters:
E - first term polynomial.
F - second term polynomial.
p - product polynomial.

lookup

public edu.jas.poly.TableRelation<C> lookup(ExpVector e,
                                            ExpVector f)
Lookup RelationTable for existing relation. Find p with e * f = p. If no relation for e * f is contained in the table then return the symmetric product p = 1 e f.

Parameters:
e - first term.
f - second term.
Returns:
t table relation container, contains e' and f' with e f = e' lt(p) f'.

makeKey

protected java.util.List<java.lang.Integer> makeKey(ExpVector e,
                                                    ExpVector f)
Construct a key for (e,f).

Parameters:
e - first term.
f - second term.
Returns:
k key for (e,f).

size

public int size()
Size of the table.

Returns:
n number of non-commutative relations.

extend

public void extend(RelationTable<C> tab)
Extend variables. Used e.g. in module embedding. Extend all ExpVectors and polynomials of the given relation table by i elements and put the relations into this table, i.e. this should be empty.

Parameters:
tab - a relation table to be extended and inserted into this.

contract

public void contract(RelationTable<C> tab)
Contract variables. Used e.g. in module embedding. Contract all ExpVectors and polynomials of the given relation table by i elements and put the relations into this table, i.e. this should be empty.

Parameters:
tab - a relation table to be contracted and inserted into this.

reverse

public void reverse(RelationTable<C> tab)
Reverse variables and relations. Used e.g. in opposite rings. Reverse all ExpVectors and polynomials of the given relation table and put the modified relations into this table, i.e. this should be empty.

Parameters:
tab - a relation table to be reverted and inserted into this.