edu.jas.ring
Class CriticalPairList<C extends RingElem<C>>

java.lang.Object
  extended by edu.jas.ring.CriticalPairList<C>

public class CriticalPairList<C extends RingElem<C>>
extends java.lang.Object

Critical pair list management. Makes some effort to produce the same sequence of critical pairs as in the sequential case, when used in parallel. However already reduced pairs are not rereduced if new polynomials appear. Implemented using GenPolynomial, TreeSet and BitSet.

Author:
Heinz Kredel

Constructor Summary
CriticalPairList(GenPolynomialRing<C> r)
          Constructor for CriticalPairList.
CriticalPairList(int m, GenPolynomialRing<C> r)
          Constructor for CriticalPairList.
 
Method Summary
 boolean criterion3(int i, int j, ExpVector eij)
          GB criterium 3.
 java.util.ArrayList<GenPolynomial<C>> getList()
          Get the list of polynomials.
 CriticalPair<C> getNext()
          Get the next required pair from the pairlist.
 boolean hasNext()
          Test if there is possibly a pair in the list.
 java.util.List<CriticalPair<C>> inWork()
          In work pairs.
 int put(GenPolynomial<C> p)
          Put a polynomial to the pairlist and reduction matrix.
 int putCount()
          Get the number of polynomials put to the pairlist.
 int putOne()
          Put the ONE-Polynomial to the pairlist.
 int record(CriticalPair<C> pair, GenPolynomial<C> p)
          Record reduced polynomial.
 int remCount()
          Get the number of required pairs removed from the pairlist.
 int update()
          Update pairlist.
 int update(CriticalPair<C> pair, GenPolynomial<C> p)
          Record reduced polynomial and update critical pair list.
 int updateMany()
          Update pairlist, several pairs at once.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CriticalPairList

public CriticalPairList(GenPolynomialRing<C> r)
Constructor for CriticalPairList.

Parameters:
r - polynomial factory.

CriticalPairList

public CriticalPairList(int m,
                        GenPolynomialRing<C> r)
Constructor for CriticalPairList.

Parameters:
m - number of module variables.
r - polynomial factory.
Method Detail

put

public int put(GenPolynomial<C> p)
Put a polynomial to the pairlist and reduction matrix.

Parameters:
p - polynomial.
Returns:
the index of the added polynomial.

putOne

public int putOne()
Put the ONE-Polynomial to the pairlist.

Returns:
the index of the last polynomial.

getNext

public CriticalPair<C> getNext()
Get the next required pair from the pairlist. Appy the criterions 3 and 4 to see if the S-polynomial is required. The pair is not removed from the pair list.

Returns:
the next pair if one exists, otherwise null.

record

public int record(CriticalPair<C> pair,
                  GenPolynomial<C> p)
Record reduced polynomial.

Parameters:
pair - the corresponding critical pair.
p - polynomial.
Returns:
index of recorded polynomial, or -1 if not added.

update

public int update(CriticalPair<C> pair,
                  GenPolynomial<C> p)
Record reduced polynomial and update critical pair list. Note: it is better to use record and uptate separately.

Parameters:
pair - the corresponding critical pair.
p - polynomial.
Returns:
index of recorded polynomial

update

public int update()
Update pairlist. Preserve the sequential pair sequence. Remove pairs with completed reductions.

Returns:
the number of added polynomials.

inWork

public java.util.List<CriticalPair<C>> inWork()
In work pairs. List pairs which are currently reduced.

Returns:
list of critical pairs which are in reduction.

updateMany

public int updateMany()
Update pairlist, several pairs at once. This version does not preserve the sequential pair sequence. Remove pairs with completed reductions.

Returns:
the number of added polynomials.

hasNext

public boolean hasNext()
Test if there is possibly a pair in the list.

Returns:
true if a next pair could exist, otherwise false.

getList

public java.util.ArrayList<GenPolynomial<C>> getList()
Get the list of polynomials.

Returns:
the polynomial list.

putCount

public int putCount()
Get the number of polynomials put to the pairlist.

Returns:
the number of calls to put.

remCount

public int remCount()
Get the number of required pairs removed from the pairlist.

Returns:
the number of non null pairs delivered.

criterion3

public boolean criterion3(int i,
                          int j,
                          ExpVector eij)
GB criterium 3.

Returns:
true if the S-polynomial(i,j) is required.