001/*
002 * $Id$
003 */
004
005package edu.jas.gb;
006
007import java.util.List;
008import java.io.Serializable;
009
010import edu.jas.structure.RingElem;
011import edu.jas.poly.ExpVector;
012import edu.jas.poly.TermOrder;
013import edu.jas.poly.GenPolynomial;
014import edu.jas.poly.GenPolynomialRing;
015
016
017/**
018 * Pair list management interface.
019 * @author Heinz Kredel
020 */
021
022public interface PairList<C extends RingElem<C> > extends Serializable {
023
024
025    /**
026     * Create a new PairList.
027     * @param r polynomial ring.
028     */
029    public PairList<C> create(GenPolynomialRing<C> r);
030
031
032    /**
033     * Create a new PairList.
034     * @param m number of module variables.
035     * @param r polynomial ring.
036     */
037    public PairList<C> create(int m, GenPolynomialRing<C> r);
038
039
040    /**
041     * Get polynomial ring.
042     * @return the polynomial ring.
043     */
044    public GenPolynomialRing<C> getRing();
045
046
047    /**
048     * toString.
049     */
050    @Override
051    public String toString();
052
053
054    /**
055     * Put one Polynomial to the pairlist and reduction matrix.
056     * @param p polynomial.
057     * @return the index of the added polynomial.
058     */
059    public int put(GenPolynomial<C> p);
060
061
062    /**
063     * Put all polynomials in F to the pairlist and reduction matrix.
064     * @param F polynomial list.
065     * @return the index of the last added polynomial.
066     */
067    public int put(List<GenPolynomial<C>> F);
068
069
070    /**
071     * Put to ONE-Polynomial to the pairlist.
072     * @return the index of the last polynomial.
073     */
074    public int putOne();
075
076
077    /**
078     * Remove the next required pair from the pairlist and reduction matrix.
079     * Apply the criterions 3 and 4 to see if the S-polynomial is required.
080     * @return the next pair if one exists, otherwise null.
081     */
082    public Pair<C> removeNext();
083
084
085    /**
086     * Test if there is possibly a pair in the list.
087     * @return true if a next pair could exist, otherwise false.
088     */
089    public boolean hasNext();
090
091
092    /**
093     * Get the size of the list of polynomials.
094     * @return size of the polynomial list.
095     */
096    public int size();
097
098
099    /**
100     * Get the list of polynomials.
101     * @return the polynomial list.
102     */
103    public List<GenPolynomial<C>> getList();
104
105
106    /**
107     * Set the list of polynomials.
108     * @param F the polynomial list.
109     */
110    public void setList(List<GenPolynomial<C>> F);
111
112
113    /**
114     * Get the number of polynomials put to the pairlist.
115     * @return the number of calls to put.
116     */
117    public int putCount();
118
119
120    /**
121     * Get the number of required pairs removed from the pairlist.
122     * @return the number of non null pairs delivered.
123     */
124    public int remCount();
125
126
127    /**
128     * GB criterium 3.
129     * @return true if the S-polynomial(i,j) is required.
130     */
131    public boolean criterion3(int i, int j, ExpVector eij);
132
133}
134