001/*
002 * $Id: WordPairList.java 4150 2012-09-01 09:18:23Z kredel $
003 */
004
005package edu.jas.gb;
006
007import java.util.List;
008
009import edu.jas.structure.RingElem;
010import edu.jas.poly.Word;
011import edu.jas.poly.TermOrder;
012import edu.jas.poly.GenWordPolynomial;
013import edu.jas.poly.GenWordPolynomialRing;
014
015
016/**
017 * WordPair list management interface.
018 * @author Heinz Kredel
019 */
020
021public interface WordPairList<C extends RingElem<C> > {
022
023
024    /**
025     * Create a new WordPairList.
026     * @param r word polynomial ring.
027     */
028    public WordPairList<C> create(GenWordPolynomialRing<C> r);
029
030
031    /**
032     * toString.
033     */
034    @Override
035    public String toString();
036
037
038    /**
039     * Put one Word Polynomial to the pairlist and reduction matrix.
040     * @param p word polynomial.
041     * @return the index of the added word polynomial.
042     */
043    public int put(GenWordPolynomial<C> p);
044
045
046    /**
047     * Put to ONE-Polynomial to the pairlist.
048     * @return the index of the last polynomial.
049     */
050    public int putOne();
051
052
053    /**
054     * Remove the next required pair from the pairlist and reduction matrix.
055     * Appy the criterions 3 and 4 to see if the S-polynomial is required.
056     * @return the next pair if one exists, otherwise null.
057     */
058    public WordPair<C> removeNext();
059
060
061    /**
062     * Test if there is possibly a pair in the list.
063     * @return true if a next pair could exist, otherwise false.
064     */
065    public boolean hasNext();
066
067
068    /**
069     * Get the list of word polynomials.
070     * @return the word polynomial list.
071     */
072    public List<GenWordPolynomial<C>> getList();
073
074
075    /**
076     * Get the number of polynomials put to the pairlist.
077     * @return the number of calls to put.
078     */
079    public int putCount();
080
081
082    /**
083     * Get the number of required pairs removed from the pairlist.
084     * @return the number of non null pairs delivered.
085     */
086    public int remCount();
087
088}
089