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